java.lang.Object | |||
↳ | java.io.OutputStream | ||
↳ | java.io.ByteArrayOutputStream | ||
↳ | 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.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Construct an DER output stream.
| |||||||||||
Construct an DER output stream.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Write the current contents of this
DerOutputStream
to an OutputStream . | |||||||||||
Marshals a string as a DER encoded BMPString.
| |||||||||||
Marshals a DER bit string on the output stream.
| |||||||||||
Marshals a DER boolean on the output stream.
| |||||||||||
Marshals pre-encoded DER value onto the output stream.
| |||||||||||
Marshals a DER enumerated on the output stream.
| |||||||||||
Marshals a string as a DER encoded GeneralString.
| |||||||||||
Marshals a DER Generalized Time/date value.
| |||||||||||
Marshals a string as a DER encoded IA5String.
| |||||||||||
Marshals a DER integer on the output stream.
| |||||||||||
Marshals a DER integer on the output stream.
| |||||||||||
Marshals a DER integer on the output stream.
| |||||||||||
Put the encoding of the length in the stream.
| |||||||||||
Marshals a DER "null" value on the output stream.
| |||||||||||
Marshals an object identifier (OID) on the output stream.
| |||||||||||
DER-encodes an ASN.1 OCTET STRING value on the output stream.
| |||||||||||
Marshals the contents of a set on the output stream.
| |||||||||||
Marshals the contents of a set on the output stream.
| |||||||||||
Marshals a string as a DER encoded PrintableString.
| |||||||||||
Marshals a sequence on the output stream.
| |||||||||||
Marshals the contents of a set on the output stream without
ordering the elements.
| |||||||||||
Marshals a string as a DER encoded T61String.
| |||||||||||
Put the tag of the attribute in the stream.
| |||||||||||
Marshals a truncated DER bit string on the output stream.
| |||||||||||
Marshals a DER UTC time/date value.
| |||||||||||
Marshals a string as a DER encoded UTF8String.
| |||||||||||
Marshals a DER bit string on the output stream.
| |||||||||||
Writes tagged data using buffer-to-buffer copy.
| |||||||||||
Writes tagged, pre-marshaled data.
| |||||||||||
Writes implicitly tagged data using buffer-to-buffer copy.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() | |||||||||||
![]() |
Construct an DER output stream.
size | how large a buffer to preallocate. |
---|
Construct an DER output stream.
Write the current contents of this DerOutputStream
to an OutputStream
.
out | the stream on which the DER encoding is written. |
---|
IOException | on output error. |
---|
Marshals a string as a DER encoded BMPString.
IOException |
---|
Marshals a DER bit string on the output stream. The bit string must be byte-aligned.
bits | the bit string, MSB first |
---|
IOException |
---|
Marshals a DER boolean on the output stream.
IOException |
---|
Marshals pre-encoded DER value onto the output stream.
IOException |
---|
Marshals a DER enumerated on the output stream.
i | the enumerated value. |
---|
IOException |
---|
Marshals a string as a DER encoded GeneralString.
IOException |
---|
Marshals a DER Generalized Time/date value.
YYYYMMDDhhmmss{Z|+hhmm|-hhmm} ... emits only using Zulu time and with seconds (even if seconds=0) as per RFC 3280.
IOException |
---|
Marshals a string as a DER encoded IA5String.
IOException |
---|
Marshals a DER integer on the output stream.
i | the integer in the form of an Integer. |
---|
IOException |
---|
Marshals a DER integer on the output stream.
i | the integer in the form of a BigInteger. |
---|
IOException |
---|
Put the encoding of the length in the stream.
IOException | on writing errors. |
---|
Marshals a DER "null" value on the output stream. These are often used to indicate optional values which have been omitted.
IOException |
---|
Marshals an object identifier (OID) on the output stream. Corresponds to the ASN.1 "OBJECT IDENTIFIER" construct.
IOException |
---|
DER-encodes an ASN.1 OCTET STRING value on the output stream.
octets | the octet string |
---|
IOException |
---|
Marshals the contents of a set on the output stream. Sets are semantically unordered, but DER requires that encodings of set elements be sorted into ascending tag order before being output. Hence sets with the same tags and elements have the same DER encoding. This method supports the ASN.1 "SET" construct, but not "SET OF", which uses a different order.
IOException |
---|
Marshals the contents of a set on the output stream. Sets are semantically unordered, but DER requires that encodings of set elements be sorted into ascending lexicographical order before being output. Hence sets with the same tags and elements have the same DER encoding. This method supports the ASN.1 "SET OF" construct, but not "SET", which uses a different order.
IOException |
---|
Marshals a string as a DER encoded PrintableString.
IOException |
---|
Marshals a sequence on the output stream. This supports both the ASN.1 "SEQUENCE" (zero to N values) and "SEQUENCE OF" (one to N values) constructs.
IOException |
---|
Marshals the contents of a set on the output stream without ordering the elements. Ok for BER encoding, but not for DER encoding. For DER encoding, use orderedPutSet() or orderedPutSetOf().
IOException |
---|
Marshals a string as a DER encoded T61String.
IOException |
---|
Put the tag of the attribute in the stream.
Marshals a truncated DER bit string on the output stream. The bit strings need not be byte-aligned.
IOException |
---|
Marshals a DER UTC time/date value.
YYMMDDhhmmss{Z|+hhmm|-hhmm} ... emits only using Zulu time and with seconds (even if seconds=0) as per RFC 3280.
IOException |
---|
Marshals a string as a DER encoded UTF8String.
IOException |
---|
Marshals a DER bit string on the output stream. The bit strings need not be byte-aligned.
IOException |
---|
Writes tagged data using buffer-to-buffer copy. As above, this writes a standard DER record. This is often used when efficiently encapsulating values in sequences.
tag | the DER value tag for the data, such as DerValue.tag_Sequence |
---|---|
out | buffered data |
IOException |
---|
Writes tagged, pre-marshaled data. This calcuates and encodes the length, so that the output data is the standard triple of { tag, length, data } used by all DER values.
tag | the DER value tag for the data, such as DerValue.tag_Sequence |
---|---|
buf | buffered data, which must be DER-encoded |
IOException |
---|
Writes implicitly tagged data using buffer-to-buffer copy. As above, this writes a standard DER record. This is often used when efficiently encapsulating implicitly tagged values.
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. |
---|---|
value | original value being implicitly tagged |
IOException |
---|