PcapPlusPlus  Next
pcpp::X520DistinguishedName Class Reference

#include <X509Decoder.h>

Public Types

enum  Value : uint8_t {
  CommonName , Surname , SerialNumber , Country ,
  Locality , StateOrProvince , Organization , OrganizationalUnit ,
  Title , GivenName , Initials , Pseudonym ,
  GenerationQualifier , DnQualifier , DomainComponent , EmailAddress ,
  PostalCode , StreetAddress , BusinessCategory , Unknown
}
 Define enum types and the corresponding int values. More...
 

Public Member Functions

std::string toString () const
 
std::string getShortName () const
 
std::string getOidValue () const
 

Static Public Member Functions

static X520DistinguishedName fromOidValue (const Asn1ObjectIdentifier &value)
 

Detailed Description

Represents a distinguished name in an X.509 certificate

Member Enumeration Documentation

◆ Value

Define enum types and the corresponding int values.

Enumerator
CommonName 

Common Name (CN) - Typically the fully qualified domain name (FQDN)

Surname 

Surname (SN) - Family name of a person.

SerialNumber 

Serial Number - Serial number of the certificate.

Country 

Country Name (C) - Two-letter ISO 3166-1 alpha-2 country code.

Locality 

Locality (L) - City or locality name.

StateOrProvince 

State or Province Name (ST) - State or province name.

Organization 

Organization Name (O) - Name of the organization.

OrganizationalUnit 

Organizational Unit (OU) - Department or division within an organization.

Title 

Title - Job title or position.

GivenName 

Given Name (GN) - First name of a person.

Initials 

Initials - Initials of a person's name.

Pseudonym 

Pseudonym - A person's nickname or alias.

GenerationQualifier 

Generation Qualifier - A qualifier indicating a person's generation (e.g., Jr., Sr., III)

DnQualifier 

Distinguished Name Qualifier - Disambiguates similar distinguished names.

DomainComponent 

Domain Component (DC) - Domain component in domain names (e.g., "example" in "example.com")

EmailAddress 

Email Address - Email address in the format user@domain.

PostalCode 

Postal Code - Postal or ZIP code.

StreetAddress 

Street Address - Physical street address.

BusinessCategory 

Business Category - Type of business or organization.

Unknown 

Unknown or unsupported distinguished name type.

Member Function Documentation

◆ fromOidValue()

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

Creates an X520DistinguishedName from an OID value

Parameters
[in]valueThe ASN.1 object identifier
Returns
The corresponding X520DistinguishedName value, or Unknown if no match is found

◆ getOidValue()

std::string pcpp::X520DistinguishedName::getOidValue ( ) const
Returns
The OID value of the distinguished name

◆ getShortName()

std::string pcpp::X520DistinguishedName::getShortName ( ) const

Gets the short name (abbreviation) of the distinguished name

Returns
The short name (e.g., "CN" for CommonName)

◆ toString()

std::string pcpp::X520DistinguishedName::toString ( ) const
Returns
A string representation of the distinguished name