Class Asn1.Reader
java.lang.Object
com.codename1.backend.security.pki.Asn1.Reader
- Enclosing class:
Asn1
Reads one level of a DER structure. Every read checks the tag and that
the element ends inside its parent.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]bits()A BIT STRING's bytes; it must have no unused bits.booleanbool()voidfinish()Fails unless every byte has been read.booleanhasMore()oid()open(int tag) A reader over the content of the next element, which must carrytag.openOptional(int tag) Likeopen(int), or null and nothing read when the next tag is another.intpeek()The tag of the next element, or -1 at the end.byte[]raw(int tag) The next element whole, header included, which must carrytag.byte[]rawAny()The next element whole, whatever its tag.byte[]read(int tag) The next element's content, which must carrytag.voidskip()Skips the next element, whatever it is.intA small non-negative INTEGER.string()Any of the string types a certificate name uses, decoded.longtime()A time, UTCTime or GeneralizedTime, as milliseconds since the epoch.byte[]An INTEGER as its unsigned magnitude, leading zeros removed.
-
Constructor Details
-
Reader
- Throws:
IOException
-
-
Method Details
-
hasMore
public boolean hasMore() -
peek
public int peek()The tag of the next element, or -1 at the end. -
finish
-
read
The next element's content, which must carrytag.- Throws:
IOException
-
raw
The next element whole, header included, which must carrytag.- Throws:
IOException
-
open
A reader over the content of the next element, which must carrytag.- Throws:
IOException
-
openOptional
Likeopen(int), or null and nothing read when the next tag is another.- Throws:
IOException
-
skip
-
rawAny
The next element whole, whatever its tag.- Throws:
IOException
-
oid
- Throws:
IOException
-
unsignedInteger
An INTEGER as its unsigned magnitude, leading zeros removed.- Throws:
IOException
-
smallInteger
-
bool
- Throws:
IOException
-
bits
A BIT STRING's bytes; it must have no unused bits.- Throws:
IOException
-
time
A time, UTCTime or GeneralizedTime, as milliseconds since the epoch.- Throws:
IOException
-
string
Any of the string types a certificate name uses, decoded.- Throws:
IOException
-