Class ArmoredOutputStream.Builder

java.lang.Object
org.bouncycastle.bcpg.ArmoredOutputStream.Builder
Enclosing class:
ArmoredOutputStream

public static class ArmoredOutputStream.Builder extends Object
  • Method Details

    • build

      public ArmoredOutputStream build(OutputStream outputStream)
    • setVersion

      public ArmoredOutputStream.Builder setVersion(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(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(String messageId)
      Replace the
      MessageID:
      header field with the given messageId.
      Parameters:
      messageId - message ID
      Returns:
      builder
    • setCharset

      public ArmoredOutputStream.Builder setCharset(String charset)
      Replace the
      Charset:
      header with the given value.
      Parameters:
      charset - charset
      Returns:
      builder
    • addComment

      public ArmoredOutputStream.Builder addComment(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.