PcapPlusPlus  Next
pcpp::Asn1OctetStringRecord Class Reference

#include <Asn1Codec.h>

Inheritance diagram for pcpp::Asn1OctetStringRecord:
pcpp::Asn1StringRecord< Asn1UniversalTagType::OctetString > pcpp::Asn1PrimitiveRecord pcpp::Asn1Record

Public Member Functions

 Asn1OctetStringRecord (const uint8_t *value, size_t valueLength)
 
 Asn1OctetStringRecord (const std::string &value)
 
- Public Member Functions inherited from pcpp::Asn1StringRecord< Asn1UniversalTagType::OctetString >
std::string getValue () const
 
- Public Member Functions inherited from pcpp::Asn1Record
std::vector< uint8_t > encode () const
 
Asn1TagClass getTagClass () const
 
bool isConstructed () const
 
Asn1UniversalTagType getUniversalTagType () const
 
uint8_t getTagType () const
 
size_t getValueLength () const
 
size_t getTotalLength () const
 
std::string toString () const
 
template<class Asn1RecordType >
Asn1RecordType * castAs ()
 

Protected Member Functions

void decodeValue (uint8_t const *data) const override
 Decodes the record value from a byte array into the mutable cache variables. This method is marked as const as it can be called on a const instance of the record for lazy decoding.
 
std::vector< uint8_t > encodeValue () const override
 Encodes the record value into a byte array Prefer using encodeValueSafe() to ensure the value is decoded first if needed.
 
- Protected Member Functions inherited from pcpp::Asn1Record
std::vector< uint8_t > encodeValueSafe () const
 Encodes the record value into a byte array, ensuring that the value is decoded first if needed.
 

Additional Inherited Members

- Static Public Member Functions inherited from pcpp::Asn1Record
static std::unique_ptr< Asn1Recorddecode (const uint8_t *data, size_t dataLen, bool lazy=true)
 

Detailed Description

Represents an ASN.1 record with a value of type Octet String

Constructor & Destructor Documentation

◆ Asn1OctetStringRecord() [1/2]

pcpp::Asn1OctetStringRecord::Asn1OctetStringRecord ( const uint8_t *  value,
size_t  valueLength 
)
explicit

A constructor to create a record of type Octet String from a non-printable value

Parameters
valueA byte array to set as the record value
valueLengthThe length of the byte array

◆ Asn1OctetStringRecord() [2/2]

pcpp::Asn1OctetStringRecord::Asn1OctetStringRecord ( const std::string &  value)
inlineexplicit

A constructor to create a record from a printable string value

Parameters
valueA string to set as the record value