pasn.encoding.cer
Class CEROutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by pasn.encoding.ASN1OutputStream
              extended by pasn.misc.encoding.TLV_OutputStream
                  extended by pasn.encoding.cer.CEROutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class CEROutputStream
extends TLV_OutputStream

Author:
ncottin

Field Summary
static java.lang.String id
           
static int PRIMITIVE_SIZE
           
 
Fields inherited from class pasn.misc.encoding.TLV_OutputStream
INDEFINITE_LENGTH_END
 
Constructor Summary
CEROutputStream()
           
CEROutputStream(java.io.OutputStream out)
           Creates a definite length CER producer
 
Method Summary
 void encode(ASN1PrimitiveOrConstructedObject asn, boolean optional)
           
 java.lang.String getIdentifier()
           
 int getMaximumPrimitiveSize()
           
 boolean isConstructedIndefiniteLength()
           
 boolean isOrdered()
           CER requires unordered structured types (SET , SET OF) components ordering
 boolean isPrimitiveIndefiniteLength()
           
 ASN1OutputStream newInstance(java.io.OutputStream out)
           
 void sort(ASN1ConstructedObject asn, java.util.LinkedList<ASN1IndexedEncodedValue> encodedValues)
           
 
Methods inherited from class pasn.misc.encoding.TLV_OutputStream
encode, encode, encode, encode, encode, isIndefiniteLength, writeTag, writeType, writeTypeOrTag
 
Methods inherited from class pasn.encoding.ASN1OutputStream
encode, encode, encode, encode, encode, getEncoder, isIdentified
 
Methods inherited from class java.io.FilterOutputStream
close, flush, write, write, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRIMITIVE_SIZE

public static final int PRIMITIVE_SIZE
See Also:
Constant Field Values

id

public static final java.lang.String id
See Also:
Constant Field Values
Constructor Detail

CEROutputStream

public CEROutputStream()

CEROutputStream

public CEROutputStream(java.io.OutputStream out)

Creates a definite length CER producer

Parameters:
out -
Method Detail

getIdentifier

public final java.lang.String getIdentifier()
Specified by:
getIdentifier in class ASN1OutputStream

isPrimitiveIndefiniteLength

public final boolean isPrimitiveIndefiniteLength()
Specified by:
isPrimitiveIndefiniteLength in class TLV_OutputStream
Returns:
False as primitive objects are always encoded in definite-length form

isConstructedIndefiniteLength

public final boolean isConstructedIndefiniteLength()
Specified by:
isConstructedIndefiniteLength in class TLV_OutputStream
Returns:
True as constructed objects are always encoded in indefinite-length form

getMaximumPrimitiveSize

public final int getMaximumPrimitiveSize()
Specified by:
getMaximumPrimitiveSize in class TLV_OutputStream

encode

public final void encode(ASN1PrimitiveOrConstructedObject asn,
                         boolean optional)
                  throws java.io.IOException,
                         ASN1EncodingException
Specified by:
encode in class ASN1OutputStream
Throws:
java.io.IOException
ASN1EncodingException

isOrdered

public final boolean isOrdered()

CER requires unordered structured types (SET , SET OF) components ordering

Specified by:
isOrdered in class TLV_OutputStream
Returns:
True

sort

public final void sort(ASN1ConstructedObject asn,
                       java.util.LinkedList<ASN1IndexedEncodedValue> encodedValues)
                throws java.io.IOException,
                       ASN1EncodingException
Specified by:
sort in class TLV_OutputStream
Throws:
java.io.IOException
ASN1EncodingException

newInstance

public ASN1OutputStream newInstance(java.io.OutputStream out)
Specified by:
newInstance in class ASN1OutputStream