|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.OutputStream | +--java.io.ByteArrayOutputStream | +--com.ibm.security12.sun.security.util.DerOutputStream
Output stream marshaling DER-encoded data. This is eventually provided in the form of a byte array; there is no advance limit on the size of that byte array.
At this time, this class supports only a subset of the types of DER data encodings which are defined. That subset is sufficient for generating most X.509 certificates.
Fields inherited from class java.io.ByteArrayOutputStream |
buf,
count |
Constructor Summary | |
DerOutputStream()
Construct an DER output stream. |
|
DerOutputStream(int size)
Construct an DER output stream. |
Method Summary | |
void |
derEncode(OutputStream out)
Write the current contents of this DerOutputStream
to an OutputStream . |
void |
putBitString(byte[] bits)
Marshals a DER bit string on the output stream. |
void |
putBoolean(boolean val)
Marshals a DER boolean on the output stream. |
void |
putDerValue(DerValue val)
Marshals pre-encoded DER value onto the output stream. |
void |
putEnumerated(BigInt i)
Marshals a DER enumerated on the output stream. |
void |
putGeneralizedTime(Date d)
Marshals a DER Generalized Time/date value. |
void |
putIA5String(String s)
Marshals a string which is consists of IA5(ASCII) characters |
void |
putInteger(BigInt i)
Marshals a DER unsigned integer on the output stream. |
void |
putLength(int len)
Put the encoding of the length in the stream. |
void |
putNull()
Marshals a DER "null" value on the output stream. |
void |
putOctetString(byte[] octets)
DER-encodes an ASN.1 OCTET STRING value on the output stream. |
void |
putOID(ObjectIdentifier oid)
Marshals an object identifier (OID) on the output stream. |
void |
putOrderedSet(byte tag,
DerEncoder[] set)
Marshals the contents of a set on the output stream. |
void |
putOrderedSetOf(byte tag,
DerEncoder[] set)
Marshals the contents of a set on the output stream. |
void |
putPrintableString(String s)
XXX what character set is this? |
void |
putSequence(DerValue[] seq)
Marshals a sequence on the output stream. |
void |
putSet(DerValue[] set)
Marshals the contents of a set on the output stream without ordering the elements. |
void |
putTag(byte tagClass,
boolean form,
byte val)
Put the tag of the attribute in the stream. |
void |
putUnalignedBitString(BitArray ba)
Marshals a DER bit string on the output stream. |
void |
putUTCTime(Date d)
Marshals a DER UTC time/date value. |
void |
write(byte tag,
byte[] buf)
Writes tagged, pre-marshaled data. |
void |
write(byte tag,
DerOutputStream out)
Writes tagged data using buffer-to-buffer copy. |
void |
writeImplicit(byte tag,
DerOutputStream value)
Writes implicitly tagged data using buffer-to-buffer copy. |
Methods inherited from class java.io.ByteArrayOutputStream |
close,
reset,
size,
toByteArray,
toString,
toString,
toString,
write,
write,
writeTo |
Methods inherited from class java.io.OutputStream |
flush,
write |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public DerOutputStream(int size)
size
- how large a buffer to preallocate.public DerOutputStream()
Method Detail |
public void write(byte tag, byte[] buf) throws IOException
tag
- the DER value tag for the data, such as
DerValue.tag_Sequencebuf
- buffered data, which must be DER-encodedpublic void write(byte tag, DerOutputStream out) throws IOException
tag
- the DER value tag for the data, such as
DerValue.tag_Sequenceout
- buffered datapublic void writeImplicit(byte tag, DerOutputStream value) throws IOException
tag
- the DER value of the context-specific tag that replaces
original tag of the value in the output, such as in
For example, FooLength [1] IMPLICIT INTEGER, with value=4; would be encoded as "81 01 04" whereas in explicit tagging it would be encoded as "A1 03 02 01 04". Notice that the tag is A1 and not 81, this is because with explicit tagging the form is always constructed.[N] IMPLICIT
value
- original value being implicitly taggedpublic void putDerValue(DerValue val) throws IOException
public void putBoolean(boolean val) throws IOException
public void putInteger(BigInt i) throws IOException
public void putEnumerated(BigInt i) throws IOException
public void putBitString(byte[] bits) throws IOException
bits
- the bit string, MSB firstpublic void putUnalignedBitString(BitArray ba) throws IOException
bits
- the bit string, MSB firstpublic void putOctetString(byte[] octets) throws IOException
octets
- the octet stringpublic void putNull() throws IOException
public void putOID(ObjectIdentifier oid) throws IOException
public void putSequence(DerValue[] seq) throws IOException
public void putSet(DerValue[] set) throws IOException
public void putOrderedSetOf(byte tag, DerEncoder[] set) throws IOException
public void putOrderedSet(byte tag, DerEncoder[] set) throws IOException
public void putPrintableString(String s) throws IOException
public void putIA5String(String s) throws IOException
public void putUTCTime(Date d) throws IOException
YYMMDDhhmmss{Z|+hhmm|-hhmm} ... emits only using Zulu time and with seconds (even if seconds=0) as per IETF-PKIX partI.
public void putGeneralizedTime(Date d) throws IOException
YYYYMMDDhhmmss{Z|+hhmm|-hhmm} ... emits only using Zulu time and with seconds (even if seconds=0) as per IETF-PKIX partI.
public void putLength(int len) throws IOException
public void putTag(byte tagClass, boolean form, byte val)
public void derEncode(OutputStream out) throws IOException
DerOutputStream
to an OutputStream
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |