PcapPlusPlus  Next
pcpp::CryptographicKeyAlgorithm Class Reference

#include <CryptoKeyDecoder.h>

Public Types

enum  Value : uint8_t {
  RSA , DSA , ECDSA , ED25519 ,
  ED448 , DiffieHellman , X448 , Unknown
}
 Define enum types and the corresponding int values. More...
 

Public Member Functions

constexpr CryptographicKeyAlgorithm (Value value)
 Constructs a CryptographicKeyAlgorithm object from a Value enum. More...
 
std::string toString () const
 
std::string getOidValue () const
 

Static Public Member Functions

static CryptographicKeyAlgorithm fromOidValue (const Asn1ObjectIdentifier &value)
 Creates a CryptographicKeyAlgorithm object from an OID value. More...
 

Detailed Description

Represents cryptographic algorithms used in PKCS#8 private keys This class encapsulates various hashing and signature algorithms that can be used in PKCS#8 private keys.

Member Enumeration Documentation

◆ Value

Define enum types and the corresponding int values.

Enumerator
RSA 

RSA encryption/signature algorithm.

DSA 

Digital Signature Algorithm.

ECDSA 

Elliptic Curve Digital Signature Algorithm.

ED25519 

EdDSA using Curve25519 (Ed25519)

ED448 

EdDSA using Curve448 (Ed448)

DiffieHellman 

Diffie-Hellman key exchange algorithm.

X448 

Diffie-Hellman using Curve448 (Goldilocks curve)

Unknown 

Unknown or unsupported algorithm.

Constructor & Destructor Documentation

◆ CryptographicKeyAlgorithm()

constexpr pcpp::CryptographicKeyAlgorithm::CryptographicKeyAlgorithm ( Value  value)
inlineconstexpr

Constructs a CryptographicKeyAlgorithm object from a Value enum.

Parameters
[in]valueThe Value enum value

Member Function Documentation

◆ fromOidValue()

static CryptographicKeyAlgorithm pcpp::CryptographicKeyAlgorithm::fromOidValue ( const Asn1ObjectIdentifier value)
static

Creates a CryptographicKeyAlgorithm object from an OID value.

Parameters
[in]valueThe OID value
Returns
The CryptographicKeyAlgorithm object corresponding to the OID value. If the OID value doesn't correspond to any algorithm, CryptographicKeyAlgorithm::Unknown is returned

◆ getOidValue()

std::string pcpp::CryptographicKeyAlgorithm::getOidValue ( ) const
Returns
The OID value of the algorithm

◆ toString()

std::string pcpp::CryptographicKeyAlgorithm::toString ( ) const
Returns
A string representation of the algorithm