Note 1: close() needs to be called on an ArmoredOutputStream to write the final checksum. flush() will not do this as other classes assume it is always fine to call flush() - it is not though if the checksum gets output. Note 2: as multiple PGP blobs are often written to the same stream, close() does not close the underlying stream.
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv byte[] | |
| pack-priv int | |
| public static final String | |
| pack-priv int | |
| pack-priv boolean | |
| public static final String | |
| pack-priv CRC24 | |
| public static final String | |
| private static final byte[] | |
| pack-priv String | |
| pack-priv String | |
| public static final String | |
| pack-priv final Hashtable | |
| pack-priv String | |
| pack-priv String | |
| pack-priv int | |
| public static final String | |
| pack-priv boolean | |
| pack-priv String | |
| pack-priv OutputStream | |
| pack-priv boolean | |
| pack-priv String | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| public | ArmoredOutputStream(OutputStream
the OutputStream to wrap. out)Constructs an armored output stream with |
| public | ArmoredOutputStream(OutputStream
the OutputStream to wrap. out, Hashtable<String, String> additional headers that add to or override the headers)default
headers.Constructs an armored output stream with default and custom headers. |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | beginClearText(int
hash algorithm hashAlgorithm)Start a clear text signed message - backwards compatibility. |
| public void | |
| public static ArmoredOutputStream. | |
| public void | |
| public void | close()
Overrides java. Implements java. Note close() does not close the underlying stream. |
| private static void | encode(OutputStream out, byte[] data, int len)
encode the input data producing a base 64 encoded byte array. |
| private static void | |
| public void | |
| public void | flush()
Overrides java. Implements java. Flushes this output stream and forces any buffered output bytes to be written out. |
| public void | resetHeaders()
Deprecated
use
Builder#clearHeaders() instead.
Reset the headers to only contain a Version string (if one is present) |
| public void | |
| public void | write(int
the b)byte.Implements abstract java. Writes the specified byte to this output stream. |
| private void | |
| private void |
| buf | back to summary |
|---|---|
| pack-priv byte[] buf | |
| bufPtr | back to summary |
|---|---|
| pack-priv int bufPtr | |
| CHARSET_HDR | back to summary |
|---|---|
| public static final String CHARSET_HDR | |
| chunkCount | back to summary |
|---|---|
| pack-priv int chunkCount | |
| clearText | back to summary |
|---|---|
| pack-priv boolean clearText | |
| COMMENT_HDR | back to summary |
|---|---|
| public static final String COMMENT_HDR | |
| crc | back to summary |
|---|---|
| pack-priv CRC24 crc | |
| DEFAULT_VERSION | back to summary |
|---|---|
| public static final String DEFAULT_VERSION | |
| encodingTable | back to summary |
|---|---|
| private static final byte[] encodingTable | |
| footerStart | back to summary |
|---|---|
| pack-priv String footerStart | |
| footerTail | back to summary |
|---|---|
| pack-priv String footerTail | |
| HASH_HDR | back to summary |
|---|---|
| public static final String HASH_HDR | |
| headers | back to summary |
|---|---|
| pack-priv final Hashtable<String, List<String>> headers | |
| headerStart | back to summary |
|---|---|
| pack-priv String headerStart | |
| headerTail | back to summary |
|---|---|
| pack-priv String headerTail | |
| lastb | back to summary |
|---|---|
| pack-priv int lastb | |
| MESSAGE_ID_HDR | back to summary |
|---|---|
| public static final String MESSAGE_ID_HDR | |
| newLine | back to summary |
|---|---|
| pack-priv boolean newLine | |
| nl | back to summary |
|---|---|
| pack-priv String nl | |
| out | back to summary |
|---|---|
| pack-priv OutputStream out | |
| start | back to summary |
|---|---|
| pack-priv boolean start | |
| type | back to summary |
|---|---|
| pack-priv String type | |
| VERSION_HDR | back to summary |
|---|---|
| public static final String VERSION_HDR | |
| ArmoredOutputStream | back to summary |
|---|---|
| public ArmoredOutputStream(OutputStream out) Constructs an armored output stream with
| |
| ArmoredOutputStream | back to summary |
|---|---|
| public ArmoredOutputStream(OutputStream out, Hashtable<String, String> headers) Constructs an armored output stream with default and custom headers.
| |
| ArmoredOutputStream | back to summary |
|---|---|
| pack-priv ArmoredOutputStream(OutputStream out, ArmoredOutputStream. | |
| addHeader | back to summary |
|---|---|
| public void addHeader(String name, String value)
Deprecated use appropriate methods in Set an additional header entry. The current value(s) will continue to exist together with the new one. Adding a null value has no effect.
| |
| beginClearText | back to summary |
|---|---|
| public void beginClearText(int hashAlgorithm) throws IOException Start a clear text signed message - backwards compatibility.
| |
| beginClearText | back to summary |
|---|---|
| public void beginClearText(int... hashAlgorithms) throws IOException Start a clear text signed message.
| |
| builder | back to summary |
|---|---|
| public static ArmoredOutputStream. | |
| clearHeaders | back to summary |
|---|---|
| public void clearHeaders()
Deprecated use appropriate methods in Remove all headers.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Note close() does not close the underlying stream. So it is possible to write multiple objects using armoring to a single stream.
| |
| encode | back to summary |
|---|---|
| private static void encode(OutputStream out, byte[] data, int len) throws IOException encode the input data producing a base 64 encoded byte array. | |
| encode3 | back to summary |
|---|---|
| private static void encode3(OutputStream out, byte[] data) throws IOException encode the input data producing a base 64 encoded byte array. | |
| endClearText | back to summary |
|---|---|
| public void endClearText() | |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Overrides java. Implements java. Doc from java. Flushes this output stream and forces any buffered output bytes
to be written out. The general contract of If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
| |
| resetHeaders | back to summary |
|---|---|
| public void resetHeaders()
Deprecated use Reset the headers to only contain a Version string (if one is present)
| |
| setHeader | back to summary |
|---|---|
| public void setHeader(String name, String value)
Deprecated use appropriate methods in Set an additional header entry. Any current value(s) under the same name will be replaced by the new one. A null value will clear the entry for name.
| |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |
| write | back to summary |
|---|---|
| private void write(String string) throws IOException | |
| writeHeaderEntry | back to summary |
|---|---|
| private void writeHeaderEntry(String name, String value) throws IOException | |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public ArmoredOutputStream. | Returns: buildercomment comment)Add the given value as one or more additional Comment: |
| private ArmoredOutputStream. | |
| public ArmoredOutputStream | |
| public ArmoredOutputStream. | |
| public ArmoredOutputStream. | Returns: the current builder instance.true if CRC to be included, false otherwise. doComputeCRC)Enable calculation and inclusion of the CRC check sum (default is true). |
| private ArmoredOutputStream. | Returns: builderkey key, String value value)Replace all header values for the given key with the given value. |
| public ArmoredOutputStream. | |
| public ArmoredOutputStream. | |
| public ArmoredOutputStream. | |
| private ArmoredOutputStream. | Returns: builderheader key key, String header value value)Set and replace the given header value with a single-line header. |
| public ArmoredOutputStream. |
| computeCRCSum | back to summary |
|---|---|
| private boolean computeCRCSum | |
| headers | back to summary |
|---|---|
| private final Map<String, List<String>> headers | |
| Builder | back to summary |
|---|---|
| private Builder() | |
| addComment | back to summary |
|---|---|
| public ArmoredOutputStream. Add the given value as one or more additional Comment:headers to the already present comments. If the comment contains newlines, multiple headers will be added, one for each newline. If the comment is null, this method does nothing.
| |
| addHeader | back to summary |
|---|---|
| private ArmoredOutputStream. Add a header, splitting it into multiple headers if required (newlines).
| |
| build | back to summary |
|---|---|
| public ArmoredOutputStream build(OutputStream outputStream) | |
| clearHeaders | back to summary |
|---|---|
| public ArmoredOutputStream. | |
| enableCRC | back to summary |
|---|---|
| public ArmoredOutputStream. Enable calculation and inclusion of the CRC check sum (default is true).
| |
| replaceHeader | back to summary |
|---|---|
| private ArmoredOutputStream. Replace all header values for the given key with the given value. If the value is null, existing headers for the given key are removed. The value is split into multiple headers if it contains newlines.
| |
| setCharset | back to summary |
|---|---|
| public ArmoredOutputStream. Replace the Charset:header with the given value.
| |
| setComment | back to summary |
|---|---|
| public ArmoredOutputStream. Replace the Comment:header field with the given comment. If the comment contains newlines, multiple headers will be added, one for each newline. If the comment is null, then the output will contain no comments.
| |
| setMessageId | back to summary |
|---|---|
| public ArmoredOutputStream. Replace the MessageID:header field with the given messageId.
| |
| setSingletonHeader | back to summary |
|---|---|
| private ArmoredOutputStream. Set and replace the given header value with a single-line header. If the value is null, this method will remove the header entirely.
| |
| setVersion | back to summary |
|---|---|
| public ArmoredOutputStream. Set a Version:header. Note Adding version headers to ASCII armored output is discouraged to minimize metadata.
| |