UA ANSI C Server Professional  1.4.0.285
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
UaServerPki

Data Structures

struct  _OpcUa_PkiIdentity
 Holds all information about a certificate issuer or subject. More...
 
struct  _OpcUa_PkiCertificateInfo
 Holds all additional information of a certificate. More...
 
struct  _OpcUa_PkiCertificate
 Encapsulates an OpenSSL certificate. More...
 
struct  _OpcUa_PkiRsaKeyPair
 Encapsulates an OpenSSL key pair. More...
 
struct  _OpcUa_PkiCRL
 Encapsulates an OpenSSL Certificate Revocation List. More...
 

Typedefs

typedef struct _OpcUa_PkiIdentity OpcUa_PkiIdentity
 Holds all information about a certificate issuer or subject. More...
 
typedef struct
_OpcUa_PkiCertificateInfo 
OpcUa_PkiCertificateInfo
 Holds all additional information of a certificate. More...
 
typedef struct
_OpcUa_PkiCertificate 
OpcUa_PkiCertificate
 Encapsulates an OpenSSL certificate. More...
 
typedef struct _OpcUa_PkiRsaKeyPair OpcUa_PkiRsaKeyPair
 Encapsulates an OpenSSL key pair. More...
 
typedef struct _OpcUa_PkiCRL OpcUa_PkiCRL
 Encapsulates an OpenSSL Certificate Revocation List. More...
 

Functions

OpcUa_StatusCode UaServer_PkiCertificate_Create (OpcUa_PkiCertificate **a_ppCertificate, OpcUa_PkiCertificateInfo a_certificateInfo, OpcUa_PkiIdentity a_subject, OpcUa_PkiRsaKeyPair a_subjectKeyPair, OpcUa_PkiIdentity a_issuer, OpcUa_PkiRsaKeyPair a_issuerKeyPair)
 Creates a new certificate. More...
 
OpcUa_StatusCode UaServer_PkiCertificate_Delete (OpcUa_PkiCertificate **a_ppCertificate)
 Deletes a certificate and frees it's memory. More...
 
OpcUa_StatusCode UaServer_PkiCertificate_ToDERFile (OpcUa_PkiCertificate *a_pCertificate, OpcUa_StringA a_sFile)
 Writes the certificate to the given file. More...
 
OpcUa_StatusCode UaServer_PkiCertificate_FromDER (OpcUa_ByteString *a_bsDER, OpcUa_PkiCertificate **a_ppCertificate)
 Gets a certificate from DER encoded ByteString. More...
 
OpcUa_StatusCode UaServer_PkiCertificate_HasExtension (OpcUa_PkiCertificate *a_pCertificate, OpcUa_X509Extension a_extension, OpcUa_Boolean *a_pExtensionExists)
 Check if certificate has extension. More...
 
OpcUa_StatusCode UaServer_PkiCertificate_GetExtension (OpcUa_PkiCertificate *a_pCertificate, OpcUa_X509Extension a_extension, OpcUa_String *a_pExtensionValue)
 Get extension from certificate. More...
 
OpcUa_StatusCode UaServer_PkiRsaKeyPair_Create (OpcUa_PkiRsaKeyPair **a_ppKeyPair, OpcUa_Int32 a_iBits)
 Creates a new key pair. More...
 
OpcUa_StatusCode UaServer_PkiRsaKeyPair_Delete (OpcUa_PkiRsaKeyPair **a_ppKeyPair)
 Deletes a key pair and frees it's memory. More...
 
OpcUa_StatusCode UaServer_PkiRsaKeyPair_ToPEMFile (OpcUa_PkiRsaKeyPair *a_pKeyPair, OpcUa_StringA a_sFile)
 Writes the key pair to the given file. More...
 
