aboutsummaryrefslogtreecommitdiffstats
path: root/src/cms/cms_ealg.cpp
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/cms_ealg.cpp
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/cms_ealg.cpp')
-rw-r--r--src/cms/cms_ealg.cpp12
1 files changed, 3 insertions, 9 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);