PLCnext API Documentation  22.9.0.33
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. More...
 
KeyPairoperator= (const KeyPair &arg)=delete
 Assignment operator. More...
 
virtual ~KeyPair (void)
 Destructs this instance and frees all resources. More...
 
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 More...
 
KeyPairType GetKeyType ()
 summary>saves this KeyPair to a file in PEM format (the private key is not encrypted!) More...
 
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

Constructor & Destructor Documentation

◆ KeyPair()

Arp::System::Commons::Security::KeyPair::KeyPair ( const KeyPair arg)
delete

Copy constructor.

◆ ~KeyPair()

virtual Arp::System::Commons::Security::KeyPair::~KeyPair ( void  )
virtual

Destructs this instance and frees all resources.

Member Function Documentation

◆ GetKeyType()

KeyPairType Arp::System::Commons::Security::KeyPair::GetKeyType ( )
inline

summary>saves this KeyPair to a file in PEM format (the private key is not encrypted!)

◆ 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

◆ GetPublicKey()

std::vector<byte> Arp::System::Commons::Security::KeyPair::GetPublicKey ( )

summary>Returns the type of this key pair

◆ 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

◆ operator=()

KeyPair& Arp::System::Commons::Security::KeyPair::operator= ( const KeyPair arg)
delete

Assignment operator.

◆ 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: