diff options
author | Jack Lloyd <[email protected]> | 2018-01-23 12:38:38 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-01-23 12:38:38 -0500 |
commit | bf1548695aea625c3af91e53c294aabeeb03f873 (patch) | |
tree | 25a4204495382930a12700dc5dd3ead2a5bb4eb0 /src/lib/x509/x509_obj.h | |
parent | 65f375348c0773af6e9bbe3a005aef177dfd4ac3 (diff) |
Allow applications to easily override extensions in cert requests
Refactor the code so it's possible to create a cert request without
going through x509self.h (PKCS10_Request::create).
Add Extensions::add_new, so we can add an extension to a PKCS10
request without stomping on one already included by the application.
Refactor the X509 unit tests to avoid (some) duplicated key creations.
Just create a key once at the start and use it for all of the tests.
GH #1428
Diffstat (limited to 'src/lib/x509/x509_obj.h')
-rw-r--r-- | src/lib/x509/x509_obj.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/x509/x509_obj.h b/src/lib/x509/x509_obj.h index 72ba0f534..1e4abe00b 100644 --- a/src/lib/x509/x509_obj.h +++ b/src/lib/x509/x509_obj.h @@ -16,6 +16,7 @@ namespace Botan { class Public_Key; +class Private_Key; class RandomNumberGenerator; /** @@ -119,6 +120,14 @@ class BOTAN_PUBLIC_API(2,0) X509_Object : public ASN1_Object { return std::vector<std::string>(); } virtual ~X509_Object() = default; + + static std::unique_ptr<PK_Signer> + choose_sig_format(AlgorithmIdentifier& sig_algo, + const Private_Key& key, + RandomNumberGenerator& rng, + const std::string& hash_fn, + const std::string& padding_algo); + protected: X509_Object() = default; |