DCMTK  Version 3.6.1 20120515
OFFIS DICOM Toolkit
Public Member Functions | Private Member Functions | Private Attributes
SiCertificate Class Reference

a class representing X.509 public key certificates. More...

List of all members.

Public Member Functions

 SiCertificate ()
 default constructor
virtual ~SiCertificate ()
 destructor
OFCondition loadCertificate (const char *filename, int filetype)
 loads an X.509 certificate from file.
OFCondition read (DcmItem &item)
 reads an X.509 certificate from an item of the Digital Signatures Sequence and checks the certificate type information in the item.
OFCondition write (DcmItem &item)
 writes the current X.509 certificate into an item of the Digital Signatures Sequence and creates the certificate type information in the item.
E_KeyType getKeyType ()
 returns the type of public key stored in this certificate
SiAlgorithmcreateAlgorithmForPublicKey ()
 creates an SiAlgorithm object for the public key contained in this certificate.
long getX509Version ()
 returns the format version of the X.509 certificate.
void getCertSubjectName (OFString &str)
 returns the subject name (distinguished name) of the current certificate.
void getCertIssuerName (OFString &str)
 returns the issuer name (distinguished name) of the current certificate.
long getCertSerialNo ()
 returns the serial number of the X.509 certificate.
void getCertValidityNotBefore (OFString &str)
 returns the start of validity of the current certificate in human readable form.
void getCertValidityNotAfter (OFString &str)
 returns the end of validity of the current certificate in human readable form.
long getCertKeyBits ()
 returns the strength (number of bits) of the public key contained in the current certificate.
X509 * getRawCertificate ()
 returns a pointer to the raw certificate structure or NULL if no certificate present.

Private Member Functions

 SiCertificate (SiCertificate &arg)
 private undefined copy constructor
SiCertificateoperator= (SiCertificate &arg)
 private undefined copy assignment operator

Private Attributes

X509 * x509
 OpenSSL X.509 structure.

Detailed Description

a class representing X.509 public key certificates.


Member Function Documentation

creates an SiAlgorithm object for the public key contained in this certificate.

If no certificate loaded or operation fails, returns NULL. New SiAlgorithm object must be deleted by caller.

Returns:
pointer to new SiAlgorithm object

returns the issuer name (distinguished name) of the current certificate.

If no certificate is loaded, returns an empty string.

Parameters:
strissuer name returned in this string.

returns the strength (number of bits) of the public key contained in the current certificate.

If no certificate is loaded, returns 0.

Returns:
key strength in bits.

returns the serial number of the X.509 certificate.

If no certificate is loaded, returns -1.

Returns:
X.509 certificate serial number

returns the subject name (distinguished name) of the current certificate.

If no certificate is loaded, returns an empty string.

Parameters:
strsubject name returned in this string.

returns the end of validity of the current certificate in human readable form.

If no certificate is loaded, returns an empty string.

Parameters:
strend of validity returned in this string.

returns the start of validity of the current certificate in human readable form.

If no certificate is loaded, returns an empty string.

Parameters:
strstart of validity returned in this string.

returns a pointer to the raw certificate structure or NULL if no certificate present.

Should not be called by users of this library.

returns the format version of the X.509 certificate.

If no certificate is loaded, returns 0.

Returns:
X.509 certificate version
OFCondition SiCertificate::loadCertificate ( const char *  filename,
int  filetype 
)

loads an X.509 certificate from file.

Parameters:
filenamefile name of X.509 certificate
filetypefile format: X509_FILETYPE_PEM or X509_FILETYPE_ASN1
Returns:
status code

reads an X.509 certificate from an item of the Digital Signatures Sequence and checks the certificate type information in the item.

Parameters:
itemitem of the DigitalSignatureSQ from which the certificate is read
Returns:
status code

writes the current X.509 certificate into an item of the Digital Signatures Sequence and creates the certificate type information in the item.

Parameters:
itemitem of the DigitalSignatureSQ to which the certificate is written
Returns:
dcmdata OFCondition status code

The documentation for this class was generated from the following file:


Generated on Tue May 15 2012 for DCMTK Version 3.6.1 20120515 by Doxygen 1.7.5.1-20111027