public static final class Pem.Encryption.Builder extends Object
Build Pem.Encryption instances
| Modifier and Type | Method and Description |
|---|---|
Pem.Encryption.Builder |
blockMode(String blockMode)
The block mode, defaults to
CBC |
Pem.Encryption |
build()
Build the
Pem.Encryption instance. |
Pem.Encryption.Builder |
entropy(SecureRandom entropy)
Configure the entropy source to use for generating an initialization vector, if none
explicitly specified
|
Pem.Encryption.Builder |
iv(byte[] iv)
The initialization vector
|
Pem.Encryption.Builder |
keySize(int keySize)
The encryption key-size in bits, defaults to 128
|
Pem.Encryption.Builder |
ownsPassphrase(boolean ownsPassphrase)
Indicate if this instance owns the passphrase (and therefore must close/erase it,
when this instance is closed)
|
Pem.Encryption.Builder |
passphrase(char[] passphrase)
Configure the passphrase from a character array.
|
Pem.Encryption.Builder |
passphrase(Pem.Passphrase passphrase)
The pass phrase
|
public Pem.Encryption.Builder keySize(int keySize)
The encryption key-size in bits, defaults to 128
keySize - The key size in bitspublic Pem.Encryption.Builder entropy(SecureRandom entropy)
Configure the entropy source to use for generating an initialization vector, if none explicitly specified
entropy - The source of random bytespublic Pem.Encryption.Builder iv(byte[] iv)
The initialization vector
iv - The initialization vectorpublic Pem.Encryption.Builder blockMode(String blockMode)
The block mode, defaults to CBC
blockMode - The block modepublic Pem.Encryption.Builder passphrase(Pem.Passphrase passphrase)
The pass phrase
passphrase - The passphrasepublic Pem.Encryption.Builder ownsPassphrase(boolean ownsPassphrase)
Indicate if this instance owns the passphrase (and therefore must close/erase it, when this instance is closed)
ownsPassphrase - If true the instance will own the passphrasepublic Pem.Encryption.Builder passphrase(char[] passphrase)
Configure the passphrase from a character array. The passphrase will be erased when
the Pem.Encryption instance is closed
passphrase - The pass phrasepublic Pem.Encryption build()
Build the Pem.Encryption instance. If an initialization vector has not been
configured, then a random one is automatically generated
Copyright © 2016–2024. All rights reserved.