diff options
author | lloyd <[email protected]> | 2006-06-23 04:20:30 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-06-23 04:20:30 +0000 |
commit | 96277a37c3b7125f2c79cb9c2df19d4811379a36 (patch) | |
tree | 3dfb9ffc2736a20b90303abb8e6189f7c680f82c /include | |
parent | 4fa62dc075426f8503f485cc1eeffc59ad95b2a3 (diff) |
Make Alternative_Name an abstract base, from which the subject
and issuer forms are derived.
Add Extensions::contents_to, which iterates over the set and
adds each extension's contents.
Add a new explicit info field for is_ca
Implement Authority_Key_Id::decode_inner (incomplete, only handles
the keyid form).
Diffstat (limited to 'include')
-rw-r--r-- | include/x509_ext.h | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/include/x509_ext.h b/include/x509_ext.h index 720437265..147f17aa5 100644 --- a/include/x509_ext.h +++ b/include/x509_ext.h @@ -52,8 +52,8 @@ class Extensions : public ASN1_Object void encode_into(class DER_Encoder&) const; void decode_from(class BER_Decoder&); - std::vector<Certificate_Extension*> get() const - { return extensions; } + void contents_to(Data_Store&, Data_Store&) const; + void add(Certificate_Extension* extn) { extensions.push_back(extn); } @@ -171,17 +171,18 @@ class Authority_Key_ID : public Certificate_Extension }; /************************************************* -* Alternative Name Extension * +* Alternative Name Extension Base Class * *************************************************/ class Alternative_Name : public Certificate_Extension { public: - Alternative_Name* copy() const; + AlternativeName get_alt_name() const { return alt_name; } + protected: Alternative_Name(const AlternativeName&, const std::string&, const std::string&); - AlternativeName get_alt_name() const { return alt_name; } + Alternative_Name(const std::string&, const std::string&); private: std::string config_id() const { return config_name_str; } std::string oid_name() const { return oid_name_str; } @@ -196,6 +197,30 @@ class Alternative_Name : public Certificate_Extension }; /************************************************* +* Subject Alternative Name Extension * +*************************************************/ +class Subject_Alternative_Name : public Alternative_Name + { + public: + Subject_Alternative_Name* copy() const + { return new Subject_Alternative_Name(get_alt_name()); } + + Subject_Alternative_Name(const AlternativeName& = AlternativeName()); + }; + +/************************************************* +* Issuer Alternative Name Extension * +*************************************************/ +class Issuer_Alternative_Name : public Alternative_Name + { + public: + Issuer_Alternative_Name* copy() const + { return new Issuer_Alternative_Name(get_alt_name()); } + + Issuer_Alternative_Name(const AlternativeName& = AlternativeName()); + }; + +/************************************************* * Extended Key Usage Extension * *************************************************/ class Extended_Key_Usage : public Certificate_Extension |