public interface ASN1Encoder extends Flushable
Modifier and Type | Method and Description |
---|---|
void |
encodeBitString(BigInteger integer)
Encode an ASN.1 bit string where the value represents the binary form of the given
integer . |
void |
encodeBitString(BitSet bitSet)
Encode an ASN.1 bit string value.
|
void |
encodeBitString(byte[] str)
Encode an ASN.1 bit string value.
|
void |
encodeBitString(byte[] str,
int numUnusedBits)
Encode an ASN.1 bit string value.
|
void |
encodeBitString(EnumSet<?> enumSet)
Encode an enum set as an ASN.1 bit string, with each ordinal value of the set representing a single bit.
|
void |
encodeBitString(String binaryStr)
Encode an ASN.1 bit string value.
|
void |
encodeBMPString(String str)
Encode an ASN.1 BMPString string value.
|
void |
encodeBoolean(boolean value)
Encode an ASN.1
boolean value. |
void |
encodeGeneralizedTime(ZonedDateTime time)
Encode an ASN.1 GeneralizedTime type.
|
void |
encodeIA5String(byte[] str)
Encode an ASN.1 IA5 string value.
|
void |
encodeIA5String(String str)
Encode an ASN.1 IA5 string value.
|
void |
encodeImplicit(int number)
Indicate that the next encode operation should encode an ASN.1 value using
the given implicit, context-specific tag.
|
void |
encodeImplicit(int clazz,
int number)
Indicate that the next encode operation should encode an ASN.1 value using
the given implicit tag.
|
void |
encodeInteger(BigInteger integer)
Encode an ASN.1
integer value. |
default void |
encodeInteger(int integer)
Encode an ASN.1
integer value. |
void |
encodeNull()
Encode an ASN.1 null value.
|
void |
encodeObjectIdentifier(String objectIdentifier)
Encode an ASN.1 object identifier value.
|
void |
encodeOctetString(byte[] str)
Encode an ASN.1 octet string value.
|
void |
encodeOctetString(String str)
Encode an ASN.1 octet string value.
|
void |
encodePrintableString(byte[] str)
Encode an ASN.1 printable string value.
|
void |
encodePrintableString(String str)
Encode an ASN.1 printable string value.
|
void |
encodeUniversalString(String str)
Encode an ASN.1 UniversalString string value.
|
void |
encodeUTF8String(String str)
Encode an ASN.1 UTF8String string value.
|
void |
endExplicit()
Finish encoding an ASN.1 explicitly tagged element.
|
void |
endSequence()
Finish encoding an ASN.1 sequence.
|
void |
endSet()
Finish encoding an ASN.1 set.
|
void |
endSetOf()
Finish encoding an ASN.1 "set of" element.
|
void |
flush()
Flush the encoder, writing any saved ASN.1 encoded values to the target destination.
|
byte[] |
getEncoded()
Get the ASN.1 encoded bytes.
|
void |
startExplicit(int number)
Start encoding an ASN.1 explicitly tagged element.
|
void |
startExplicit(int clazz,
int number)
Start encoding an ASN.1 explicitly tagged element.
|
void |
startSequence()
Start encoding an ASN.1 sequence.
|
void |
startSet()
Start encoding an ASN.1 set.
|
void |
startSetOf()
Start encoding an ASN.1 "set of" element.
|
void |
writeEncoded(byte[] encoded)
Write an already encoded ASN.1 value to the target destination.
|
void startSequence()
endSequence()
is called.void endSequence() throws IllegalStateException
IllegalStateException
- if there is no sequence to endvoid startSet()
endSet()
is called.void endSet() throws IllegalStateException
IllegalStateException
- if there is no set to endvoid startSetOf()
endSetOf()
is called.void endSetOf() throws IllegalStateException
IllegalStateException
- if there is no set to endvoid startExplicit(int number)
endExplicit()
is called.number
- the tag number for the explicit, context-specific tagvoid startExplicit(int clazz, int number)
endExplicit()
is called.clazz
- the class for the explicit tagnumber
- the tag number for the explicit tagvoid endExplicit() throws IllegalStateException
IllegalStateException
- if there is no explicitly tagged element to endvoid encodeOctetString(String str)
str
- the octet string to encodevoid encodeOctetString(byte[] str)
str
- the byte array containing the octet string to encodevoid encodeIA5String(String str)
str
- the IA5 string to encodevoid encodeIA5String(byte[] str)
str
- the byte array containing IA5 string to encodevoid encodePrintableString(byte[] str)
str
- the byte array containing the printable string to encodevoid encodePrintableString(String str)
str
- the printable string to encodevoid encodeUTF8String(String str)
str
- the string to encodevoid encodeBMPString(String str)
str
- the string to encodevoid encodeUniversalString(String str)
str
- the string to encodevoid encodeBitString(byte[] str)
str
- the byte array containing the bit string to encode (all bits in the bit string will be used)void encodeBitString(byte[] str, int numUnusedBits)
str
- the byte array containing the bit string to encodenumUnusedBits
- the number of unused bits in the byte arrayvoid encodeBitString(EnumSet<?> enumSet)
enumSet
- the enum set (must not be null
)void encodeBitString(BitSet bitSet)
bitSet
- the bit set (must not be null
)void encodeBitString(String binaryStr)
binaryStr
- the bit string to encode, as a binary stringvoid encodeBitString(BigInteger integer)
integer
.integer
- the integer to encode as a binary stringvoid encodeGeneralizedTime(ZonedDateTime time)
time
- the time to encode (must not be null
)void encodeObjectIdentifier(String objectIdentifier) throws ASN1Exception
objectIdentifier
- the object identifier to encodeASN1Exception
- if the given object identifier is invalidvoid encodeNull()
void encodeImplicit(int number)
number
- the tag number for the implicit, context-specific tagvoid encodeImplicit(int clazz, int number)
clazz
- the class for the implicit tagnumber
- the tag number for the implicit tagvoid encodeBoolean(boolean value)
boolean
value.value
- the boolean to encodedefault void encodeInteger(int integer)
integer
value.integer
- the integer to encodevoid encodeInteger(BigInteger integer)
integer
value.integer
- the integer to encodevoid writeEncoded(byte[] encoded)
encoded
- the encoded ASN.1 value to writevoid flush()
byte[] getEncoded()
Copyright © 2021 JBoss by Red Hat. All rights reserved.