Package org.pgpainless.util
Class ArmoredOutputStreamFactory
- java.lang.Object
-
- org.pgpainless.util.ArmoredOutputStreamFactory
-
public final class ArmoredOutputStreamFactory extends java.lang.Object
Factory to create configuredArmoredOutputStreams
. The configuration entails setting custom version and comment headers.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PGPAINLESS
Name of the program.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.bouncycastle.bcpg.ArmoredOutputStream
get(java.io.OutputStream outputStream)
Wrap anOutputStream
inside a preconfiguredArmoredOutputStream
.static org.bouncycastle.bcpg.ArmoredOutputStream
get(java.io.OutputStream outputStream, ProducerOptions options)
Return an instance of theArmoredOutputStream
which might have pre-populated armor headers.static void
resetComment()
Reset to the default of no comment headers.static void
resetVersionInfo()
Reset the version header to its default value ofPGPAINLESS
.static void
setComment(java.lang.String commentString)
Set a comment header value in the ASCII armor header.static void
setVersionInfo(java.lang.String versionString)
Overwrite the version header of ASCII armors with a custom value.
-
-
-
Field Detail
-
PGPAINLESS
public static final java.lang.String PGPAINLESS
Name of the program.- See Also:
- Constant Field Values
-
-
Method Detail
-
get
@Nonnull public static org.bouncycastle.bcpg.ArmoredOutputStream get(@Nonnull java.io.OutputStream outputStream)
Wrap anOutputStream
inside a preconfiguredArmoredOutputStream
.- Parameters:
outputStream
- inner stream- Returns:
- armored output stream
-
get
@Nonnull public static org.bouncycastle.bcpg.ArmoredOutputStream get(@Nonnull java.io.OutputStream outputStream, @Nonnull ProducerOptions options)
Return an instance of theArmoredOutputStream
which might have pre-populated armor headers.- Parameters:
outputStream
- output streamoptions
- options- Returns:
- armored output stream
-
setVersionInfo
public static void setVersionInfo(@Nullable java.lang.String versionString)
Overwrite the version header of ASCII armors with a custom value. Newlines in the version info string result in multiple version header entries. If this is set tonull
, then the version header is omitted altogether.- Parameters:
versionString
- version string
-
resetVersionInfo
public static void resetVersionInfo()
Reset the version header to its default value ofPGPAINLESS
.
-
setComment
public static void setComment(@Nullable java.lang.String commentString)
Set a comment header value in the ASCII armor header. If the comment contains newlines, it will be split into multiple header entries.- Parameters:
commentString
- comment- See Also:
for how to set comments for individual messages.
-
resetComment
public static void resetComment()
Reset to the default of no comment headers.
-
-