diff options
author | lloyd <[email protected]> | 2006-06-22 09:05:54 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-06-22 09:05:54 +0000 |
commit | cd8504016b4f7ae75e8382743a695be1ed988b58 (patch) | |
tree | 75bd63487acdfc25fce403932c4903c108fcc871 /src/x509_ext.cpp | |
parent | 0d65c07330591cbefa8599f62c53ceecbdbe070d (diff) |
Add accessor and cloning functions to the Certificate_Extension objects
Diffstat (limited to 'src/x509_ext.cpp')
-rw-r--r-- | src/x509_ext.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/x509_ext.cpp b/src/x509_ext.cpp index 52bfca553..09b636cb3 100644 --- a/src/x509_ext.cpp +++ b/src/x509_ext.cpp @@ -127,6 +127,16 @@ Extensions::~Extensions() namespace Cert_Extension { /************************************************* +* Checked accessor for the path_limit member * +*************************************************/ +bool Basic_Constraints::get_path_limit() const + { + if(!is_ca) + throw Invalid_State("Basic_Constraints::get_path_limit: Not a CA"); + return path_limit; + } + +/************************************************* * Encode the extension * *************************************************/ MemoryVector<byte> Basic_Constraints::encode_inner() const @@ -288,6 +298,14 @@ void Authority_Key_ID::contents_to(Data_Store&, Data_Store& issuer) const } /************************************************* +* Copy this extension * +*************************************************/ +Alternative_Name* Alternative_Name::copy() const + { + return new Alternative_Name(alt_name, oid_name_str, config_name_str); + } + +/************************************************* * Encode the extension * *************************************************/ MemoryVector<byte> Alternative_Name::encode_inner() const @@ -418,6 +436,26 @@ void Certificate_Policies::contents_to(Data_Store& info, Data_Store&) const } /************************************************* +* Checked accessor for the crl_number member * +*************************************************/ +u32bit CRL_Number::get_crl_number() const + { + if(!has_value) + throw Invalid_State("CRL_Number::get_crl_number: Not set"); + return crl_number; + } + +/************************************************* +* Copy a CRL_Number extension * +*************************************************/ +CRL_Number* CRL_Number::copy() const + { + if(!has_value) + throw Invalid_State("CRL_Number::copy: Not set"); + return new CRL_Number(crl_number); + } + +/************************************************* * Encode the extension * *************************************************/ MemoryVector<byte> CRL_Number::encode_inner() const |