From 58f2a24de7b6e7cbae80766b39815e4a18df64be Mon Sep 17 00:00:00 2001 From: lloyd Date: Sun, 25 Jun 2006 03:41:11 +0000 Subject: Add a new variant of X509_CA::make_cert that takes an Extensions object, rather than creating it internally. The older version (still used internally) creates the Extensions object as before and passes it on. --- include/x509_ca.h | 6 ++++++ src/x509_ca.cpp | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/include/x509_ca.h b/include/x509_ca.h index 75e8ac04b..8dd89755b 100644 --- a/include/x509_ca.h +++ b/include/x509_ca.h @@ -38,6 +38,12 @@ class X509_CA Key_Constraints, const std::vector&); + static X509_Certificate make_cert(PK_Signer*, const AlgorithmIdentifier&, + const MemoryRegion&, + const X509_Time&, const X509_Time&, + const X509_DN&, const X509_DN&, + const class Extensions&); + X509_CA(const X509_Certificate&, const PKCS8_PrivateKey&); ~X509_CA(); private: diff --git a/src/x509_ca.cpp b/src/x509_ca.cpp index b13559341..ac3faa7ac 100644 --- a/src/x509_ca.cpp +++ b/src/x509_ca.cpp @@ -132,6 +132,24 @@ X509_Certificate X509_CA::make_cert(PK_Signer* signer, extensions.add( new Cert_Extension::Issuer_Alternative_Name(issuer_alt)); + return make_cert(signer, sig_algo, pub_key, + not_before, not_after, + issuer_dn, subject_dn, + extensions); + } + +/************************************************* +* Create a new certificate * +*************************************************/ +X509_Certificate X509_CA::make_cert(PK_Signer* signer, + const AlgorithmIdentifier& sig_algo, + const MemoryRegion& pub_key, + const X509_Time& not_before, + const X509_Time& not_after, + const X509_DN& issuer_dn, + const X509_DN& subject_dn, + const Extensions& extensions) + { const u32bit X509_CERT_VERSION = 3; const u32bit SERIAL_BITS = 128; -- cgit v1.2.3