Class OtherNameAsn1Parser
- java.lang.Object
-
- net.sf.michaelo.tomcat.realm.asn1.OtherNameAsn1Parser
-
public class OtherNameAsn1Parser extends Object
A minimalist ASN.1 parser for X.509SAN:otherName
according to RFC 5280, section 4.2.1.6.It properly takes JDK-6776681 into account and solves JDK-8277976.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OtherNameParseResult
parse(byte[] otherName)
Parses the DER-encoded ASN.1SAN:otherName
field into its components:type-id
andvalue
.static String
parseUtf8String(byte[] str)
Parses a DER-encoded ASN.1UTF8String
to a Java string:
-
-
-
Method Detail
-
parse
public static OtherNameParseResult parse(byte[] otherName)
Parses the DER-encoded ASN.1SAN:otherName
field into its components:type-id
andvalue
.- Parameters:
otherName
- a DER-encoded byte array- Returns:
- the parse result
- Throws:
NullPointerException
- ifotherName
isnull
IllegalArgumentException
- ifotherName
is empty or if the DER-encoded byte array does not comply with ASN.1 DER encoding rules
-
parseUtf8String
public static String parseUtf8String(byte[] str)
Parses a DER-encoded ASN.1UTF8String
to a Java string:- Parameters:
str
- a DER-encoded byte array- Returns:
- the converted Java string
- Throws:
NullPointerException
- ifstr
isnull
IllegalArgumentException
- ifstr
is empty or if the DER-encoded byte array does not comply with ASN.1 DER encoding rules
-
-