8 #include <botan/x509_key.h>
9 #include <botan/filters.h>
10 #include <botan/asn1_obj.h>
11 #include <botan/der_enc.h>
12 #include <botan/ber_dec.h>
13 #include <botan/pem.h>
14 #include <botan/internal/pk_algs.h>
116 const std::string name = pub_key.
algo_name();
118 size_t constraints = 0;
120 if(name ==
"DH" || name ==
"ECDH")
123 if(name ==
"RSA" || name ==
"ElGamal")
126 if(name ==
"RSA" || name ==
"RW" || name ==
"NR" ||
127 name ==
"DSA" || name ==
"ECDSA")
131 constraints &= limits;
virtual AlgorithmIdentifier algorithm_identifier() const =0
BER_Decoder & decode(bool &)
Public_Key * load_key(DataSource &source)
MemoryVector< byte > BER_encode(const Public_Key &key)
virtual std::string algo_name() const =0
bool maybe_BER(DataSource &source)
BER_Decoder start_cons(ASN1_Tag, ASN1_Tag=UNIVERSAL)
DER_Encoder & encode(bool b)
Key_Constraints find_constraints(const Public_Key &pub_key, Key_Constraints limits)
virtual MemoryVector< byte > x509_subject_public_key() const =0
void encode(const Public_Key &key, Pipe &pipe, X509_Encoding encoding=PEM)
std::string PEM_encode(const Public_Key &key)
bool matches(DataSource &source, const std::string &extra, size_t search_range)
Public_Key * copy_key(const Public_Key &key)
std::string encode(const byte der[], size_t length, const std::string &label, size_t width)
BER_Decoder & verify_end()
DER_Encoder & start_cons(ASN1_Tag type_tag, ASN1_Tag class_tag=UNIVERSAL)
SecureVector< byte > decode_check_label(DataSource &source, const std::string &label_want)
Public_Key * make_public_key(const AlgorithmIdentifier &alg_id, const MemoryRegion< byte > &key_bits)