|
Botan 3.13.0
Crypto and TLS for C&
|
#include <asn1_obj.h>
Public Member Functions | |
| ASN1_BitString ()=default | |
| ASN1_BitString (std::span< const uint8_t > bytes, size_t unused_bits) | |
| ASN1_BitString (std::vector< uint8_t > bytes, size_t unused_bits) | |
| bool | bit_at (size_t bit) const |
| size_t | bit_length () const |
| std::span< const uint8_t > | bytes () const |
| size_t | unused_bits () const |
ASN.1 BIT STRING with explicit unused-bit count.
Definition at line 174 of file asn1_obj.h.
|
default |
Create an empty BIT STRING
References ASN1_BitString(), bytes(), and unused_bits().
Referenced by ASN1_BitString(), and ASN1_BitString().
| Botan::ASN1_BitString::ASN1_BitString | ( | std::vector< uint8_t > | bytes, |
| size_t | unused_bits ) |
Create a BIT STRING from the given bits
| bytes | the bits, without the leading unused-bit count octet |
| unused_bits | the number of unused bits in the final byte |
Throws Invalid_Argument if unused_bits is 8 or larger, if unused_bits is non-zero for an empty BIT STRING, or if any of the unused bits are set.
Definition at line 28 of file asn1_obj.cpp.
References bytes(), and unused_bits().
| Botan::ASN1_BitString::ASN1_BitString | ( | std::span< const uint8_t > | bytes, |
| size_t | unused_bits ) |
Create a BIT STRING from the given bits
| bytes | the bits, without the leading unused-bit count octet |
| unused_bits | the number of unused bits in the final byte |
Throws Invalid_Argument if unused_bits is 8 or larger, if unused_bits is non-zero for an empty BIT STRING, or if any of the unused bits are set.
Definition at line 43 of file asn1_obj.cpp.
References ASN1_BitString(), bytes(), and unused_bits().
| bool Botan::ASN1_BitString::bit_at | ( | size_t | bit | ) | const |
Return the value of a single bit, counting from the most significant bit of the first byte
Throws Invalid_Argument if bit is not less than bit_length()
Definition at line 50 of file asn1_obj.cpp.
References bit_length().
Referenced by Botan::BER_Decoder::decode_named_bitstring().
| size_t Botan::ASN1_BitString::bit_length | ( | ) | const |
Return the number of significant bits in this BIT STRING
Definition at line 46 of file asn1_obj.cpp.
Referenced by bit_at(), and Botan::BER_Decoder::decode_named_bitstring().
|
inline |
Return the bits, without the leading unused-bit count octet
Definition at line 206 of file asn1_obj.h.
Referenced by ASN1_BitString(), ASN1_BitString(), ASN1_BitString(), Botan::BER_Decoder::decode_octet_aligned_bitstring(), and Botan::DER_Encoder::encode_bitstring().
|
inline |
Return the number of unused bits in the final byte
Definition at line 211 of file asn1_obj.h.
Referenced by ASN1_BitString(), ASN1_BitString(), ASN1_BitString(), Botan::BER_Decoder::decode_octet_aligned_bitstring(), and Botan::DER_Encoder::encode_bitstring().