OpcUa_StatusCode UaServer_PkiCRL_Create (OpcUa_PkiCRL **a_ppCRL, OpcUa_UInt64 a_uValidity, OpcUa_PkiIdentity a_issuer, OpcUa_UInt64 a_uCrlNumber)
 Creates a new Certificate Revocation List. More...
 
OpcUa_StatusCode UaServer_PkiCRL_Delete (OpcUa_PkiCRL **a_ppCRL)
 Deletes a Certificate Revocation List and frees it's memory. More...
 
OpcUa_StatusCode UaServer_PkiCRL_AddRevoked (OpcUa_PkiCRL *a_pCRL, OpcUa_PkiCertificate a_certificate, OpcUa_DateTime a_revocationDate)
 Adds a certificate to the Certificate Revocation List. More...
 
OpcUa_StatusCode UaServer_PkiCRL_Sign (OpcUa_PkiCRL *a_pCRL, OpcUa_PkiRsaKeyPair a_issuerKeyPair)
 Signs a Certificate Revocation List. More...
 
OpcUa_StatusCode UaServer_PkiCRL_ToPEMFile (OpcUa_PkiCRL *a_pCRL, OpcUa_StringA a_sFile)
 Writes the Certificate Revocation List to the given file. More...
 
OpcUa_StatusCode UaServer_Pki_CheckKeyPair (OpcUa_ByteString *a_pCertificate, OpcUa_ByteString *a_pPrivateKey)
 Check if a private key matches a certificate. More...
 

Detailed Description

Typedef Documentation

Encapsulates an OpenSSL certificate.

Holds all additional information of a certificate.

typedef struct _OpcUa_PkiCRL OpcUa_PkiCRL

Encapsulates an OpenSSL Certificate Revocation List.

Holds all information about a certificate issuer or subject.

Encapsulates an OpenSSL key pair.

Function Documentation

OpcUa_StatusCode UaServer_Pki_CheckKeyPair ( OpcUa_ByteString *  a_pCertificate,
OpcUa_ByteString *  a_pPrivateKey 
)

Check if a private key matches a certificate.

Parameters
a_pCertificateThe certificate belonging to the private key.
a_pPrivateKeyThe private key belonging to the certificate.
OpcUa_StatusCode UaServer_PkiCertificate_Create ( OpcUa_PkiCertificate **  a_ppCertificate,
OpcUa_PkiCertificateInfo  a_certificateInfo,
OpcUa_PkiIdentity  a_subject,
OpcUa_PkiRsaKeyPair  a_subjectKeyPair,
OpcUa_PkiIdentity  a_issuer,
OpcUa_PkiRsaKeyPair  a_issuerKeyPair 
)

Creates a new certificate.

Parameters
a_ppCertificateA pointer to a variable to store the created certificate.
a_certificateInfoUA Application information.
a_subjectThe identity of the certificate owner.
a_subjectKeyPairThe key pair of the certificate. The public key part will be stored in the certificate.
a_issuerThe identity of the certificate issuer.
a_issuerKeyPairThe key pair of the certificate issuer. This is needed to sign the certificate.
OpcUa_StatusCode UaServer_PkiCertificate_Delete ( OpcUa_PkiCertificate **  a_ppCertificate)

Deletes a certificate and frees it's memory.

Parameters
a_ppCertificateA pointer to a variable that points to a OpcUa_PkiCertificate.
OpcUa_StatusCode UaServer_PkiCertificate_FromDER ( OpcUa_ByteString *  a_bsDER,
OpcUa_PkiCertificate **  a_ppCertificate 
)

Gets a certificate from DER encoded ByteString.

Parameters
a_bsDERThe ByteString containing the DER encoded certificate.
a_ppCertificateThe created certificate is stored here.
OpcUa_StatusCode UaServer_PkiCertificate_GetExtension ( OpcUa_PkiCertificate a_pCertificate,
OpcUa_X509Extension  a_extension,
OpcUa_String *  a_pExtensionValue 
)

Get extension from certificate.

