Package org.wildfly.security.asn1
Class ASN1
java.lang.Object
org.wildfly.security.asn1.ASN1
A class that contains ASN.1 constants and utilities.
- Author:
- Farah Juma
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMask used to determine if a type tag is application-specific.static final intThe universal bit string type tag.static final intThe universal BMP (UTF-16 big-endian) string type tag.static final intThe universal boolean type tag.static final intMask used to obtain the class bits from a type tag.static final intMask used to determine if a type tag is constructed.static final intMask used to determine if a type tag is context-specific.static final intA type for representing timestamps.static final intThe universal IA5 string type tag.static final intThe universal integer type tag.static final intThe universal null type tag.static final intThe universal object identifier type tag.static final intThe universal octet string type tag.static final StringAlgorithm ID for DSA keys used for any purpose.static final StringAlgorithm ID for EC keys used for any purpose.static final StringObject identifier for the PKCS #9extensionRequestattribute.static final StringObject identifier for the MD2 hash algorithm.static final StringObject identifier for the MD2 with RSA signature algorithm.static final StringObject identifier for the MD4 with RSA signature algorithm.static final StringObject identifier for the MD5 hash algorithm.static final StringObject identifier for the MD5 with RSA signature algorithm.static final StringAlgorithm ID for RSA keys used for any purpose.static final StringObject identifier for the SHA1 hash algorithm.static final StringObject identifier for the SHA1 with DSA signature algorithm.static final StringObject identifier for the SHA1 with ECDSA signature algorithm.static final StringObject identifier for the SHA1 with RSA signature algorithm.static final StringObject identifier for the SHA-225 with ECDSA signature algorithm.static final StringObject identifier for the SHA256 with DSA signature algorithm.static final StringObject identifier for the SHA-256 with ECDSA signature algorithm.static final StringObject identifier for the SHA-256 with RSA signature algorithm.static final StringObject identifier for the SHA-384 with ECDSA signature algorithm.static final StringObject identifier for the SHA-384 with RSA signature algorithm.static final StringObject identifier for the SHA-512 with ECDSA signature algorithm.static final StringObject identifier for the SHA-512 with RSA signature algorithm.static final intThe universal printable string type tag.static final intThe universal sequence type tag.static final intThe universal set type tag.static final intMask used to obtain the tag number bits from a type tag.static final intThe universal (UTF-32 big-endian) string type tag.static final intThe universal UTF-8 string type tag. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatAsn1(ASN1Decoder decoder) Format an AS.1 string from the given decoder as a string.static voidformatAsn1(ASN1Decoder decoder, StringBuilder builder) Format an ASN.1 string from the given decoder as a string.static StringResolves a key algorithm based on a givenoid.static StringoidFromSignatureAlgorithm(String algorithmName) static Stringstatic voidvalidatePrintableByte(int b)
-
Field Details
-
BOOLEAN_TYPE
public static final int BOOLEAN_TYPEThe universal boolean type tag.- See Also:
-
INTEGER_TYPE
public static final int INTEGER_TYPEThe universal integer type tag.- See Also:
-
BIT_STRING_TYPE
public static final int BIT_STRING_TYPEThe universal bit string type tag.- See Also:
-
OCTET_STRING_TYPE
public static final int OCTET_STRING_TYPEThe universal octet string type tag.- See Also:
-
NULL_TYPE
public static final int NULL_TYPEThe universal null type tag.- See Also:
-
OBJECT_IDENTIFIER_TYPE
public static final int OBJECT_IDENTIFIER_TYPEThe universal object identifier type tag.- See Also:
-
UTF8_STRING_TYPE
public static final int UTF8_STRING_TYPEThe universal UTF-8 string type tag.- See Also:
-
PRINTABLE_STRING_TYPE
public static final int PRINTABLE_STRING_TYPEThe universal printable string type tag.- See Also:
-
IA5_STRING_TYPE
public static final int IA5_STRING_TYPEThe universal IA5 string type tag.- See Also:
-
GENERALIZED_TIME_TYPE
public static final int GENERALIZED_TIME_TYPEA type for representing timestamps.- See Also:
-
UNIVERSAL_STRING_TYPE
public static final int UNIVERSAL_STRING_TYPEThe universal (UTF-32 big-endian) string type tag.- See Also:
-
BMP_STRING_TYPE
public static final int BMP_STRING_TYPEThe universal BMP (UTF-16 big-endian) string type tag.- See Also:
-
SEQUENCE_TYPE
public static final int SEQUENCE_TYPEThe universal sequence type tag.- See Also:
-
SET_TYPE
public static final int SET_TYPEThe universal set type tag.- See Also:
-
CONSTRUCTED_MASK
public static final int CONSTRUCTED_MASKMask used to determine if a type tag is constructed.- See Also:
-
APPLICATION_SPECIFIC_MASK
public static final int APPLICATION_SPECIFIC_MASKMask used to determine if a type tag is application-specific.- See Also:
-
CONTEXT_SPECIFIC_MASK
public static final int CONTEXT_SPECIFIC_MASKMask used to determine if a type tag is context-specific.- See Also:
-
CLASS_MASK
public static final int CLASS_MASKMask used to obtain the class bits from a type tag.- See Also:
-
TAG_NUMBER_MASK
public static final int TAG_NUMBER_MASKMask used to obtain the tag number bits from a type tag.- See Also:
-
OID_SHA1_WITH_DSA
Object identifier for the SHA1 with DSA signature algorithm.- See Also:
-
OID_SHA256_WITH_DSA
Object identifier for the SHA256 with DSA signature algorithm.- Since:
- 1.2.0
- See Also:
-
OID_SHA1_WITH_ECDSA
Object identifier for the SHA1 with ECDSA signature algorithm.- See Also:
-
OID_SHA224_WITH_ECDSA
Object identifier for the SHA-225 with ECDSA signature algorithm.- See Also:
-
OID_SHA256_WITH_ECDSA
Object identifier for the SHA-256 with ECDSA signature algorithm.- See Also:
-
OID_SHA384_WITH_ECDSA
Object identifier for the SHA-384 with ECDSA signature algorithm.- See Also:
-
OID_SHA512_WITH_ECDSA
Object identifier for the SHA-512 with ECDSA signature algorithm.- See Also:
-
OID_MD2_WITH_RSA
Object identifier for the MD2 with RSA signature algorithm.- See Also:
-
OID_MD4_WITH_RSA
Object identifier for the MD4 with RSA signature algorithm.- See Also:
-
OID_MD5_WITH_RSA
Object identifier for the MD5 with RSA signature algorithm.- See Also:
-
OID_SHA1_WITH_RSA
Object identifier for the SHA1 with RSA signature algorithm.- See Also:
-
OID_SHA256_WITH_RSA
Object identifier for the SHA-256 with RSA signature algorithm.- See Also:
-
OID_SHA384_WITH_RSA
Object identifier for the SHA-384 with RSA signature algorithm.- See Also:
-
OID_SHA512_WITH_RSA
Object identifier for the SHA-512 with RSA signature algorithm.- See Also:
-
OID_EXTENSION_REQUEST
Object identifier for the PKCS #9extensionRequestattribute.- Since:
- 1.2.0
- See Also:
-
OID_MD2
Object identifier for the MD2 hash algorithm.- See Also:
-
OID_MD5
Object identifier for the MD5 hash algorithm.- See Also:
-
OID_SHA1
Object identifier for the SHA1 hash algorithm.- See Also:
-
OID_RSA
Algorithm ID for RSA keys used for any purpose.- See Also:
-
OID_DSA
Algorithm ID for DSA keys used for any purpose.- See Also:
-
OID_EC
Algorithm ID for EC keys used for any purpose.- See Also:
-
-
Constructor Details
-
ASN1
public ASN1()
-
-
Method Details
-
formatAsn1
Format an AS.1 string from the given decoder as a string.- Parameters:
decoder- the ASN.1 decoder- Returns:
- the formatted string
-
formatAsn1
Format an ASN.1 string from the given decoder as a string.- Parameters:
decoder- the ASN.1 decoderbuilder- the target string builder
-
keyAlgorithmFromOid
Resolves a key algorithm based on a givenoid.- Parameters:
oid- an ASN.1 object identifier or OID (notnull)- Returns:
- the string representing the key algorithm or null if no algorithm could be resolved for the given OID
-
oidFromSignatureAlgorithm
-
signatureAlgorithmFromOid
-
validatePrintableByte
- Throws:
ASN1Exception
-