C++ Based OPC UA Client/Server/PubSub SDK
1.7.8.584
|
Class for handling revocation lists. More...
#include <uapkirevocationlist.h>
Public Member Functions | |
UaPkiRevocationList () | |
construction | |
UaPkiRevocationList (long validity, const UaPkiIdentity &issuer, long iCrlNumber) | |
Constructor. More... | |
UaPkiRevocationList (const UaPkiRevocationList ©) | |
construction | |
~UaPkiRevocationList () | |
destruction | |
UaPkiRevocationList & | operator= (const UaPkiRevocationList ©) |
Assignment operator. More... | |
bool | operator== (const UaPkiRevocationList &other) const |
Compares the issuer name of the CRL to another one. More... | |
void | addRevoked (const UaPkiCertificate &cert, const UaDateTime &revocationDate) |
Adds a certificate to the revocation list. More... | |
bool | verify (const UaPkiPrivateKey &issuerPrivateKey) const |
Verifies the signature of the revocation list. More... | |
bool | sign (const UaPkiPrivateKey &issuerPrivateKey) |
Signs the revocation list. More... | |
UaPkiIdentity | issuer () const |
Returns the identity of the revocation list's issuer. More... | |
long | crlNumber () const |
Returns the number of the revocation list. More... | |
UaByteArray | toDER () const |
Encodes the revocation list into DER format. More... | |
int | toDERFile (const char *szFile) const |
Stores the revocation list into a DER encoded file. More... | |
int | toDERFile (const UaString &sFile) const |
Stores the revocation list into a DER encoded file. More... | |
int | toPEMFile (const char *szFile) const |
Stores the revocation list into a PEM encoded file. More... | |
int | toPEMFile (const UaString &sFile) const |
Stores the revocation list into a PEM encoded file. More... | |
UaByteArray | thumbPrint () const |
Creates the SHA1 thumbprint of the certificate revocation list. More... | |
UaString | createCrlFilePath (const UaString &basePath) const |
Creates a filepath that can be used to save a crl to a file. More... | |
int | toWindowsStore (WindowsStoreLocation location, const UaString &sStoreName) const |
Stores the revocation list in the given windows certificate store. More... | |
Static Public Member Functions | |
static UaPkiRevocationList | fromDER (const UaByteArray &DERdata) |
Loads a revocation list from a DER encoded byte array. More... | |
static UaPkiRevocationList | fromFile (const char *szFile) |
Loads a revocation list from a DER or PEM encoded file. More... | |
static UaPkiRevocationList | fromFile (const UaString &sFile) |
Loads a revocation list from a DER or PEM encoded file. More... | |
static UaPkiRevocationList | fromDERFile (const char *szFile) |
Loads a revocation list from a DER encoded file. More... | |
static UaPkiRevocationList | fromDERFile (const UaString &sFile) |
Loads a revocation list from a DER encoded file. More... | |
static UaPkiRevocationList | fromPEMFile (const char *szFile) |
Loads a revocation list from a PEM encoded file. More... | |
static UaPkiRevocationList | fromPEMFile (const UaString &sFile) |
Loads a revocation list from a PEM encoded file. More... | |
static UaPkiRevocationList | fromWindowsStore (WindowsStoreLocation location, const UaString &sStoreName, const UaPkiIdentity &issuer, long iCrlNumber=-1) |
Gets a revocation list from the given windows certificate store. More... | |
Class for handling revocation lists.
The following sample demonstrates how to create a revocation list.
UaPkiRevocationList::UaPkiRevocationList | ( | long | validity, |
const UaPkiIdentity & | issuer, | ||
long | iCrlNumber | ||
) |
Constructor.
[in] | validity | Time from now in seconds until a new CRL will be created. |
[in] | issuer | The issuer of the Certificate. |
[in] | iCrlNumber | The CrlNumber of the certificate |
void UaPkiRevocationList::addRevoked | ( | const UaPkiCertificate & | cert, |
const UaDateTime & | revocationDate | ||
) |
Adds a certificate to the revocation list.
[in] | cert | The certificate to be added. |
[in] | revocationDate | The certificate will be revoked from this date on. |
Creates a filepath that can be used to save a crl to a file.
The fileName is created by appending the thumprint and the file extension ".crl" to the commonName. The CrlFilePath is created by appending the fileName to the basePath followed by a separator. Any characters that are not allowed in a fileName are removed from the commonName before. Example: C: [dbe2343b8adedd76520898c4d5a200f1f6eb86c4].crl
long UaPkiRevocationList::crlNumber | ( | ) | const |
Returns the number of the revocation list.
|
static |
Loads a revocation list from a DER encoded byte array.
[in] | DERdata | The DER data. |
|
static |
Loads a revocation list from a DER encoded file.
|
static |
Loads a revocation list from a DER encoded file.
|
static |
Loads a revocation list from a DER or PEM encoded file.
[in] | szFile | The file name (local 8 bit encoded). |
|
static |
Loads a revocation list from a DER or PEM encoded file.
[in] | sFile | The file name (UTF8 encoded). |
|
static |
Loads a revocation list from a PEM encoded file.
|
static |
Loads a revocation list from a PEM encoded file.
|
static |
Gets a revocation list from the given windows certificate store.
[in] | location | The system store location. |
[in] | sStoreName | The name of the certificate store to search in. |
[in] | issuer | issuer of the revocation list to find. |
[in] | iCrlNumber | The number of the revocation list to find. |
UaPkiIdentity UaPkiRevocationList::issuer | ( | ) | const |
Returns the identity of the revocation list's issuer.
UaPkiRevocationList & UaPkiRevocationList::operator= | ( | const UaPkiRevocationList & | copy | ) |
Assignment operator.
copy | An existing UaPkiRevocationList. |
bool UaPkiRevocationList::operator== | ( | const UaPkiRevocationList & | other | ) | const |
Compares the issuer name of the CRL to another one.
other | [in] The other CRL to compare to. |
bool UaPkiRevocationList::sign | ( | const UaPkiPrivateKey & | issuerPrivateKey | ) |
Signs the revocation list.
[in] | issuerPrivateKey | The private key of the issuer to sign the list with. |
UaByteArray UaPkiRevocationList::thumbPrint | ( | ) | const |
Creates the SHA1 thumbprint of the certificate revocation list.
UaByteArray UaPkiRevocationList::toDER | ( | ) | const |
Encodes the revocation list into DER format.
int UaPkiRevocationList::toDERFile | ( | const char * | szFile | ) | const |
Stores the revocation list into a DER encoded file.
[in] | szFile | The filename to use (local 8 bit encoded). |
int UaPkiRevocationList::toDERFile | ( | const UaString & | sFile | ) | const |
Stores the revocation list into a DER encoded file.
[in] | sFile | The filename to use (UTF8 encoded). |
int UaPkiRevocationList::toPEMFile | ( | const char * | szFile | ) | const |
Stores the revocation list into a PEM encoded file.
[in] | szFile | The filename to use (local 8 bit encoded). |
int UaPkiRevocationList::toPEMFile | ( | const UaString & | sFile | ) | const |
Stores the revocation list into a PEM encoded file.
[in] | sFile | The filename to use (UTF8 encoded). |
int UaPkiRevocationList::toWindowsStore | ( | WindowsStoreLocation | location, |
const UaString & | sStoreName | ||
) | const |
Stores the revocation list in the given windows certificate store.
The windows certificate store identifies the revocation list by all it's information, so no name parameter is needed.
[in] | location | The system store location. |
[in] | sStoreName | The name of the certificate store to use. |
bool UaPkiRevocationList::verify | ( | const UaPkiPrivateKey & | issuerPrivateKey | ) | const |
Verifies the signature of the revocation list.
[in] | issuerPrivateKey | The issuer's private key to verify with. |