Package net.aifusion.asn
Class Utf8StringValue
java.lang.Object
net.aifusion.asn.AsnValue
net.aifusion.asn.Utf8StringValue
Class to manage a UTF-8 String
This non-normative example demonstrates using SmtpUTF8Mailbox as an
otherName in GeneralName to encode the email address
"u+8001u+5E2B@example.com".
The hexadecimal DER encoding of the email address is:
A022060A 2B060105 05070012 0809A014 0C12E880 81E5B8AB 40657861
6D706C65 2E636F6D
The text decoding is:
0 34: [0] {
2 10: OBJECT IDENTIFIER '1 3 6 1 5 5 7 0 18 8 9'
14 20: [0] {
16 18: UTF8String '..@example.com'
: }
: }
- Author:
- Sharad Singhal
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Utf8StringValue
create
(byte[] buffer, int blen, int cursor) Create a UTF8 String from a serialized valueboolean
byte[]
Get the encoded value for this ASN.1 value.getValue()
Get the value of this stringint
hashCode()
toAsnString
(String prefix) Get a (semi) ASN.1 notation for this value.toString()
Methods inherited from class net.aifusion.asn.AsnValue
getLength, getTag, getTagClass, getTagEncoding, getTagNumber, toHex, toHex, toHex, toHex
-
Constructor Details
-
Utf8StringValue
Create a UTF-8 string- Parameters:
value
- - input String
-
-
Method Details
-
getValue
Get the value of this string- Returns:
- - string value
-
create
Create a UTF8 String from a serialized value- Parameters:
buffer
- - input bufferblen
- - length of input buffercursor
- - starting location for the integer value- Returns:
- - UTF8StringValue
-
toAsnString
Description copied from class:AsnValue
Get a (semi) ASN.1 notation for this value.- Overrides:
toAsnString
in classAsnValue
- Parameters:
prefix
- - prefix to add to each line- Returns:
- - string containing the ASN.1 value
-
getEncodedValue
public byte[] getEncodedValue()Description copied from class:AsnValue
Get the encoded value for this ASN.1 value. This method should be implemented by subclasses to provide the encoded ASN.1 value- Specified by:
getEncodedValue
in classAsnValue
- Returns:
- byte [] containing encoded value for this ASN.1 value (including tag, length, content)
-
hashCode
public int hashCode() -
equals
-
toString
-