aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pubkey
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2019-03-03 19:09:47 -0500
committerJack Lloyd <[email protected]>2019-03-03 19:09:47 -0500
commitb99dd1754909e8702d116c842a0e2d2246b76652 (patch)
tree881f6669f410c345326ff7d1a9ca66f6bdc0b10f /src/lib/pubkey
parente44f4b5d06a3b10c5cfd380cd3917f94bdb03fef (diff)
parentb999c51e42b394bdcab38cd1c3b5d46c3adaba64 (diff)
Merge GH #1849 Prefer to_string over as_string
Diffstat (limited to 'src/lib/pubkey')
-rw-r--r--src/lib/pubkey/ec_group/ec_group.cpp2
-rw-r--r--src/lib/pubkey/ec_group/ec_group.h2
-rw-r--r--src/lib/pubkey/pbes2/pbes2.cpp2
-rw-r--r--src/lib/pubkey/pk_algs.cpp4
-rw-r--r--src/lib/pubkey/pkcs8.cpp6
5 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/pubkey/ec_group/ec_group.cpp b/src/lib/pubkey/ec_group/ec_group.cpp
index f4419c7f0..2067d57c4 100644
--- a/src/lib/pubkey/ec_group/ec_group.cpp
+++ b/src/lib/pubkey/ec_group/ec_group.cpp
@@ -351,7 +351,7 @@ EC_Group::EC_Group(const OID& domain_oid)
{
this->m_data = ec_group_data().lookup(domain_oid);
if(!this->m_data)
- throw Invalid_Argument("Unknown EC_Group " + domain_oid.as_string());
+ throw Invalid_Argument("Unknown EC_Group " + domain_oid.to_string());
}
EC_Group::EC_Group(const std::string& str)
diff --git a/src/lib/pubkey/ec_group/ec_group.h b/src/lib/pubkey/ec_group/ec_group.h
index 8a22cebce..8735a8ea5 100644
--- a/src/lib/pubkey/ec_group/ec_group.h
+++ b/src/lib/pubkey/ec_group/ec_group.h
@@ -236,7 +236,7 @@ class BOTAN_PUBLIC_API(2,0) EC_Group final
* Return the OID of these domain parameters
* @result the OID as a string
*/
- std::string BOTAN_DEPRECATED("Use get_curve_oid") get_oid() const { return get_curve_oid().as_string(); }
+ std::string BOTAN_DEPRECATED("Use get_curve_oid") get_oid() const { return get_curve_oid().to_string(); }
/**
* Return the OID of these domain parameters
diff --git a/src/lib/pubkey/pbes2/pbes2.cpp b/src/lib/pubkey/pbes2/pbes2.cpp
index b90e2a814..ce540c932 100644
--- a/src/lib/pubkey/pbes2/pbes2.cpp
+++ b/src/lib/pubkey/pbes2/pbes2.cpp
@@ -89,7 +89,7 @@ SymmetricKey derive_key(const std::string& passphrase,
#endif
else
throw Decoding_Error("PBE-PKCS5 v2.0: Unknown KDF algorithm " +
- kdf_algo.get_oid().as_string());
+ kdf_algo.get_oid().to_string());
}
secure_vector<uint8_t> derive_key(const std::string& passphrase,
diff --git a/src/lib/pubkey/pk_algs.cpp b/src/lib/pubkey/pk_algs.cpp
index 9ea89c59f..6d7de60ad 100644
--- a/src/lib/pubkey/pk_algs.cpp
+++ b/src/lib/pubkey/pk_algs.cpp
@@ -86,7 +86,7 @@ load_public_key(const AlgorithmIdentifier& alg_id,
const std::vector<std::string> alg_info = split_on(OIDS::lookup(alg_id.get_oid()), '/');
if(alg_info.empty())
- throw Decoding_Error("Unknown algorithm OID: " + alg_id.get_oid().as_string());
+ throw Decoding_Error("Unknown algorithm OID: " + alg_id.get_oid().to_string());
const std::string alg_name = alg_info[0];
@@ -169,7 +169,7 @@ load_private_key(const AlgorithmIdentifier& alg_id,
{
const std::string alg_name = OIDS::lookup(alg_id.get_oid());
if(alg_name == "")
- throw Decoding_Error("Unknown algorithm OID: " + alg_id.get_oid().as_string());
+ throw Decoding_Error("Unknown algorithm OID: " + alg_id.get_oid().to_string());
#if defined(BOTAN_HAS_RSA)
if(alg_name == "RSA")
diff --git a/src/lib/pubkey/pkcs8.cpp b/src/lib/pubkey/pkcs8.cpp
index d5add2adf..0929769df 100644
--- a/src/lib/pubkey/pkcs8.cpp
+++ b/src/lib/pubkey/pkcs8.cpp
@@ -105,7 +105,7 @@ secure_vector<uint8_t> PKCS8_decode(
if(is_encrypted)
{
if(OIDS::lookup(pbe_alg_id.get_oid()) != "PBE-PKCS5v20")
- throw PKCS8_Exception("Unknown PBE type " + pbe_alg_id.get_oid().as_string());
+ throw PKCS8_Exception("Unknown PBE type " + pbe_alg_id.get_oid().to_string());
#if defined(BOTAN_HAS_PKCS5_PBES2)
key = pbes2_decrypt(key_data, get_passphrase(), pbe_alg_id.get_parameters());
#else
@@ -351,9 +351,9 @@ load_key(DataSource& source,
secure_vector<uint8_t> pkcs8_key = PKCS8_decode(source, get_pass, alg_id, is_encrypted);
const std::string alg_name = OIDS::lookup(alg_id.get_oid());
- if(alg_name.empty() || alg_name == alg_id.get_oid().as_string())
+ if(alg_name.empty() || alg_name == alg_id.get_oid().to_string())
throw PKCS8_Exception("Unknown algorithm OID: " +
- alg_id.get_oid().as_string());
+ alg_id.get_oid().to_string());
return load_private_key(alg_id, pkcs8_key);
}