8 #include "Arp/System/Core/AppDomainSingleton.hxx"     9 #include "Arp/System/Commons/Logging.h"    10 #include "Arp/System/Commons/Io/Path.hpp"    11 #include "Arp/System/Commons/Security/KeyPair.hpp"    12 #include "Arp/System/Commons/Security/Certificate.hpp"    13 #include "Arp/System/Commons/Security/SecurityListType.hpp"    14 #include "Arp/System/Commons/Security/ItemInfo.hpp"    15 #include "Arp/System/Commons/Security/KeyPairType.hpp"    16 #include "Arp/System/Commons/Security/SecurityConfigurationError.hpp"    19 #include <openssl/evp.h>    21 namespace Arp { 
namespace System { 
namespace Commons { 
namespace Security
    29     enum KeyMustExist : 
bool    31         IgnoreMissingKey = 
false,
    32         RequireKeyExists = 
true    59     bool HasCertificate(
void);
    61     const std::shared_ptr<KeyPair>& 
GetKeyPair(
void);
    63     KeyPairType GetKeyType(
void);
    77     SecurityConfigurationError 
SetKeyPair(
const std::vector<byte>& pemData);
    82     SecurityConfigurationError 
SetCertificate(
const std::vector<byte>& pemData);
   109     SecurityConfigurationError 
ListContent(SecurityListType type, std::vector<ItemInfo>& result);
   114     SecurityConfigurationError 
AddElement(SecurityListType type, 
const std::vector<byte>& pemData);
   132     bool VerifyCertMatchesWithPrivateKey(
void);
   139     void loadKeyPair(KeyMustExist requireKeyExists);
   140     void loadCertWithChain(
const String& file);
   142     void listIssuerList(std::vector<ItemInfo>& result);
   143     void listIdentityCert(std::vector<ItemInfo>& result);
   150     std::shared_ptr<KeyPair> keyPair;
   152     std::vector<Certificate> issuers;
   156     static const String CertificateFileName;
   157     static const String KeyFileName;
   158     static const String TpmKeyFileName;
   159     static const String DirectorySeparator;
   167     return Io::Path::GetFileName(this->storePath);
   172     return this->storePath + DirectorySeparator + CertificateFileName;
   177     return this->storePath + DirectorySeparator + KeyFileName;
   182     return this->storePath + DirectorySeparator + TpmKeyFileName;
   185 inline KeyPairType IdentityStore::GetKeyType(
void)
   187     return this->keyPair->GetKeyType();
 std::vector< byte > GetPemCertificate(void)
 
~IdentityStore(void)=default
Destructs this instance and frees all resources.
 
String GetFullTpmKeyFileName(void) const
summary>checks if a certificate is available for this IdentityStore
Definition: IdentityStore.hpp:180
 
std::vector< byte > GetDerCertificate(void)
 
IdentityStore(const String &basePath, const String &name, KeyMustExist requireKeyExists=RequireKeyExists)
Constructs an IdentityStore instance.
 
Class to handle x.509 certificates
Definition: Certificate.hpp:25
 
SecurityConfigurationError DeleteElement(SecurityListType type, const String &identifier)
summary>Generate a new KeyPair for this IdentityStore
 
void CreateAllDirectories(void)
summary>list all elements in the list referenced by ListType
 
SecurityConfigurationError SetCertificate(const std::vector< byte > &pemData)
 
void InitSslContext(SSL_CTX *pSslCtx) const
Initializes a OpenSSL SSL_:CTX Structure with the private key and certificate
 
String GetName(void) const
Returns the name of the IdentityStore
Definition: IdentityStore.hpp:165
 
String GetFullCertificateFileName(void) const
summary>Returns the absolute path to the key file
Definition: IdentityStore.hpp:170
 
Definition: Loggable.hxx:18
 
std::vector< byte > GenerateCSR()
 
Root namespace for the PLCnext API
 
Class with represents a Identity (Certificate with Chain and private Key) and is able to initialze an...
Definition: IdentityStore.hpp:26
 
SecurityConfigurationError SetKeyPair(const std::vector< byte > &pemData)
 
const std::shared_ptr< KeyPair > & GetKeyPair(void)
summary>Returns the type of the key pair
 
SecurityConfigurationError GenerateKeyPair(KeyPairType type)
 
std::vector< byte > GetPemCertificateWithChain(void)
 
std::vector< std::vector< byte > > GetIssuerPemCertificates(void)
summary>creates all needed directories inside the folder of this IdentityStore
 
System components used by the System, Device, Plc or Io domains.
 
SecurityConfigurationError ListContent(SecurityListType type, std::vector< ItemInfo > &result)
summary>add an element into the list referenced by ListType
 
std::vector< byte > GetDerCertificateWithChain(void)
summary>get the issuer certificates in PEM format
 
IdentityStore & operator=(const IdentityStore &arg)=delete
Assignment operator.
 
std::vector< byte > GetPublicKey(void)
 
SecurityConfigurationError AddElement(SecurityListType type, const std::vector< byte > &pemData)
summary>delete an elements from the list referenced by ListType, identified by identifier
 
String GetFullKeyFileName(void) const
summary>Returns the absolute path to the tpm key file
Definition: IdentityStore.hpp:175