Package org.pgpainless.util
Class ArmoredOutputStreamFactory
java.lang.Object
org.pgpainless.util.ArmoredOutputStreamFactory
Factory to create configured
ArmoredOutputStreams.
The configuration entails setting custom version and comment headers.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bouncycastle.bcpg.ArmoredOutputStreamget(OutputStream outputStream) Wrap anOutputStreaminside a preconfiguredArmoredOutputStream.static org.bouncycastle.bcpg.ArmoredOutputStreamget(OutputStream outputStream, ProducerOptions options) Return an instance of theArmoredOutputStreamwhich might have pre-populated armor headers.static voidReset to the default of no comment headers.static voidReset the version header to its default value ofPGPAINLESS.static voidsetComment(String commentString) Set a comment header value in the ASCII armor header.static voidsetVersionInfo(String versionString) Overwrite the version header of ASCII armors with a custom value.
-
Field Details
-
PGPAINLESS
Name of the program.- See Also:
-
-
Method Details
-
get
@Nonnull public static org.bouncycastle.bcpg.ArmoredOutputStream get(@Nonnull OutputStream outputStream) Wrap anOutputStreaminside a preconfiguredArmoredOutputStream.- Parameters:
outputStream- inner stream- Returns:
- armored output stream
-
get
@Nonnull public static org.bouncycastle.bcpg.ArmoredOutputStream get(@Nonnull OutputStream outputStream, @Nonnull ProducerOptions options) Return an instance of theArmoredOutputStreamwhich might have pre-populated armor headers.- Parameters:
outputStream- output streamoptions- options- Returns:
- armored output stream
-
setVersionInfo
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
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:
-
resetComment
public static void resetComment()Reset to the default of no comment headers.
-