Package org.bouncycastle.bcpg
Class ArmoredOutputStream.Builder
- java.lang.Object
-
- org.bouncycastle.bcpg.ArmoredOutputStream.Builder
-
- Enclosing class:
- ArmoredOutputStream
public static class ArmoredOutputStream.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArmoredOutputStream.Builder
addComment(java.lang.String comment)
Add the given value as one or more additionalArmoredOutputStream
build(java.io.OutputStream outputStream)
ArmoredOutputStream.Builder
clearHeaders()
ArmoredOutputStream.Builder
enableCRC(boolean doComputeCRC)
Enable calculation and inclusion of the CRC check sum (default is true).ArmoredOutputStream.Builder
setCharset(java.lang.String charset)
Replace theArmoredOutputStream.Builder
setComment(java.lang.String comment)
Replace theArmoredOutputStream.Builder
setMessageId(java.lang.String messageId)
Replace theArmoredOutputStream.Builder
setVersion(java.lang.String version)
Set a
-
-
-
Method Detail
-
build
public ArmoredOutputStream build(java.io.OutputStream outputStream)
-
setVersion
public ArmoredOutputStream.Builder setVersion(java.lang.String version)
Set aVersion:
header. Note: Adding version headers to ASCII armored output is discouraged to minimize metadata.- Parameters:
version
- version- Returns:
- builder
-
setComment
public ArmoredOutputStream.Builder setComment(java.lang.String comment)
Replace theComment:
header field with the given comment. If the comment contains newlines, multiple headers will be added, one for each newline. If the comment isnull
, then the output will contain no comments.- Parameters:
comment
- comment- Returns:
- builder
-
setMessageId
public ArmoredOutputStream.Builder setMessageId(java.lang.String messageId)
Replace theMessageID:
header field with the given messageId.- Parameters:
messageId
- message ID- Returns:
- builder
-
setCharset
public ArmoredOutputStream.Builder setCharset(java.lang.String charset)
Replace theCharset:
header with the given value.- Parameters:
charset
- charset- Returns:
- builder
-
addComment
public ArmoredOutputStream.Builder addComment(java.lang.String comment)
Add the given value as one or more additionalComment:
headers to the already present comments. If the comment contains newlines, multiple headers will be added, one for each newline. If the comment isnull
, this method does nothing.- Parameters:
comment
- comment- Returns:
- builder
-
clearHeaders
public ArmoredOutputStream.Builder clearHeaders()
-
enableCRC
public ArmoredOutputStream.Builder enableCRC(boolean doComputeCRC)
Enable calculation and inclusion of the CRC check sum (default is true).- Parameters:
doComputeCRC
- true if CRC to be included, false otherwise.- Returns:
- the current builder instance.
-
-