Parameters
a_pCertificateThe certificate to use.
a_extensionThe certificate extension to get.
a_pExtensionValueThe value of the specified extension.
OpcUa_StatusCode UaServer_PkiCertificate_HasExtension ( OpcUa_PkiCertificate a_pCertificate,
OpcUa_X509Extension  a_extension,
OpcUa_Boolean *  a_pExtensionExists 
)

Check if certificate has extension.

Parameters
a_pCertificateThe certificate to use.
a_extensionThe certificate extension to check for.
a_pExtensionExistsTrue if the certificate contains the specified extension.
OpcUa_StatusCode UaServer_PkiCertificate_ToDERFile ( OpcUa_PkiCertificate a_pCertificate,
OpcUa_StringA  a_sFile 
)

Writes the certificate to the given file.

Parameters
a_pCertificateThe certificate to store.
a_sFileThe file to store the certificate in.
OpcUa_StatusCode UaServer_PkiCRL_AddRevoked ( OpcUa_PkiCRL a_pCRL,
OpcUa_PkiCertificate  a_certificate,
OpcUa_DateTime  a_revocationDate 
)

Adds a certificate to the Certificate Revocation List.

Parameters
a_pCRLThe CRL to use.
a_certificateThe certificate to store in the CRL.
a_revocationDateThe revocation date to set.
OpcUa_StatusCode UaServer_PkiCRL_Create ( OpcUa_PkiCRL **  a_ppCRL,
OpcUa_UInt64  a_uValidity,
OpcUa_PkiIdentity  a_issuer,
OpcUa_UInt64  a_uCrlNumber 
)

Creates a new Certificate Revocation List.

Parameters
a_ppCRLA pointer to a variable to store a pointer to the created CRL.
a_uValidityTime from now in seconds until a new CRL will be created.
a_issuerThe issuer of the CRL.
a_uCrlNumberThe consecutive number of the CRL.
OpcUa_StatusCode UaServer_PkiCRL_Delete ( OpcUa_PkiCRL **  a_ppCRL)

Deletes a Certificate Revocation List and frees it's memory.

Parameters
a_ppCRLA pointer to a variable that points to a OpcUa_PkiCRL.
OpcUa_StatusCode UaServer_PkiCRL_Sign ( OpcUa_PkiCRL a_pCRL,
OpcUa_PkiRsaKeyPair  a_issuerKeyPair 
)

Signs a Certificate Revocation List.

Parameters
a_pCRLThe CRL to sign.
a_issuerKeyPairThe key pair used to sign the CRL.
OpcUa_StatusCode UaServer_PkiCRL_ToPEMFile ( OpcUa_PkiCRL a_pCRL,
OpcUa_StringA  a_sFile 
)

Writes the Certificate Revocation List to the given file.

Parameters
a_pCRLThe CRL to store.
a_sFileThe file to store the CRL in.
OpcUa_StatusCode UaServer_PkiRsaKeyPair_Create ( OpcUa_PkiRsaKeyPair **  a_ppKeyPair,
OpcUa_Int32  a_iBits 
)

Creates a new key pair.

Parameters
a_ppKeyPairA pointer to a variable to store a pointer to the created key pair.
a_iBitsRSA modulus (key size) which should be 1024, 2048 or 4096.
OpcUa_StatusCode UaServer_PkiRsaKeyPair_Delete ( OpcUa_PkiRsaKeyPair **  a_ppKeyPair)

Deletes a key pair and frees it's memory.

Parameters
a_ppKeyPairA pointer to a variable that points to a OpcUa_PkiRsaKeyPair.
OpcUa_StatusCode UaServer_PkiRsaKeyPair_ToPEMFile ( OpcUa_PkiRsaKeyPair a_pKeyPair,
OpcUa_StringA  a_sFile 
)

Writes the key pair to the given file.

Parameters
a_pKeyPairThe key pair to store.
a_sFileThe file to store the key pair in.