aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/prov/pkcs11
diff options
context:
space:
mode:
authorRenĂ© Korthaus <[email protected]>2016-12-05 10:20:06 +0100
committerRenĂ© Korthaus <[email protected]>2016-12-05 10:28:42 +0100
commit9f5b5fc96913e2a17573287e8aa88f0510d52c1b (patch)
tree2b64a243ea3c5ae73eace781279d0af582148ac6 /src/lib/prov/pkcs11
parent8690e4e616367c12412fb56bc1826be203a4614b (diff)
Add Private_Key::private_key_info()
Adds new Private_Key::private_key_info() that returns a PKCS#8 PrivateKeyInfo structure. Renames the current Private_Key::pkcs8_private_key() to private_key_bits(). BER_encode() just invokes private_key_info().
Diffstat (limited to 'src/lib/prov/pkcs11')
-rw-r--r--src/lib/prov/pkcs11/p11_ecdh.cpp4
-rw-r--r--src/lib/prov/pkcs11/p11_ecdh.h2
-rw-r--r--src/lib/prov/pkcs11/p11_ecdsa.cpp4
-rw-r--r--src/lib/prov/pkcs11/p11_ecdsa.h2
-rw-r--r--src/lib/prov/pkcs11/p11_rsa.cpp4
-rw-r--r--src/lib/prov/pkcs11/p11_rsa.h2
6 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/prov/pkcs11/p11_ecdh.cpp b/src/lib/prov/pkcs11/p11_ecdh.cpp
index f2604185d..50aa964d5 100644
--- a/src/lib/prov/pkcs11/p11_ecdh.cpp
+++ b/src/lib/prov/pkcs11/p11_ecdh.cpp
@@ -33,9 +33,9 @@ ECDH_PrivateKey PKCS11_ECDH_PrivateKey::export_key() const
return ECDH_PrivateKey(rng, domain(), BigInt::decode(priv_key));
}
-secure_vector<byte> PKCS11_ECDH_PrivateKey::pkcs8_private_key() const
+secure_vector<byte> PKCS11_ECDH_PrivateKey::private_key_bits() const
{
- return export_key().pkcs8_private_key();
+ return export_key().private_key_bits();
}
namespace {
diff --git a/src/lib/prov/pkcs11/p11_ecdh.h b/src/lib/prov/pkcs11/p11_ecdh.h
index ef9ccb250..7fc21ad46 100644
--- a/src/lib/prov/pkcs11/p11_ecdh.h
+++ b/src/lib/prov/pkcs11/p11_ecdh.h
@@ -101,7 +101,7 @@ class BOTAN_DLL PKCS11_ECDH_PrivateKey final : public virtual PKCS11_EC_PrivateK
/// @return the exported ECDH private key
ECDH_PrivateKey export_key() const;
- secure_vector<byte> pkcs8_private_key() const override;
+ secure_vector<byte> private_key_bits() const override;
std::unique_ptr<PK_Ops::Key_Agreement>
create_key_agreement_op(RandomNumberGenerator& rng,
diff --git a/src/lib/prov/pkcs11/p11_ecdsa.cpp b/src/lib/prov/pkcs11/p11_ecdsa.cpp
index 852366d25..cbdd4d007 100644
--- a/src/lib/prov/pkcs11/p11_ecdsa.cpp
+++ b/src/lib/prov/pkcs11/p11_ecdsa.cpp
@@ -47,9 +47,9 @@ ECDSA_PrivateKey PKCS11_ECDSA_PrivateKey::export_key() const
return ECDSA_PrivateKey(rng, domain(), BigInt::decode(priv_key));
}
-secure_vector<byte> PKCS11_ECDSA_PrivateKey::pkcs8_private_key() const
+secure_vector<byte> PKCS11_ECDSA_PrivateKey::private_key_bits() const
{
- return export_key().pkcs8_private_key();
+ return export_key().private_key_bits();
}
namespace {
diff --git a/src/lib/prov/pkcs11/p11_ecdsa.h b/src/lib/prov/pkcs11/p11_ecdsa.h
index a4c3df3ea..73ee900db 100644
--- a/src/lib/prov/pkcs11/p11_ecdsa.h
+++ b/src/lib/prov/pkcs11/p11_ecdsa.h
@@ -98,7 +98,7 @@ class BOTAN_DLL PKCS11_ECDSA_PrivateKey final : public PKCS11_EC_PrivateKey
/// @return the exported ECDSA private key
ECDSA_PrivateKey export_key() const;
- secure_vector<byte> pkcs8_private_key() const override;
+ secure_vector<byte> private_key_bits() const override;
bool check_key(RandomNumberGenerator&, bool) const override;
diff --git a/src/lib/prov/pkcs11/p11_rsa.cpp b/src/lib/prov/pkcs11/p11_rsa.cpp
index ea0fc874b..1edbde83b 100644
--- a/src/lib/prov/pkcs11/p11_rsa.cpp
+++ b/src/lib/prov/pkcs11/p11_rsa.cpp
@@ -101,9 +101,9 @@ RSA_PrivateKey PKCS11_RSA_PrivateKey::export_key() const
, BigInt::decode(n));
}
-secure_vector<byte> PKCS11_RSA_PrivateKey::pkcs8_private_key() const
+secure_vector<byte> PKCS11_RSA_PrivateKey::private_key_bits() const
{
- return export_key().pkcs8_private_key();
+ return export_key().private_key_bits();
}
diff --git a/src/lib/prov/pkcs11/p11_rsa.h b/src/lib/prov/pkcs11/p11_rsa.h
index 6d80e45a7..13b9d9dc1 100644
--- a/src/lib/prov/pkcs11/p11_rsa.h
+++ b/src/lib/prov/pkcs11/p11_rsa.h
@@ -200,7 +200,7 @@ class BOTAN_DLL PKCS11_RSA_PrivateKey final : public Private_Key,
/// @return the exported RSA private key
RSA_PrivateKey export_key() const;
- secure_vector<byte> pkcs8_private_key() const override;
+ secure_vector<byte> private_key_bits() const override;
std::unique_ptr<PK_Ops::Decryption>
create_decryption_op(RandomNumberGenerator& rng,