A pass phrase is used to generate an encryption key using the PGP string-to-key
method. This class always uses the salted and iterated form of the
S2K algorithm.
Note that the iteration count provided to this method is a single byte as described by the
S2K algorithm, and the actual iteration count ranges exponentially from
0x01 == 1088 to 0xFF == 65,011,712.
| Modifier and Type | Field and Description |
|---|---|
| private char[] | |
| private SecureRandom | |
| private S2K | |
| private int | |
| private PGPDigestCalculator |
| Access | Constructor and Description |
|---|---|
| protected | PBEKeyEncryptionMethodGenerator(char[]
the pass phrase to encrypt with. passPhrase, PGPDigestCalculator a digest calculator to use in the string-to-key function. s2kDigestCalculator)Construct a PBE key generator using the default iteration count ( |
| protected | PBEKeyEncryptionMethodGenerator(char[]
passphrase passPhrase, S2K.argon2 parameters paramsConstruct a PBE key generator using Argon2 as S2K mechanism. |
| protected | PBEKeyEncryptionMethodGenerator(char[]
the pass phrase to encrypt with. passPhrase, PGPDigestCalculator a digest calculator to use in the string-to-key function. s2kDigestCalculator, int a single byte s2kCount)S2K iteration count specifier, which is translated to
an actual iteration count by the S2K class.Construct a PBE key generator using a specific iteration level. |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract byte[] | |
| public ContainedPacket | generate(int
the encAlgorithm, byte[] encryption algorithm being usedsession data generated by the encrypted data generator. sessionInfo)Implements abstract org. |
| public byte[] | Returns: the bytes of the generated key.the encAlgorithm)encryption algorithm to generate
the key for.Generate a key for a symmetric encryption algorithm using the PBE configuration in this method. |
| public PBEKeyEncryptionMethodGenerator | Returns: the current generator.Sets a user defined source of randomness. |
| passPhrase | back to summary |
|---|---|
| private char[] passPhrase | |
| random | back to summary |
|---|---|
| private SecureRandom random | |
| s2k | back to summary |
|---|---|
| private S2K s2k | |
| s2kCount | back to summary |
|---|---|
| private int s2kCount | |
| s2kDigestCalculator | back to summary |
|---|---|
| private PGPDigestCalculator s2kDigestCalculator | |
| PBEKeyEncryptionMethodGenerator | back to summary |
|---|---|
| protected PBEKeyEncryptionMethodGenerator(char[] passPhrase, PGPDigestCalculator s2kDigestCalculator) Construct a PBE key generator using the default iteration count (
| |
| PBEKeyEncryptionMethodGenerator | back to summary |
|---|---|
| protected PBEKeyEncryptionMethodGenerator(char[] passPhrase, S2K. Construct a PBE key generator using Argon2 as S2K mechanism.
| |
| PBEKeyEncryptionMethodGenerator | back to summary |
|---|---|
| protected PBEKeyEncryptionMethodGenerator(char[] passPhrase, PGPDigestCalculator s2kDigestCalculator, int s2kCount) Construct a PBE key generator using a specific iteration level.
| |
| encryptSessionInfo | back to summary |
|---|---|
| protected abstract byte[] encryptSessionInfo(int encAlgorithm, byte[] key, byte[] sessionInfo) throws PGPException | |
| generate | back to summary |
|---|---|
| public ContainedPacket generate(int encAlgorithm, byte[] sessionInfo) throws PGPException Implements abstract org. Doc from org. Generates a packet encoding the details of this encryption method.
| |
| getKey | back to summary |
|---|---|
| public byte[] getKey(int encAlgorithm) throws PGPException Generate a key for a symmetric encryption algorithm using the PBE configuration in this method.
| |
| setSecureRandom | back to summary |
|---|---|
| public PBEKeyEncryptionMethodGenerator setSecureRandom(SecureRandom random) Sets a user defined source of randomness. If no SecureRandom is configured, a default SecureRandom will be used.
| |