PLCnext API Documentation 24.0.0.71
Public Member Functions | Protected Attributes | List of all members
Arp::System::Commons::Security::KeyPair Class Reference

class which represents a asymmetric key pair More...

#include <KeyPair.hpp>

Inheritance diagram for Arp::System::Commons::Security::KeyPair:
Inheritance graph

Public Member Functions

 KeyPair ()
 Constructs an KeyPair
 
 KeyPair (const KeyPair &arg)=delete
 Copy constructor.
 
KeyPairoperator= (const KeyPair &arg)=delete
 Assignment operator.
 
virtual ~KeyPair (void)
 Destructs this instance and frees all resources.
 
EVP_PKEY * GetPkey ()
 returns a pointer to the OpenSSL EVP_PKEY* structure initialized with this KeyPair More...
 
virtual void LoadFromFile (const String &filename)
 Loads the KeyPair from a PEM encoded file filename More...
 
void LoadFromMemory (const std::vector< byte > &data)
 
void InitSslContext (SSL_CTX *pSslCtx) const
 
std::vector< byteGetPublicKey ()
 summary>Returns the type of this key pair
 
KeyPairType GetKeyType ()
 summary>saves this KeyPair to a file in PEM format (the private key is not encrypted!)
 
void WriteToFile (const String &filename)
 
void GenerateKeyPair (KeyPairType type)
 

Protected Attributes

OpenSslEVP_PKEY opensslkey
 
KeyPairType keyType
 

Detailed Description

class which represents a asymmetric key pair

Member Function Documentation

◆ GetPkey()

EVP_PKEY * Arp::System::Commons::Security::KeyPair::GetPkey ( )
inline

returns a pointer to the OpenSSL EVP_PKEY* structure initialized with this KeyPair

Please Note: pointer is only valid when the KePair is not destroyed

◆ InitSslContext()

void Arp::System::Commons::Security::KeyPair::InitSslContext ( SSL_CTX *  pSslCtx) const

summary>Returns the public key portion of this key pair (PEM format)

returns>byte vector with PEM encoded public key

◆ LoadFromFile()

virtual void Arp::System::Commons::Security::KeyPair::LoadFromFile ( const String filename)
virtual

Loads the KeyPair from a PEM encoded file filename

param name="filename">file from which the KeyPair is loaded. Must be PEM encoded

summary>Loads the KeyPair from memory (PEM encoded)

param name="data">byte vector with PEM encoded Key Pair

◆ LoadFromMemory()

void Arp::System::Commons::Security::KeyPair::LoadFromMemory ( const std::vector< byte > &  data)

summary>Initializes a OpenSSL SSL_CTX structure ith this KeyPair

param name="pSslCtx">Pointer to the OpenSSL SSL_CTX structure to initialize

◆ WriteToFile()

void Arp::System::Commons::Security::KeyPair::WriteToFile ( const String filename)

summary>Generates a new key pair and replaced the current key pair with the generated

param name="type">type of key to generate


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