
public class DEREncoder extends Object implements ASN1Encoder
| Constructor and Description |
|---|
DEREncoder()
Create a DER encoder.
|
| 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. |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitencodeIntegerpublic void startSequence()
ASN1EncoderASN1Encoder.endSequence() is called.startSequence in interface ASN1Encoderpublic void startSet()
ASN1EncoderASN1Encoder.endSet() is called.startSet in interface ASN1Encoderpublic void startSetOf()
ASN1EncoderASN1Encoder.endSetOf() is called.startSetOf in interface ASN1Encoderpublic void startExplicit(int number)
ASN1EncoderASN1Encoder.endExplicit() is called.startExplicit in interface ASN1Encodernumber - the tag number for the explicit, context-specific tagpublic void startExplicit(int clazz,
int number)
ASN1EncoderASN1Encoder.endExplicit() is called.startExplicit in interface ASN1Encoderclazz - the class for the explicit tagnumber - the tag number for the explicit tagpublic void endSequence()
throws IllegalStateException
ASN1EncoderendSequence in interface ASN1EncoderIllegalStateException - if there is no sequence to endpublic void endExplicit()
throws IllegalStateException
ASN1EncoderendExplicit in interface ASN1EncoderIllegalStateException - if there is no explicitly tagged element to endpublic void endSet()
throws IllegalStateException
ASN1EncoderendSet in interface ASN1EncoderIllegalStateException - if there is no set to endpublic void endSetOf()
throws IllegalStateException
ASN1EncoderendSetOf in interface ASN1EncoderIllegalStateException - if there is no set to endpublic void encodeOctetString(String str)
ASN1EncoderencodeOctetString in interface ASN1Encoderstr - the octet string to encodepublic void encodeOctetString(byte[] str)
ASN1EncoderencodeOctetString in interface ASN1Encoderstr - the byte array containing the octet string to encodepublic void encodeIA5String(String str)
ASN1EncoderencodeIA5String in interface ASN1Encoderstr - the IA5 string to encodepublic void encodeIA5String(byte[] str)
ASN1EncoderencodeIA5String in interface ASN1Encoderstr - the byte array containing IA5 string to encodepublic void encodePrintableString(byte[] str)
ASN1EncoderencodePrintableString in interface ASN1Encoderstr - the byte array containing the printable string to encodepublic void encodePrintableString(String str)
ASN1EncoderencodePrintableString in interface ASN1Encoderstr - the printable string to encodepublic void encodeUTF8String(String str)
ASN1EncoderencodeUTF8String in interface ASN1Encoderstr - the string to encodepublic void encodeBMPString(String str)
ASN1EncoderencodeBMPString in interface ASN1Encoderstr - the string to encodepublic void encodeUniversalString(String str)
ASN1EncoderencodeUniversalString in interface ASN1Encoderstr - the string to encodepublic void encodeBitString(byte[] str)
ASN1EncoderencodeBitString in interface ASN1Encoderstr - the byte array containing the bit string to encode (all bits in the bit string will be used)public void encodeBitString(byte[] str,
int numUnusedBits)
ASN1EncoderencodeBitString in interface ASN1Encoderstr - the byte array containing the bit string to encodenumUnusedBits - the number of unused bits in the byte arraypublic void encodeBitString(EnumSet<?> enumSet)
ASN1EncoderencodeBitString in interface ASN1EncoderenumSet - the enum set (must not be null)public void encodeBitString(BitSet bitSet)
ASN1EncoderencodeBitString in interface ASN1EncoderbitSet - the bit set (must not be null)public void encodeBitString(String binaryStr)
ASN1EncoderencodeBitString in interface ASN1EncoderbinaryStr - the bit string to encode, as a binary stringpublic void encodeBitString(BigInteger integer)
ASN1Encoderinteger.encodeBitString in interface ASN1Encoderinteger - the integer to encode as a binary stringpublic void encodeGeneralizedTime(ZonedDateTime time)
ASN1EncoderencodeGeneralizedTime in interface ASN1Encodertime - the time to encode (must not be null)public void encodeObjectIdentifier(String objectIdentifier) throws ASN1Exception
ASN1EncoderencodeObjectIdentifier in interface ASN1EncoderobjectIdentifier - the object identifier to encodeASN1Exception - if the given object identifier is invalidpublic void encodeNull()
ASN1EncoderencodeNull in interface ASN1Encoderpublic void encodeImplicit(int number)
ASN1EncoderencodeImplicit in interface ASN1Encodernumber - the tag number for the implicit, context-specific tagpublic void encodeImplicit(int clazz,
int number)
ASN1EncoderencodeImplicit in interface ASN1Encoderclazz - the class for the implicit tagnumber - the tag number for the implicit tagpublic void encodeBoolean(boolean value)
ASN1Encoderboolean value.encodeBoolean in interface ASN1Encodervalue - the boolean to encodepublic void encodeInteger(BigInteger integer)
ASN1Encoderinteger value.encodeInteger in interface ASN1Encoderinteger - the integer to encodepublic void writeEncoded(byte[] encoded)
ASN1EncoderwriteEncoded in interface ASN1Encoderencoded - the encoded ASN.1 value to writepublic void flush()
ASN1Encoderflush in interface Flushableflush in interface ASN1Encoderpublic byte[] getEncoded()
ASN1EncodergetEncoded in interface ASN1EncoderCopyright © 2020 JBoss by Red Hat. All rights reserved.