aboutsummaryrefslogtreecommitdiffstats
path: root/checks
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-09-06 19:52:59 +0000
committerlloyd <[email protected]>2006-09-06 19:52:59 +0000
commit34e84e5ba997949120e5c99011dbf4e770db1278 (patch)
treefbd9fe7f5a0e1e972385d253c5ea1fb998697f98 /checks
parent559e2860f0716dc5c40697a08a790d3b7c42ce8e (diff)
Rename X509_PublicKey and PKCS8_PrivateKey to the new types within the
self-test sources
Diffstat (limited to 'checks')
-rw-r--r--checks/pk.cpp8
-rw-r--r--checks/pk_bench.cpp2
-rw-r--r--checks/x509.cpp14
3 files changed, 12 insertions, 12 deletions
diff --git a/checks/pk.cpp b/checks/pk.cpp
index be6891dbb..4ff798e00 100644
--- a/checks/pk.cpp
+++ b/checks/pk.cpp
@@ -346,7 +346,7 @@ u32bit validate_rsa_enc_pkcs8(const std::string& algo,
decoding method we use */
DataSource_Memory keysource((const byte*)str[0].c_str(), str[0].length());
- PKCS8_PrivateKey* privkey = PKCS8::load_key(keysource, pass);
+ Private_Key* privkey = PKCS8::load_key(keysource, pass);
RSA_PrivateKey* rsapriv = dynamic_cast<RSA_PrivateKey*>(privkey);
if(!rsapriv)
@@ -466,7 +466,7 @@ u32bit validate_rsa_ver_x509(const std::string& algo,
DataSource_Memory keysource((const byte*)str[0].c_str(), str[0].length());
- X509_PublicKey* key = X509::load_key(keysource);
+ Public_Key* key = X509::load_key(keysource);
RSA_PublicKey* rsakey = dynamic_cast<RSA_PublicKey*>(key);
@@ -550,7 +550,7 @@ u32bit validate_dsa_sig(const std::string& algo,
decoding method we use */
DataSource_Memory keysource((const byte*)str[0].c_str(), str[0].length());
- PKCS8_PrivateKey* privkey = PKCS8::load_key(keysource, pass);
+ Private_Key* privkey = PKCS8::load_key(keysource, pass);
DSA_PrivateKey* dsapriv = dynamic_cast<DSA_PrivateKey*>(privkey);
if(!dsapriv)
@@ -577,7 +577,7 @@ u32bit validate_dsa_ver(const std::string& algo,
throw Exception("Invalid input from pk_valid.dat");
DataSource_Memory keysource((const byte*)str[0].c_str(), str[0].length());
- X509_PublicKey* key = X509::load_key(keysource);
+ Public_Key* key = X509::load_key(keysource);
DSA_PublicKey* dsakey = dynamic_cast<DSA_PublicKey*>(key);
diff --git a/checks/pk_bench.cpp b/checks/pk_bench.cpp
index bed0cfd7a..e2b6877eb 100644
--- a/checks/pk_bench.cpp
+++ b/checks/pk_bench.cpp
@@ -436,7 +436,7 @@ void bench_kas(PK_Key_Agreement* kas, const std::string& algo_name,
*************************************************/
RSA_PrivateKey* load_rsa_key(const std::string& file)
{
- PKCS8_PrivateKey* key = PKCS8::load_key(file);
+ Private_Key* key = PKCS8::load_key(file);
RSA_PrivateKey* rsakey = dynamic_cast<RSA_PrivateKey*>(key);
diff --git a/checks/x509.cpp b/checks/x509.cpp
index 6c1ab0f16..c07aaf761 100644
--- a/checks/x509.cpp
+++ b/checks/x509.cpp
@@ -15,11 +15,11 @@ X509_Cert_Options ca_opts();
X509_Cert_Options req_opts1();
X509_Cert_Options req_opts2();
-u64bit key_id(const X509_PublicKey* key)
+u64bit key_id(const Public_Key* key)
{
std::auto_ptr<X509_Encoder> encoder(key->x509_encoder());
if(!encoder.get())
- throw Internal_Error("X509_PublicKey:key_id: No encoder found");
+ throw Internal_Error("Public_Key:key_id: No encoder found");
Pipe pipe(new Hash_Filter("SHA-1", 8));
pipe.start_msg();
@@ -31,7 +31,7 @@ u64bit key_id(const X509_PublicKey* key)
SecureVector<byte> output = pipe.read_all();
if(output.size() != 8)
- throw Internal_Error("X509_PublicKey::key_id: Incorrect output size");
+ throw Internal_Error("Public_Key::key_id: Incorrect output size");
u64bit id = 0;
for(u32bit j = 0; j != 8; ++j)
@@ -39,14 +39,14 @@ u64bit key_id(const X509_PublicKey* key)
return id;
}
-u32bit check_against_copy(const PKCS8_PrivateKey& orig)
+u32bit check_against_copy(const Private_Key& orig)
{
- PKCS8_PrivateKey* copy_priv = PKCS8::copy_key(orig);
- X509_PublicKey* copy_pub = X509::copy_key(orig);
+ Private_Key* copy_priv = PKCS8::copy_key(orig);
+ Public_Key* copy_pub = X509::copy_key(orig);
const std::string passphrase= "I need work! -Mr. T"; // Me too...
DataSource_Memory enc_source(PKCS8::PEM_encode(orig, passphrase));
- PKCS8_PrivateKey* copy_priv_enc = PKCS8::load_key(enc_source, passphrase);
+ Private_Key* copy_priv_enc = PKCS8::load_key(enc_source, passphrase);
u64bit orig_id = key_id(&orig);
u64bit pub_id = key_id(copy_pub);