PLCnext API Documentation 25.0.2.69
|
Class with represents a Identity (Certificate with Chain and private Key) and is able to initialize an OpenSSL SSL Context This is an internal class used by TlsSocket More...
#include <IdentityStore.hpp>
Public Types | |
enum | KeyMustExist : bool { IgnoreMissingKey = false , RequireKeyExists = true } |
Enum which dicates if the key in the IdentityStore must exist or if this can be ignored | |
Public Member Functions | |
IdentityStore (const String &basePath, const String &name, KeyMustExist requireKeyExists=RequireKeyExists) | |
Constructs an IdentityStore instance. | |
IdentityStore (const IdentityStore &arg)=delete | |
Copy constructor. | |
IdentityStore & | operator= (const IdentityStore &arg)=delete |
Assignment operator. | |
~IdentityStore (void)=default | |
Destructs this instance and frees all resources. | |
String | GetName (void) const |
Returns the name of the IdentityStore | |
String | GetFullCertificateFileName (void) const |
Returns the absolute path to the certificate file | |
String | GetFullKeyFileName (void) const |
Returns the absolute path to the key file | |
String | GetFullTpmKeyFileName (void) const |
Returns the absolute path to the tpm key file | |
bool | HasCertificate (void) |
checks if a certificate is available for this IdentityStore | |
const std::shared_ptr< KeyPair > & | GetKeyPair (void) |
Returns a shared_ptr to the KeyPair of this IdentityStore | |
KeyPairType | GetKeyType (void) |
Returns the type of the key pair | |
void | InitSslContext (SSL_CTX *pSslCtx) const |
Initializes a OpenSSL SSL_CTX Structure with the private key and certificate More... | |
std::vector< byte > | GetPublicKey (void) |
Reads the public key in PEM format More... | |
SecurityConfigurationError | SetKeyPair (const std::vector< byte > &pemData) |
Sets or overwrites the keypair from the PEM encoded given bytes More... | |
SecurityConfigurationError | SetCertificate (const std::vector< byte > &pemData) |
Sets or overwrites the certificate from the PEM encoded given bytes More... | |
std::vector< byte > | GetPemCertificate (void) |
Gets the certificate as byte array in PEM format More... | |
const Certificate & | GetCertificate (void) const |
const std::vector< Certificate > & | GetIssuerCertificates (void) const |
std::vector< byte > | GetDerCertificate (void) |
Gets the certificate as byte array in DER format More... | |
std::vector< byte > | GetPemCertificateWithChain (void) |
Gets the certificate as byte array in PEM format with issuer certificates appended More... | |
std::vector< byte > | GetDerCertificateWithChain (void) |
Get the certificate as byte array in DER format with issuer certificates appended More... | |
std::vector< std::vector< byte > > | GetIssuerPemCertificates (void) |
Get the issuer certificates in PEM format | |
void | CreateAllDirectories (void) |
Creates all needed directories inside the folder of this IdentityStore | |
SecurityConfigurationError | ListContent (SecurityListType type, std::vector< ItemInfo > &result) |
Lists all elements in the list referenced by their SecurityListType More... | |
SecurityConfigurationError | AddElement (SecurityListType type, const std::vector< byte > &pemData) |
Adds an element into the list referenced by SecurityListType More... | |
SecurityConfigurationError | DeleteElement (SecurityListType type, const String &identifier) |
Delete an elements from the list referenced by ListType, identified by identifier More... | |
SecurityConfigurationError | GenerateKeyPair (KeyPairType type) |
Generate a new KeyPair for this IdentityStore More... | |
std::vector< byte > | GenerateCSR () |
Generate a Certificate Signing Request (CSR) for the Key Pair of this IdentityStore More... | |
bool | VerifyCertMatchesWithPrivateKey (void) |
Verifies if the certificates matches with the key pair More... | |
Class with represents a Identity (Certificate with Chain and private Key) and is able to initialize an OpenSSL SSL Context This is an internal class used by TlsSocket
SecurityConfigurationError Arp::System::Commons::Security::IdentityStore::AddElement | ( | SecurityListType | type, |
const std::vector< byte > & | pemData | ||
) |
Adds an element into the list referenced by SecurityListType
type | Which contenttype should be listed |
pemData | A vector of PEM encoded bytes for the element to be added |
SecurityConfigurationError Arp::System::Commons::Security::IdentityStore::DeleteElement | ( | SecurityListType | type, |
const String & | identifier | ||
) |
Delete an elements from the list referenced by ListType, identified by identifier
std::vector< byte > Arp::System::Commons::Security::IdentityStore::GenerateCSR | ( | void | ) |
Generate a Certificate Signing Request (CSR) for the Key Pair of this IdentityStore
SecurityConfigurationError Arp::System::Commons::Security::IdentityStore::GenerateKeyPair | ( | KeyPairType | type | ) |
Generate a new KeyPair for this IdentityStore
type | Which key pair type should be generated |
Not all targets support all key pairs
std::vector< byte > Arp::System::Commons::Security::IdentityStore::GetDerCertificate | ( | void | ) |
Gets the certificate as byte array in DER format
std::vector< byte > Arp::System::Commons::Security::IdentityStore::GetDerCertificateWithChain | ( | void | ) |
Get the certificate as byte array in DER format with issuer certificates appended
std::vector< byte > Arp::System::Commons::Security::IdentityStore::GetPemCertificate | ( | void | ) |
Gets the certificate as byte array in PEM format
std::vector< byte > Arp::System::Commons::Security::IdentityStore::GetPemCertificateWithChain | ( | void | ) |
Gets the certificate as byte array in PEM format with issuer certificates appended
std::vector< byte > Arp::System::Commons::Security::IdentityStore::GetPublicKey | ( | void | ) |
Reads the public key in PEM format
void Arp::System::Commons::Security::IdentityStore::InitSslContext | ( | SSL_CTX * | pSslCtx | ) | const |
Initializes a OpenSSL SSL_CTX Structure with the private key and certificate
pSslCtx | Pointer to the OpenSSL SSL_CTX structure to initialize |
SecurityConfigurationError Arp::System::Commons::Security::IdentityStore::ListContent | ( | SecurityListType | type, |
std::vector< ItemInfo > & | result | ||
) |
Lists all elements in the list referenced by their SecurityListType
type | Which contenttype should be listed |
result | A vector of ItemInfo in which the listed content is written to |
SecurityConfigurationError Arp::System::Commons::Security::IdentityStore::SetCertificate | ( | const std::vector< byte > & | pemData | ) |
Sets or overwrites the certificate from the PEM encoded given bytes
pemData | A byte vector with the PEM encoded certificate |
SecurityConfigurationError Arp::System::Commons::Security::IdentityStore::SetKeyPair | ( | const std::vector< byte > & | pemData | ) |
Sets or overwrites the keypair from the PEM encoded given bytes
pemData | A byte vector with the PEM encoded key pair |
bool Arp::System::Commons::Security::IdentityStore::VerifyCertMatchesWithPrivateKey | ( | void | ) |
Verifies if the certificates matches with the key pair