aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/asn1/asn1_str.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-11-09 16:43:57 -0500
committerJack Lloyd <[email protected]>2017-11-09 16:43:57 -0500
commitb08f26d3658db3213d98932cbc6dd3e6efdc8b85 (patch)
treec1cfb432aaa1625d6a1cfff7bf7487b75dcd0286 /src/lib/asn1/asn1_str.h
parent54baf3a3d3ee070e3740859298f92d69b042c9c6 (diff)
Remove use of transcode
Diffstat (limited to 'src/lib/asn1/asn1_str.h')
-rw-r--r--src/lib/asn1/asn1_str.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/lib/asn1/asn1_str.h b/src/lib/asn1/asn1_str.h
index 3ad82582e..f19265494 100644
--- a/src/lib/asn1/asn1_str.h
+++ b/src/lib/asn1/asn1_str.h
@@ -13,7 +13,8 @@
namespace Botan {
/**
-* Simple String
+* ASN.1 string type
+* This class normalizes all inputs to a UTF-8 std::string
*/
class BOTAN_PUBLIC_API(2,0) ASN1_String final : public ASN1_Object
{
@@ -21,14 +22,17 @@ class BOTAN_PUBLIC_API(2,0) ASN1_String final : public ASN1_Object
void encode_into(class DER_Encoder&) const override;
void decode_from(class BER_Decoder&) override;
- std::string value() const;
- std::string iso_8859() const;
+ ASN1_Tag tagging() const { return m_tag; }
+
+ const std::string& value() const { return m_utf8_str; }
- ASN1_Tag tagging() const;
+ std::string BOTAN_DEPRECATED("Use value() to get UTF-8 string instead")
+ iso_8859() const;
- explicit ASN1_String(const std::string& = "");
- ASN1_String(const std::string&, ASN1_Tag);
+ explicit ASN1_String(const std::string& utf8 = "");
+ ASN1_String(const std::string& utf8, ASN1_Tag tag);
private:
+ std::vector<uint8_t> m_data;
std::string m_utf8_str;
ASN1_Tag m_tag;
};