diff options
author | Matthias Gierlings <[email protected]> | 2016-06-19 18:06:12 +0200 |
---|---|---|
committer | Matthias Gierlings <[email protected]> | 2016-06-19 19:30:14 +0200 |
commit | 129324f68f59bea91b3b8901875eeb278acb34b1 (patch) | |
tree | 21b3a55e67ee2c2437e3078cfe6e7484dda42cdb /src/lib/cert/x509 | |
parent | d73460df43b2d4d14b62a98e9bc66dfea02ab63d (diff) |
Reverted proposed constructor changes to X509_CA.
- Removed Certificate_Properties class used to wrap X509_CA parameters.
- Whitespace cleanup.
Diffstat (limited to 'src/lib/cert/x509')
-rw-r--r-- | src/lib/cert/x509/x509_ca.cpp | 20 | ||||
-rw-r--r-- | src/lib/cert/x509/x509_ca.h | 26 | ||||
-rw-r--r-- | src/lib/cert/x509/x509self.cpp | 12 |
3 files changed, 17 insertions, 41 deletions
diff --git a/src/lib/cert/x509/x509_ca.cpp b/src/lib/cert/x509/x509_ca.cpp index 02f77c8f6..147fdd6ad 100644 --- a/src/lib/cert/x509/x509_ca.cpp +++ b/src/lib/cert/x509/x509_ca.cpp @@ -1,7 +1,6 @@ /* * X.509 Certificate Authority * (C) 1999-2010 Jack Lloyd -* 2016 Matthias Gierlings * * Botan is released under the Simplified BSD License (see license.txt) */ @@ -79,10 +78,8 @@ X509_Certificate X509_CA::sign_request(const PKCS10_Request& req, return make_cert(m_signer, rng, m_ca_sig_algo, req.raw_public_key(), - Certificate_Properties(not_before, - not_after, - m_cert.subject_dn(), - req.subject_dn()), + not_before, not_after, + m_cert.subject_dn(), req.subject_dn(), extensions); } @@ -93,7 +90,10 @@ X509_Certificate X509_CA::make_cert(PK_Signer* signer, RandomNumberGenerator& rng, const AlgorithmIdentifier& sig_algo, const std::vector<byte>& pub_key, - const Certificate_Properties properties, + const X509_Time& not_before, + const X509_Time& not_after, + const X509_DN& issuer_dn, + const X509_DN& subject_dn, const Extensions& extensions) { const size_t X509_CERT_VERSION = 3; @@ -112,14 +112,14 @@ X509_Certificate X509_CA::make_cert(PK_Signer* signer, .encode(serial_no) .encode(sig_algo) - .encode(properties.get_issuer_dn()) + .encode(issuer_dn) .start_cons(SEQUENCE) - .encode(properties.get_not_before()) - .encode(properties.get_not_after()) + .encode(not_before) + .encode(not_after) .end_cons() - .encode(properties.get_subject_dn()) + .encode(subject_dn) .raw_bytes(pub_key) .start_explicit(3) diff --git a/src/lib/cert/x509/x509_ca.h b/src/lib/cert/x509/x509_ca.h index 17e534cfd..ba3724f5e 100644 --- a/src/lib/cert/x509/x509_ca.h +++ b/src/lib/cert/x509/x509_ca.h @@ -1,7 +1,6 @@ /* * X.509 Certificate Authority * (C) 1999-2008 Jack Lloyd -* 2016 Matthias Gierlings * * Botan is released under the Simplified BSD License (see license.txt) */ @@ -23,26 +22,6 @@ namespace Botan { class BOTAN_DLL X509_CA { public: - class Certificate_Properties - { - public: - Certificate_Properties(X509_Time not_before, X509_Time not_after, - X509_DN issuer_dn, X509_DN subject_dn) - : m_not_before(not_before), m_not_after(not_after), - m_issuer_dn(issuer_dn), m_subject_dn(subject_dn) {} - - const X509_Time& get_not_before() const { return m_not_before; } - const X509_Time& get_not_after() const { return m_not_after; } - const X509_DN& get_issuer_dn() const { return m_issuer_dn; } - const X509_DN& get_subject_dn() const { return m_subject_dn; } - - private: - X509_Time m_not_before; - X509_Time m_not_after; - X509_DN m_issuer_dn; - X509_DN m_subject_dn; - }; - /** * Sign a PKCS#10 Request. * @param req the request to sign @@ -102,7 +81,10 @@ class BOTAN_DLL X509_CA RandomNumberGenerator& rng, const AlgorithmIdentifier& sig_algo, const std::vector<byte>& pub_key, - const Certificate_Properties properties, + const X509_Time& not_before, + const X509_Time& not_after, + const X509_DN& issuer_dn, + const X509_DN& subject_dn, const Extensions& extensions); /** diff --git a/src/lib/cert/x509/x509self.cpp b/src/lib/cert/x509/x509self.cpp index 636b9fbb6..8b9aeda09 100644 --- a/src/lib/cert/x509/x509self.cpp +++ b/src/lib/cert/x509/x509self.cpp @@ -1,7 +1,6 @@ /* * PKCS #10/Self Signed Cert Creation * (C) 1999-2008 Jack Lloyd -* 2016 Matthias Gierlings * * Botan is released under the Simplified BSD License (see license.txt) */ @@ -76,14 +75,9 @@ X509_Certificate create_self_signed_cert(const X509_Cert_Options& opts, extensions.add( new Cert_Extension::Extended_Key_Usage(opts.ex_constraints)); - return X509_CA::make_cert(signer.get(), - rng, - sig_algo, - pub_key, - X509_CA::Certificate_Properties(opts.start, - opts.end, - subject_dn, - subject_dn), + return X509_CA::make_cert(signer.get(), rng, sig_algo, pub_key, + opts.start, opts.end, + subject_dn, subject_dn, extensions); } |