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:otherNameaccording 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 OtherNameParseResultparse(byte[] otherName)Parses the DER-encoded ASN.1SAN:otherNamefield into its components:type-idandvalue.static StringparseUtf8String(byte[] str)Parses a DER-encoded ASN.1UTF8Stringto a Java string:
-
-
-
Method Detail
-
parse
public static OtherNameParseResult parse(byte[] otherName)
Parses the DER-encoded ASN.1SAN:otherNamefield into its components:type-idandvalue.- Parameters:
otherName- a DER-encoded byte array- Returns:
- the parse result
- Throws:
NullPointerException- ifotherNameisnullIllegalArgumentException- ifotherNameis 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.1UTF8Stringto a Java string:- Parameters:
str- a DER-encoded byte array- Returns:
- the converted Java string
- Throws:
NullPointerException- ifstrisnullIllegalArgumentException- ifstris empty or if the DER-encoded byte array does not comply with ASN.1 DER encoding rules
-
-