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 additional Comment:ArmoredOutputStream
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 the Charset:ArmoredOutputStream.Builder
setComment(java.lang.String comment)
Replace the Comment:ArmoredOutputStream.Builder
setMessageId(java.lang.String messageId)
Replace the MessageID:ArmoredOutputStream.Builder
setVersion(java.lang.String version)
Set a Version:
-
-
-
Method Detail
-
build
public ArmoredOutputStream build(java.io.OutputStream outputStream)
-
setVersion
public ArmoredOutputStream.Builder setVersion(java.lang.String version)
Set a Version: 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 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.- Parameters:
comment
- comment- Returns:
- builder
-
setMessageId
public ArmoredOutputStream.Builder setMessageId(java.lang.String messageId)
Replace the MessageID: header field with the given messageId.- Parameters:
messageId
- message ID- Returns:
- builder
-
setCharset
public ArmoredOutputStream.Builder setCharset(java.lang.String charset)
Replace the Charset: 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 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.- 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.
-
-