aboutsummaryrefslogtreecommitdiffstats
path: root/src/cert/x509cert
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-09-17 14:24:56 +0000
committerlloyd <[email protected]>2010-09-17 14:24:56 +0000
commit25149a9b4cd3ca29eb1ef45871430a6044e6a346 (patch)
tree7ba8f738212c7fbb59647b6a2fc75b95cb25ee9a /src/cert/x509cert
parent4ef234d711e1dd40f1cd7ec328e9933fb19dc5ee (diff)
Remove dependencies on X509_Store
Diffstat (limited to 'src/cert/x509cert')
-rw-r--r--src/cert/x509cert/x509_obj.cpp15
-rw-r--r--src/cert/x509cert/x509_obj.h8
2 files changed, 19 insertions, 4 deletions
diff --git a/src/cert/x509cert/x509_obj.cpp b/src/cert/x509cert/x509_obj.cpp
index ffee74f12..27aaea3bf 100644
--- a/src/cert/x509cert/x509_obj.cpp
+++ b/src/cert/x509cert/x509_obj.cpp
@@ -145,6 +145,15 @@ AlgorithmIdentifier X509_Object::signature_algorithm() const
/*
* Check the signature on an object
*/
+bool X509_Object::check_signature(Public_Key* pub_key) const
+ {
+ std::auto_ptr<Public_Key> key(pub_key);
+ return check_signature(*key);
+ }
+
+/*
+* Check the signature on an object
+*/
bool X509_Object::check_signature(Public_Key& pub_key) const
{
try {
@@ -195,15 +204,13 @@ void X509_Object::do_decode()
}
catch(Decoding_Error& e)
{
- const std::string what = e.what();
throw Decoding_Error(PEM_label_pref + " decoding failed (" +
- what.substr(23, std::string::npos) + ")");
+ e.what() + ")");
}
catch(Invalid_Argument& e)
{
- const std::string what = e.what();
throw Decoding_Error(PEM_label_pref + " decoding failed (" +
- what.substr(7, std::string::npos) + ")");
+ e.what() + ")");
}
}
diff --git a/src/cert/x509cert/x509_obj.h b/src/cert/x509cert/x509_obj.h
index 28ee95073..60c7c4db8 100644
--- a/src/cert/x509cert/x509_obj.h
+++ b/src/cert/x509cert/x509_obj.h
@@ -61,6 +61,14 @@ class BOTAN_DLL X509_Object
bool check_signature(class Public_Key& key) const;
/**
+ * Check the signature on this data
+ * @param key the public key purportedly used to sign this data
+ * the pointer will be deleted after use
+ * @return true if the signature is valid, otherwise false
+ */
+ bool check_signature(class Public_Key* key) const;
+
+ /**
* Encode this to a pipe
* @deprecated use BER_encode or PEM_encode instead
* @param out the pipe to write to