diff options
author | René Korthaus <[email protected]> | 2016-12-04 22:06:32 +0100 |
---|---|---|
committer | René Korthaus <[email protected]> | 2016-12-05 10:28:38 +0100 |
commit | 8690e4e616367c12412fb56bc1826be203a4614b (patch) | |
tree | dace4204f21931d458ceeadf351428f01792f215 /src/lib/prov | |
parent | 61c4932f27c060a691ddc04fb75d227a1e8365dd (diff) |
Add Public_Key::subject_public_key()
Adds new Public_Key::subject_public_key() that returns
a X.509 SubjectPublicKey structure. Renames the current
Public_Key::x509_subject_public_key() to public_key_bits().
BER_encode() just invokes subject_public_key().
Diffstat (limited to 'src/lib/prov')
-rw-r--r-- | src/lib/prov/openssl/openssl_rsa.cpp | 4 | ||||
-rw-r--r-- | src/lib/prov/pkcs11/p11_ecc_key.cpp | 2 | ||||
-rw-r--r-- | src/lib/prov/pkcs11/p11_ecc_key.h | 2 | ||||
-rw-r--r-- | src/lib/prov/tpm/tpm.cpp | 2 | ||||
-rw-r--r-- | src/lib/prov/tpm/tpm.h | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/prov/openssl/openssl_rsa.cpp b/src/lib/prov/openssl/openssl_rsa.cpp index 77f74fab6..21822a627 100644 --- a/src/lib/prov/openssl/openssl_rsa.cpp +++ b/src/lib/prov/openssl/openssl_rsa.cpp @@ -44,7 +44,7 @@ class OpenSSL_RSA_Encryption_Operation : public PK_Ops::Encryption OpenSSL_RSA_Encryption_Operation(const RSA_PublicKey& rsa, int pad, size_t pad_overhead) : m_openssl_rsa(nullptr, ::RSA_free), m_padding(pad) { - const std::vector<byte> der = rsa.x509_subject_public_key(); + const std::vector<byte> der = rsa.public_key_bits(); const byte* der_ptr = der.data(); m_openssl_rsa.reset(::d2i_RSAPublicKey(nullptr, &der_ptr, der.size())); if(!m_openssl_rsa) @@ -143,7 +143,7 @@ class OpenSSL_RSA_Verification_Operation : public PK_Ops::Verification_with_EMSA PK_Ops::Verification_with_EMSA(emsa), m_openssl_rsa(nullptr, ::RSA_free) { - const std::vector<byte> der = rsa.x509_subject_public_key(); + const std::vector<byte> der = rsa.public_key_bits(); const byte* der_ptr = der.data(); m_openssl_rsa.reset(::d2i_RSAPublicKey(nullptr, &der_ptr, der.size())); } diff --git a/src/lib/prov/pkcs11/p11_ecc_key.cpp b/src/lib/prov/pkcs11/p11_ecc_key.cpp index 52f98b079..527daceaf 100644 --- a/src/lib/prov/pkcs11/p11_ecc_key.cpp +++ b/src/lib/prov/pkcs11/p11_ecc_key.cpp @@ -106,7 +106,7 @@ size_t PKCS11_EC_PrivateKey::key_length() const return m_domain_params.get_order().bits(); } -std::vector<byte> PKCS11_EC_PrivateKey::x509_subject_public_key() const +std::vector<byte> PKCS11_EC_PrivateKey::public_key_bits() const { return unlock(EC2OSP(public_point(), PointGFp::COMPRESSED)); } diff --git a/src/lib/prov/pkcs11/p11_ecc_key.h b/src/lib/prov/pkcs11/p11_ecc_key.h index 0a222cb79..69e612c33 100644 --- a/src/lib/prov/pkcs11/p11_ecc_key.h +++ b/src/lib/prov/pkcs11/p11_ecc_key.h @@ -201,7 +201,7 @@ class BOTAN_DLL PKCS11_EC_PrivateKey : public virtual Private_Key, // Private_Key methods - std::vector<byte> x509_subject_public_key() const override; + std::vector<byte> public_key_bits() const override; std::size_t key_length() const override; diff --git a/src/lib/prov/tpm/tpm.cpp b/src/lib/prov/tpm/tpm.cpp index 0c2f9353e..b3a846d4e 100644 --- a/src/lib/prov/tpm/tpm.cpp +++ b/src/lib/prov/tpm/tpm.cpp @@ -349,7 +349,7 @@ AlgorithmIdentifier TPM_PrivateKey::algorithm_identifier() const AlgorithmIdentifier::USE_NULL_PARAM); } -std::vector<byte> TPM_PrivateKey::x509_subject_public_key() const +std::vector<byte> TPM_PrivateKey::public_key_bits() const { return DER_Encoder() .start_cons(SEQUENCE) diff --git a/src/lib/prov/tpm/tpm.h b/src/lib/prov/tpm/tpm.h index 804d42e70..f776f09e7 100644 --- a/src/lib/prov/tpm/tpm.h +++ b/src/lib/prov/tpm/tpm.h @@ -154,7 +154,7 @@ class BOTAN_DLL TPM_PrivateKey : public Private_Key AlgorithmIdentifier algorithm_identifier() const override; - std::vector<byte> x509_subject_public_key() const override; + std::vector<byte> public_key_bits() const override; secure_vector<byte> pkcs8_private_key() const override; |