Botan 3.9.0
Crypto and TLS for C&
Botan::GeneralSubtree Class Referencefinal

A single Name Constraint. More...

#include <pkix_types.h>

Inheritance diagram for Botan::GeneralSubtree:
Botan::ASN1_Object

Public Member Functions

const GeneralNamebase () const
std::vector< uint8_t > BER_encode () const
void decode_from (BER_Decoder &from) override
void encode_into (DER_Encoder &to) const override
 GeneralSubtree ()

Detailed Description

A single Name Constraint.

The Name Constraint extension adds a minimum and maximum path length to a GeneralName to form a constraint. The length limits are not used in PKIX.

This entire class is deprecated and will be removed in a future major release

Definition at line 340 of file pkix_types.h.

Constructor & Destructor Documentation

◆ GeneralSubtree()

Botan::GeneralSubtree::GeneralSubtree ( )
default

Creates an empty name constraint.

References decode_from(), encode_into(), and GeneralSubtree().

Referenced by GeneralSubtree().

Member Function Documentation

◆ base()

const GeneralName & Botan::GeneralSubtree::base ( ) const
inline
Returns
name

Definition at line 354 of file pkix_types.h.

354{ return m_base; }

References base().

Referenced by base(), and Botan::operator<<().

◆ BER_encode()

std::vector< uint8_t > Botan::ASN1_Object::BER_encode ( ) const
inherited

Return the encoding of this object. This is a convenience method when just one object needs to be serialized. Use DER_Encoder for complicated encodings.

Definition at line 19 of file asn1_obj.cpp.

19 {
20 std::vector<uint8_t> output;
21 DER_Encoder der(output);
22 this->encode_into(der);
23 return output;
24}
virtual void encode_into(DER_Encoder &to) const =0

References encode_into().

Referenced by decode_from(), Botan::Certificate_Store_In_SQL::find_all_certs(), Botan::Certificate_Store_In_SQL::find_cert(), Botan::X509_Certificate::fingerprint(), Botan::Certificate_Store_In_SQL::insert_cert(), Botan::X509_Object::PEM_encode(), Botan::PSS_Params::PSS_Params(), and Botan::Certificate_Store_In_SQL::revoke_cert().

◆ decode_from()

void Botan::GeneralSubtree::decode_from ( BER_Decoder & from)
overridevirtual

Decode whatever this object is from from

Parameters
fromthe BER_Decoder that will be read from

Implements Botan::ASN1_Object.

Definition at line 271 of file name_constraint.cpp.

271 {
272 size_t minimum = 0;
273
274 ber.start_sequence()
275 .decode(m_base)
276 .decode_optional(minimum, ASN1_Type(0), ASN1_Class::ContextSpecific, size_t(0))
277 .end_cons();
278
279 if(minimum != 0) {
280 throw Decoding_Error("GeneralSubtree minimum must be 0");
281 }
282}
ASN1_Type
Definition asn1_obj.h:43

References Botan::ContextSpecific, Botan::BER_Decoder::decode(), Botan::BER_Decoder::decode_optional(), Botan::BER_Decoder::end_cons(), and Botan::BER_Decoder::start_sequence().

Referenced by GeneralSubtree().

◆ encode_into()

void Botan::GeneralSubtree::encode_into ( DER_Encoder & to) const
overridevirtual

Encode whatever this object is into to

Parameters
tothe DER_Encoder that will be written to

Implements Botan::ASN1_Object.

Definition at line 267 of file name_constraint.cpp.

267 {
268 throw Not_Implemented("GeneralSubtree encoding");
269}

Referenced by GeneralSubtree().


The documentation for this class was generated from the following files: