10Duke Enterprise C++ SDK
Loading...
Searching...
No Matches
tenduke::crypto::libcrypto::LibcryptoKeyFactory Class Reference

#include <LibcryptoKeyFactory.h>

Detailed Description

Libcrypto implementation of tenduke::crypto::PublicKeyFactory.

Inheritance diagram for tenduke::crypto::libcrypto::LibcryptoKeyFactory:
tenduke::crypto::PublicKeyFactory

Public Member Functions

std::unique_ptr< tenduke::crypto::PublicKey > publicKeyFromPEM (const char *publicKeyAsPEM) const override
 Creates a tenduke::crypto::PublicKey from PEM.
std::unique_ptr< tenduke::crypto::PublicKey > publicKeyFromPEM (const std::string &publicKeyAsPEM) const override
 Creates a tenduke::crypto::PublicKey from PEM.
std::unique_ptr< tenduke::crypto::PublicKey > publicRSAKeyFromModuloAndExponent (const tenduke::utl::BinaryData &modulo, const tenduke::utl::BinaryData &exponent) const override
 Creates a RSA tenduke::crypto::PublicKey from modulo and exponent.
virtual std::unique_ptr<::tenduke::crypto::PrivateKey > privateKeyFromPEM (const std::string &privateKeyAsPEM) const
 Creates private key from given PEM.

Member Function Documentation

◆ privateKeyFromPEM()

std::unique_ptr<::PrivateKey > tenduke::crypto::libcrypto::LibcryptoKeyFactory::privateKeyFromPEM ( const std::string & privateKeyAsPEM) const
virtual

Creates private key from given PEM.

Parameters
privateKeyAsPEM-
Returns
-

◆ publicKeyFromPEM() [1/2]

std::unique_ptr<::PublicKey > tenduke::crypto::libcrypto::LibcryptoKeyFactory::publicKeyFromPEM ( const char * publicKeyAsPEM) const
overridevirtual

Creates a tenduke::crypto::PublicKey from PEM.

Parameters
publicKeyAsPEMpublic key as PEM. Null-terminated string.
Returns
-

Implements tenduke::crypto::PublicKeyFactory.

◆ publicKeyFromPEM() [2/2]

std::unique_ptr< xdcrypto::PublicKey > tenduke::crypto::libcrypto::LibcryptoKeyFactory::publicKeyFromPEM ( const std::string & publicKeyAsPEM) const
overridevirtual

Creates a tenduke::crypto::PublicKey from PEM.

Parameters
publicKeyAsPEMpublic key as PEM.
Returns
-

Implements tenduke::crypto::PublicKeyFactory.

◆ publicRSAKeyFromModuloAndExponent()

std::unique_ptr< xdcrypto::PublicKey > tenduke::crypto::libcrypto::LibcryptoKeyFactory::publicRSAKeyFromModuloAndExponent ( const tenduke::utl::BinaryData & modulo,
const tenduke::utl::BinaryData & exponent ) const
overridevirtual

Creates a RSA tenduke::crypto::PublicKey from modulo and exponent.

The parameters are checked with tenduke::crypto::checkRSAPublicKeyParameters(): the modulus must be 2048 to 16384 bits, and the exponent odd, at least 3 and smaller than the modulus.

Parameters
modulomodulus (n) as big-endian unsigned integer
exponentpublic exponent (e) as big-endian unsigned integer
Returns
-
Exceptions
tenduke::crypto::CryptoExceptionif the parameters are not acceptable or the key cannot be created

Implements tenduke::crypto::PublicKeyFactory.


The documentation for this class was generated from the following files:
  • core/services/default/src/crypto/asymmetric/LibcryptoKeyFactory.h
  • core/services/default/src/crypto/asymmetric/Libcrypto3KeyFactory.cpp