63 constexpr
operator Value()
const
69 explicit operator bool()
const =
delete;
84 static std::unique_ptr<Asn1Record> decodeAsn1Data(
const std::string& rawData,
85 std::vector<uint8_t>& rawDataBytes);
96 static std::unique_ptr<X509BasicConstraintsDataDecoder>
create(
const std::string& rawData);
107 return m_PathLenConstraint;
112 : m_IsCA(
isCA), m_PathLenConstraint(pathLenConstraint)
114 static constexpr
int isCAOffset = 0;
115 static constexpr
int pathLenConstraintOffset = 1;
118 int m_PathLenConstraint = 0;
129 static std::unique_ptr<X509SubjectKeyIdentifierDataDecoder>
create(
const std::string& rawData);
134 return m_KeyIdentifier;
140 std::string m_KeyIdentifier;
151 static std::unique_ptr<X509KeyUsageDataDecoder>
create(
const std::string& rawData);
162 std::string m_KeyUsage;
173 static std::unique_ptr<X509ExtendedKeyUsageDataDecoder>
create(
const std::string& rawData);
178 return m_ExtendedKeyUsagePurposes;
184 std::vector<Asn1ObjectIdentifier> m_ExtendedKeyUsagePurposes;
205 template <
class X509ExtensionDataType> X509ExtensionDataType*
castAs()
207 auto castedExtension =
dynamic_cast<X509ExtensionDataType*
>(
this);
208 if (castedExtension ==
nullptr)
210 throw std::runtime_error(
"Trying to cast X509 extension data to the wrong type");
212 return castedExtension;
232 return m_PathLenConstraint;
238 int m_PathLenConstraint = 0;
251 return m_KeyIdentifier;
256 std::string m_KeyIdentifier;
296 static constexpr
int digitalSignatureLocation = 0;
297 static constexpr
int nonRepudiationLocation = 1;
298 static constexpr
int keyEnciphermentLocation = 2;
299 static constexpr
int dataEnciphermentLocation = 3;
300 static constexpr
int keyAgreementLocation = 4;
301 static constexpr
int keyCertSignLocation = 5;
302 static constexpr
int crlSignLocation = 6;
303 static constexpr
int encipherOnlyLocation = 7;
304 static constexpr
int decipherOnlyLocation = 8;
306 bool isBitSet(
size_t location)
const;
307 std::string m_BitString;
318 const std::vector<X509ExtendedKeyUsagePurpose>&
getPurposes()
const
325 std::vector<X509ExtendedKeyUsagePurpose> m_Purposes;
Definition: Asn1Codec.h:665
Definition: X509ExtensionDataDecoder.h:219
int getPathLenConstraint() const
Definition: X509ExtensionDataDecoder.h:230
bool isCA() const
Definition: X509ExtensionDataDecoder.h:224
Definition: X509ExtensionDataDecoder.h:313
const std::vector< X509ExtendedKeyUsagePurpose > & getPurposes() const
Definition: X509ExtensionDataDecoder.h:318
Definition: X509ExtensionDataDecoder.h:11
std::string toString() const
static X509ExtendedKeyUsagePurpose fromOidValue(const Asn1ObjectIdentifier &value)
Value
Define enum types for extended key usage purposes.
Definition: X509ExtensionDataDecoder.h:15
@ IPSecUser
IPsec user.
Definition: X509ExtensionDataDecoder.h:33
@ IPSecTunnel
IPsec tunnel.
Definition: X509ExtensionDataDecoder.h:31
@ IPSecEndSystem
IPsec end system.
Definition: X509ExtensionDataDecoder.h:29
@ ClientAuth
Client authentication.
Definition: X509ExtensionDataDecoder.h:19
@ EmailProtection
Email protection.
Definition: X509ExtensionDataDecoder.h:23
@ CodeSigning
Code signing.
Definition: X509ExtensionDataDecoder.h:21
@ SmartCardLogon
Smart card logon.
Definition: X509ExtensionDataDecoder.h:37
@ ServerAuth
Server authentication.
Definition: X509ExtensionDataDecoder.h:17
@ EncryptedFileSystem
Encrypted file system.
Definition: X509ExtensionDataDecoder.h:39
@ TimeStamping
Time stamping.
Definition: X509ExtensionDataDecoder.h:25
@ Unknown
Unknown purpose value.
Definition: X509ExtensionDataDecoder.h:43
@ DocumentSigning
Document signing.
Definition: X509ExtensionDataDecoder.h:41
@ OCSPSigning
OCSP signing.
Definition: X509ExtensionDataDecoder.h:27
std::string getOidValue() const
Definition: X509ExtensionDataDecoder.h:194
X509ExtensionDataType * castAs()
Definition: X509ExtensionDataDecoder.h:205
Definition: X509Decoder.h:705
Definition: X509ExtensionDataDecoder.h:91
bool isCA() const
Definition: X509ExtensionDataDecoder.h:99
int getPathLenConstraint() const
Definition: X509ExtensionDataDecoder.h:105
static std::unique_ptr< X509BasicConstraintsDataDecoder > create(const std::string &rawData)
Definition: X509ExtensionDataDecoder.h:168
const std::vector< Asn1ObjectIdentifier > & getExtendedKeyUsagePurposes() const
Definition: X509ExtensionDataDecoder.h:176
static std::unique_ptr< X509ExtendedKeyUsageDataDecoder > create(const std::string &rawData)
Definition: X509ExtensionDataDecoder.h:82
Definition: X509ExtensionDataDecoder.h:146
const std::string & getKeyUsage() const
Definition: X509ExtensionDataDecoder.h:154
static std::unique_ptr< X509KeyUsageDataDecoder > create(const std::string &rawData)
Definition: X509ExtensionDataDecoder.h:124
static std::unique_ptr< X509SubjectKeyIdentifierDataDecoder > create(const std::string &rawData)
const std::string & getKeyIdentifier() const
Definition: X509ExtensionDataDecoder.h:132
Definition: X509ExtensionDataDecoder.h:262
bool isDataEncipherment() const
bool isEncipherOnly() const
bool isKeyAgreement() const
bool isKeyEncipherment() const
bool isNonRepudiation() const
bool isDecipherOnly() const
bool isKeyCertSign() const
bool isDigitalSignature() const
Definition: X509ExtensionDataDecoder.h:244
std::string getKeyIdentifier() const
Definition: X509ExtensionDataDecoder.h:249
The main namespace for the PcapPlusPlus lib.