DCMTK  Version 3.6.2
OFFIS DICOM Toolkit
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SiCertificateVerifier Class Reference

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

Public Member Functions

 SiCertificateVerifier ()
 default constructor
 
virtual ~SiCertificateVerifier ()
 destructor
 
OFCondition addTrustedCertificateFile (const char *fileName, int fileType)
 loads a certificate from a file and adds it to the pool of trusted certificates. More...
 
OFCondition addTrustedCertificateDir (const char *pathName, int fileType)
 loads all files as certificates from the specified directory and adds them to the pool of trusted certificates. More...
 
OFCondition addCertificateRevocationList (const char *fileName, int fileType)
 loads a certificate revocation list (CRL) in X.509 format from a file and adds it to the pool of trusted certificates and CRLs. More...
 
OFCondition verifyCertificate (SiCertificate &certificate)
 verifies a certificate against the known trusted CA certificates and certificate revocation lists. More...
 
const char * lastError () const
 returns an error string containing a textual description of the result of the last call to verifyCertificate() if that call returned SI_EC_VerificationFailed_NoTrust. More...
 

Private Member Functions

 SiCertificateVerifier (SiCertificateVerifier &arg)
 private undefined copy constructor
 
SiCertificateVerifieroperator= (SiCertificateVerifier &arg)
 private undefined copy assignment operator
 

Private Attributes

X509_STORE * x509store
 OpenSSL X.509 certificate store.
 
long errorCode
 OpenSSL X.509 certificate verification error code for the last operation.
 

Detailed Description

a class representing X.509 public key certificates.

Member Function Documentation

◆ addCertificateRevocationList()

OFCondition SiCertificateVerifier::addCertificateRevocationList ( const char *  fileName,
int  fileType 
)

loads a certificate revocation list (CRL) in X.509 format from a file and adds it to the pool of trusted certificates and CRLs.

Parameters
fileNamepath to the CRL file
filetypefile format: X509_FILETYPE_PEM or X509_FILETYPE_ASN1
Returns
SI_EC_Normal if successful, an error code otherwise

◆ addTrustedCertificateDir()

OFCondition SiCertificateVerifier::addTrustedCertificateDir ( const char *  pathName,
int  fileType 
)

loads all files as certificates from the specified directory and adds them to the pool of trusted certificates.

Parameters
fileNamepath to the directory containing certificate files
filetypefile format: X509_FILETYPE_PEM or X509_FILETYPE_ASN1
Returns
SI_EC_Normal if successful, an error code otherwise

◆ addTrustedCertificateFile()

OFCondition SiCertificateVerifier::addTrustedCertificateFile ( const char *  fileName,
int  fileType 
)

loads a certificate from a file and adds it to the pool of trusted certificates.

Parameters
fileNamepath to the certificate file
filetypefile format: X509_FILETYPE_PEM or X509_FILETYPE_ASN1
Returns
SI_EC_Normal if successful, an error code otherwise

◆ lastError()

const char* SiCertificateVerifier::lastError ( ) const

returns an error string containing a textual description of the result of the last call to verifyCertificate() if that call returned SI_EC_VerificationFailed_NoTrust.

Returns
text string

◆ verifyCertificate()

OFCondition SiCertificateVerifier::verifyCertificate ( SiCertificate certificate)

verifies a certificate against the known trusted CA certificates and certificate revocation lists.

Returns a status flag and stores a detailed error description that can be retrieved with lastError().

Parameters
certificatethe certificate to verify
Returns
SI_EC_Normal if successful, an error code otherwise. If the certificate could not be verified, returns SI_EC_VerificationFailed_NoTrust.

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


Generated on Mon Jul 17 2017 for DCMTK Version 3.6.2 by Doxygen 1.8.13