aboutsummaryrefslogtreecommitdiffstats
path: root/src/cms
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-03-08 14:28:14 +0000
committerlloyd <[email protected]>2010-03-08 14:28:14 +0000
commitea38a42c2cfbc3a6235b11637b382589676c6286 (patch)
tree918b28ec50e98612e2c055e28368f7397b96f79c /src/cms
parent3900bd1e5a9974eea4faee4a8159380ea67c6251 (diff)
Remove the now no-op classes PK_Encrypting_Key,
PK_Decrypting_Key, PK_Signing_Key, PK_Verifying_with_MR_Key, and PK_Verifying_wo_MR_Key.
Diffstat (limited to 'src/cms')
-rw-r--r--src/cms/cms_ealg.cpp12
-rw-r--r--src/cms/cms_enc.h2
2 files changed, 4 insertions, 10 deletions
diff --git a/src/cms/cms_ealg.cpp b/src/cms/cms_ealg.cpp
index 5a9b42cde..4bae96302 100644
--- a/src/cms/cms_ealg.cpp
+++ b/src/cms/cms_ealg.cpp
@@ -107,12 +107,7 @@ void CMS_Encoder::encrypt(RandomNumberGenerator& rng,
if(constraints != NO_CONSTRAINTS && !(constraints & KEY_ENCIPHERMENT))
throw Invalid_Argument("CMS: Constraints not set for encryption");
- PK_Encrypting_Key* enc_key = dynamic_cast<PK_Encrypting_Key*>(key.get());
- if(enc_key == 0)
- throw Internal_Error("CMS_Encoder::encrypt: " + algo +
- " can't encrypt");
-
- encrypt_ktri(rng, to, enc_key, cipher);
+ encrypt_ktri(rng, to, key.get(), cipher);
}
else if(algo == "DH")
{
@@ -130,7 +125,7 @@ void CMS_Encoder::encrypt(RandomNumberGenerator& rng,
*/
void CMS_Encoder::encrypt_ktri(RandomNumberGenerator& rng,
const X509_Certificate& to,
- PK_Encrypting_Key* pub_key,
+ Public_Key* pub_key,
const std::string& cipher)
{
const std::string padding = "EME-PKCS1-v1_5";
@@ -297,8 +292,7 @@ void CMS_Encoder::sign(const X509_Certificate& cert,
Signature_Format format = IEEE_1363;
- const PK_Signing_Key& sig_key = dynamic_cast<const PK_Signing_Key&>(key);
- std::auto_ptr<PK_Signer> signer(get_pk_signer(sig_key, padding, format));
+ std::auto_ptr<PK_Signer> signer(get_pk_signer(key, padding, format));
AlgorithmIdentifier sig_algo(OIDS::lookup(key.algo_name() + "/" + padding),
AlgorithmIdentifier::USE_NULL_PARAM);
diff --git a/src/cms/cms_enc.h b/src/cms/cms_enc.h
index b1e18ef7d..ec2fdf3b3 100644
--- a/src/cms/cms_enc.h
+++ b/src/cms/cms_enc.h
@@ -59,7 +59,7 @@ class BOTAN_DLL CMS_Encoder
void add_layer(const std::string&, DER_Encoder&);
void encrypt_ktri(RandomNumberGenerator&,
- const X509_Certificate&, PK_Encrypting_Key*,
+ const X509_Certificate&, Public_Key*,
const std::string&);
void encrypt_kari(RandomNumberGenerator&,
const X509_Certificate&, Public_Key*,