Class DerParser
java.lang.Object
org.jenkinsci.main.modules.instance_identity.pem.DerParser
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public class DerParser
extends Object
A bare-minimum ASN.1 DER decoder, just having enough functions to decode PKCS#1 private keys. Especially, it doesn't
handle explicitly tagged types with an outer tag.
This parser can only handle one layer. To parse nested constructs, get a new parser for each layer using
Asn1Object.getParser()
.
There are many DER decoders in JRE but using them will tie this program to a specific JCE/JVM.
- Author:
- zhang
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
protected final InputStream
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
ConstructorDescriptionDerParser
(byte[] bytes) Create a new DER decoder from a byte array.DerParser
(InputStream in) Create a new DER decoder from an input stream. -
Method Summary
-
Field Details
-
UNIVERSAL
public static final int UNIVERSAL- See Also:
-
APPLICATION
public static final int APPLICATION- See Also:
-
CONTEXT
public static final int CONTEXT- See Also:
-
PRIVATE
public static final int PRIVATE- See Also:
-
CONSTRUCTED
public static final int CONSTRUCTED- See Also:
-
ANY
public static final int ANY- See Also:
-
BOOLEAN
public static final int BOOLEAN- See Also:
-
INTEGER
public static final int INTEGER- See Also:
-
BIT_STRING
public static final int BIT_STRING- See Also:
-
OCTET_STRING
public static final int OCTET_STRING- See Also:
-
NULL
public static final int NULL- See Also:
-
OBJECT_IDENTIFIER
public static final int OBJECT_IDENTIFIER- See Also:
-
REAL
public static final int REAL- See Also:
-
ENUMERATED
public static final int ENUMERATED- See Also:
-
RELATIVE_OID
public static final int RELATIVE_OID- See Also:
-
SEQUENCE
public static final int SEQUENCE- See Also:
-
SET
public static final int SET- See Also:
-
NUMERIC_STRING
public static final int NUMERIC_STRING- See Also:
-
PRINTABLE_STRING
public static final int PRINTABLE_STRING- See Also:
-
T61_STRING
public static final int T61_STRING- See Also:
-
VIDEOTEX_STRING
public static final int VIDEOTEX_STRING- See Also:
-
IA5_STRING
public static final int IA5_STRING- See Also:
-
GRAPHIC_STRING
public static final int GRAPHIC_STRING- See Also:
-
ISO646_STRING
public static final int ISO646_STRING- See Also:
-
GENERAL_STRING
public static final int GENERAL_STRING- See Also:
-
UTF8_STRING
public static final int UTF8_STRING- See Also:
-
UNIVERSAL_STRING
public static final int UNIVERSAL_STRING- See Also:
-
BMP_STRING
public static final int BMP_STRING- See Also:
-
UTC_TIME
public static final int UTC_TIME- See Also:
-
GENERALIZED_TIME
public static final int GENERALIZED_TIME- See Also:
-
in
-
-
Constructor Details
-
DerParser
Create a new DER decoder from an input stream.- Parameters:
in
- The DER encoded stream- Throws:
IOException
- if problems parsing
-
DerParser
Create a new DER decoder from a byte array.- Parameters:
bytes
- the encoded bytes- Throws:
IOException
- if problems parsing
-
-
Method Details
-
read
Read next object. If it's constructed, the value holds encoded content and it should be parsed by a new parser fromAsn1Object.getParser
.- Returns:
- parsed object
- Throws:
IOException
- if problems parsing
-