|
Botan 3.13.0
Crypto and TLS for C&
|
#include <asn1_obj.h>
Public Types | |
| enum | Encoding_Option : uint8_t { USE_NULL_PARAM , USE_EMPTY_PARAM } |
Public Member Functions | |
| AlgorithmIdentifier ()=default | |
| AlgorithmIdentifier (const OID &oid, const std::vector< uint8_t > ¶ms) | |
| AlgorithmIdentifier (const OID &oid, Encoding_Option enc) | |
| AlgorithmIdentifier (std::string_view oid_name, const std::vector< uint8_t > ¶ms) | |
| AlgorithmIdentifier (std::string_view oid_name, Encoding_Option enc) | |
| std::vector< uint8_t > | BER_encode () const |
| void | decode_from (BER_Decoder &from) override |
| bool | empty () const |
| void | encode_into (DER_Encoder &to) const override |
| const OID & | get_oid () const |
| const std::vector< uint8_t > & | get_parameters () const |
| const OID & | oid () const |
| const std::vector< uint8_t > & | parameters () const |
| bool | parameters_are_empty () const |
| bool | parameters_are_null () const |
| bool | parameters_are_null_or_empty () const |
Algorithm Identifier
Definition at line 642 of file asn1_obj.h.
| enum Botan::AlgorithmIdentifier::Encoding_Option : uint8_t |
Selects how an absent parameters field is encoded
| Enumerator | |
|---|---|
| USE_NULL_PARAM | |
| USE_EMPTY_PARAM | |
Definition at line 647 of file asn1_obj.h.
|
default |
Create an empty AlgorithmIdentifier
References AlgorithmIdentifier(), and oid().
Referenced by AlgorithmIdentifier(), and AlgorithmIdentifier().
| Botan::AlgorithmIdentifier::AlgorithmIdentifier | ( | const OID & | oid, |
| Encoding_Option | enc ) |
Create an AlgorithmIdentifier with no parameters
Definition at line 31 of file alg_id.cpp.
References oid(), and USE_NULL_PARAM.
| Botan::AlgorithmIdentifier::AlgorithmIdentifier | ( | std::string_view | oid_name, |
| Encoding_Option | enc ) |
Create an AlgorithmIdentifier with no parameters
| oid_name | a name or dotted decimal string identifying the algorithm |
| enc | whether the empty parameters are encoded as NULL or omitted |
Definition at line 42 of file alg_id.cpp.
References oid(), and USE_NULL_PARAM.
| Botan::AlgorithmIdentifier::AlgorithmIdentifier | ( | const OID & | oid, |
| const std::vector< uint8_t > & | params ) |
Create an AlgorithmIdentifier
Definition at line 19 of file alg_id.cpp.
References oid().
| Botan::AlgorithmIdentifier::AlgorithmIdentifier | ( | std::string_view | oid_name, |
| const std::vector< uint8_t > & | params ) |
Create an AlgorithmIdentifier
| oid_name | a name or dotted decimal string identifying the algorithm |
| params | the DER encoded parameters |
Definition at line 25 of file alg_id.cpp.
References AlgorithmIdentifier(), and oid().
|
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 21 of file asn1_obj.cpp.
References encode_into().
Referenced by decode_from(), Botan::PKCS12::export_to(), 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(), and Botan::PSS_Params::PSS_Params().
|
overridevirtual |
Decode whatever this object is from from
| from | the BER_Decoder that will be read from |
Implements Botan::ASN1_Object.
Definition at line 72 of file alg_id.cpp.
References Botan::BER_Decoder::decode(), Botan::BER_Decoder::end_cons(), Botan::ASN1::is_der_sequence_header(), Botan::ASN1::is_single_der_object(), Botan::ObjectId, Botan::OctetString, parameters_are_null_or_empty(), Botan::BER_Decoder::raw_bytes(), Botan::BER_Decoder::start_sequence(), and Botan::Universal.
|
inline |
Return true if neither the OID nor the parameters have been set
Definition at line 725 of file asn1_obj.h.
|
overridevirtual |
Encode whatever this object is into to
| to | the DER_Encoder that will be written to |
Implements Botan::ASN1_Object.
Definition at line 65 of file alg_id.cpp.
References Botan::DER_Encoder::encode(), Botan::DER_Encoder::end_cons(), oid(), parameters(), Botan::DER_Encoder::raw_bytes(), and Botan::DER_Encoder::start_sequence().
|
inline |
Return the algorithm OID
Definition at line 698 of file asn1_obj.h.
References get_oid().
Referenced by get_oid().
|
inline |
Return the DER encoded parameters, which may be empty
Definition at line 703 of file asn1_obj.h.
References get_parameters().
Referenced by get_parameters().
|
inline |
Return the algorithm OID
Definition at line 688 of file asn1_obj.h.
Referenced by AlgorithmIdentifier(), AlgorithmIdentifier(), AlgorithmIdentifier(), AlgorithmIdentifier(), AlgorithmIdentifier(), Botan::EC_PublicKey::assert_algorithm_identifier(), Botan::PKIX::check_chain(), Botan::X509::create_self_signed_cert(), Botan::SphincsPlus_PublicKey::create_x509_verification_op(), encode_into(), Botan::GOST_3410_PublicKey::GOST_3410_PublicKey(), Botan::load_private_key(), Botan::load_public_key(), Botan::operator==(), Botan::pbes2_decrypt(), Botan::PKCS12::PKCS12(), Botan::pkcs12_pbe_decrypt(), Botan::RSA_PrivateKey::RSA_PrivateKey(), Botan::RSA_PublicKey::RSA_PublicKey(), Botan::X509_Certificate::to_string(), and Botan::PK_Ops::Verification_with_Hash::Verification_with_Hash().
|
inline |
Return the DER encoded parameters, which may be empty
Definition at line 693 of file asn1_obj.h.
Referenced by Botan::EC_PrivateKey::EC_PrivateKey(), Botan::EC_PublicKey::EC_PublicKey(), encode_into(), Botan::operator==(), Botan::pbes2_decrypt(), and Botan::pkcs12_pbe_decrypt().
|
inline |
Return true if the parameters field is absent
Definition at line 715 of file asn1_obj.h.
Referenced by Botan::Classic_McEliece_PrivateKey::Classic_McEliece_PrivateKey(), Botan::Classic_McEliece_PublicKey::Classic_McEliece_PublicKey(), Botan::SphincsPlus_PublicKey::create_x509_verification_op(), Botan::Dilithium_PrivateKey::Dilithium_PrivateKey(), Botan::Dilithium_PublicKey::Dilithium_PublicKey(), Botan::EC_PrivateKey::EC_PrivateKey(), Botan::Ed25519_PrivateKey::Ed25519_PrivateKey(), Botan::Ed25519_PublicKey::Ed25519_PublicKey(), Botan::Ed448_PrivateKey::Ed448_PrivateKey(), Botan::Ed448_PublicKey::Ed448_PublicKey(), Botan::FrodoKEM_PrivateKey::FrodoKEM_PrivateKey(), Botan::FrodoKEM_PublicKey::FrodoKEM_PublicKey(), Botan::HSS_LMS_PrivateKey::HSS_LMS_PrivateKey(), Botan::HSS_LMS_PublicKey::HSS_LMS_PublicKey(), Botan::Kyber_PrivateKey::Kyber_PrivateKey(), Botan::Kyber_PublicKey::Kyber_PublicKey(), Botan::McEliece_PrivateKey::McEliece_PrivateKey(), Botan::McEliece_PublicKey::McEliece_PublicKey(), parameters_are_null_or_empty(), Botan::SphincsPlus_PrivateKey::SphincsPlus_PrivateKey(), Botan::SphincsPlus_PublicKey::SphincsPlus_PublicKey(), Botan::PK_Ops::Verification_with_Hash::Verification_with_Hash(), Botan::X25519_PrivateKey::X25519_PrivateKey(), Botan::X25519_PublicKey::X25519_PublicKey(), Botan::X448_PrivateKey::X448_PrivateKey(), Botan::X448_PublicKey::X448_PublicKey(), and Botan::XMSS_PublicKey::XMSS_PublicKey().
| bool Botan::AlgorithmIdentifier::parameters_are_null | ( | ) | const |
Return true if the parameters consist of a single DER encoded NULL
Definition at line 50 of file alg_id.cpp.
Referenced by parameters_are_null_or_empty(), and Botan::PK_Ops::Verification_with_Hash::Verification_with_Hash().
|
inline |
Return true if the parameters field is absent or a single DER encoded NULL
Definition at line 720 of file asn1_obj.h.
References parameters_are_empty(), and parameters_are_null().
Referenced by decode_from(), Botan::RSA_PrivateKey::RSA_PrivateKey(), and Botan::RSA_PublicKey::RSA_PublicKey().