diff options
author | Jack Lloyd <[email protected]> | 2019-08-04 08:26:06 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-08-04 16:26:50 -0400 |
commit | 0006bd1db9a96c294f2da852218d3f8579f422a9 (patch) | |
tree | 15600a4e8369eb167be052e8343c58dcb6693a3a /src/lib/asn1/asn1_oid.cpp | |
parent | 247df8cae3fbec8d9b608c5dc8b42a4f6bdeef8b (diff) |
Reduce usage of oids.h with the addition of some helpers on OID
Diffstat (limited to 'src/lib/asn1/asn1_oid.cpp')
-rw-r--r-- | src/lib/asn1/asn1_oid.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/asn1/asn1_oid.cpp b/src/lib/asn1/asn1_oid.cpp index dcb111644..bf3e2515b 100644 --- a/src/lib/asn1/asn1_oid.cpp +++ b/src/lib/asn1/asn1_oid.cpp @@ -12,6 +12,7 @@ #include <botan/parsing.h> #include <botan/oids.h> #include <algorithm> +#include <sstream> namespace Botan { @@ -93,14 +94,19 @@ OID::OID(const std::string& oid_str) */ std::string OID::to_string() const { - std::string oid_str; + std::ostringstream oss; for(size_t i = 0; i != m_id.size(); ++i) { - oid_str += std::to_string(m_id[i]); + oss << m_id[i]; if(i != m_id.size() - 1) - oid_str += "."; + oss << "."; } - return oid_str; + return oss.str(); + } + +std::string OID::to_formatted_string() const + { + return OIDS::oid2str_or_raw(*this); } /* |