com.objsys.asn1j.runtime
Class Asn1DerEncodeBuffer

java.lang.Object
  extended by com.objsys.asn1j.runtime.Asn1MessageBuffer
      extended by com.objsys.asn1j.runtime.Asn1EncodeBuffer
          extended by com.objsys.asn1j.runtime.Asn1BerEncodeBuffer
              extended by com.objsys.asn1j.runtime.Asn1DerEncodeBuffer

public class Asn1DerEncodeBuffer
extends Asn1BerEncodeBuffer

This class handles the encoding of ASN.1 messages as specified in the Distinguished Encoding Rules (DER) as specified in the ITU-T X.690 standard.


Field Summary
 
Fields inherited from class com.objsys.asn1j.runtime.Asn1EncodeBuffer
mByteIndex, mData, mSizeIncrement, SIZE_INCREMENT
 
Constructor Summary
Asn1DerEncodeBuffer()
          This constructor creates a DER encode buffer object with the default size increment.
Asn1DerEncodeBuffer(int sizeIncrement)
          This constructor creates a DER encode buffer object with the given size increment.
 
Method Summary
 boolean isBER()
          This method is used for testing encode rules type.
 int trimBitString(Asn1BitString bitstr)
          This method will trim a BIT STRING for DER encoding by removing all zero trailing bits.
 
Methods inherited from class com.objsys.asn1j.runtime.Asn1BerEncodeBuffer
binDump, binDump, checkSize, copy, copy, copy, copy, encodeIdentifier, encodeIntValue, encodeLength, encodeTag, encodeTag, encodeTagAndLength, encodeTagAndLength, getByteArrayInputStream, getInputStream, getMsgCopy, getMsgLength, reset, toString, write
 
Methods inherited from class com.objsys.asn1j.runtime.Asn1EncodeBuffer
binDump, hexDump, hexDump, initBuffer
 
Methods inherited from class com.objsys.asn1j.runtime.Asn1MessageBuffer
hexDump, hexDump, setKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Asn1DerEncodeBuffer

public Asn1DerEncodeBuffer()
This constructor creates a DER encode buffer object with the default size increment. Whenever the buffer becomes full, the buffer will be expanded by the sizeIncrement size.


Asn1DerEncodeBuffer

public Asn1DerEncodeBuffer(int sizeIncrement)
This constructor creates a DER encode buffer object with the given size increment. Whenever the buffer becomes full, the buffer will be expanded by the sizeIncrement size. This size should be large enough to prevent resizing in normal operation.

Parameters:
sizeIncrement - The initial size in bytes of an encode buffer. If the buffer becomes full, it will be expanded by the amount.
Method Detail

trimBitString

public int trimBitString(Asn1BitString bitstr)
This method will trim a BIT STRING for DER encoding by removing all zero trailing bits.

Overrides:
trimBitString in class Asn1BerEncodeBuffer
Parameters:
bitstr - ASN.1 BIT STRING object
Returns:
Adjusted bit count This method is used for testing encode rules type.

isBER

public boolean isBER()
Description copied from class: Asn1BerEncodeBuffer
This method is used for testing encode rules type.

Overrides:
isBER in class Asn1BerEncodeBuffer