public abstract class PBESecretKeyEncryptor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
encAlgorithm |
protected char[] |
passPhrase |
protected java.security.SecureRandom |
random |
protected S2K |
s2k |
protected int |
s2kCount |
protected PGPDigestCalculator |
s2kDigestCalculator |
Modifier | Constructor and Description |
---|---|
protected |
PBESecretKeyEncryptor(int encAlgorithm,
PGPDigestCalculator s2kDigestCalculator,
int s2kCount,
java.security.SecureRandom random,
char[] passPhrase) |
protected |
PBESecretKeyEncryptor(int encAlgorithm,
PGPDigestCalculator s2kDigestCalculator,
java.security.SecureRandom random,
char[] passPhrase) |
Modifier and Type | Method and Description |
---|---|
byte[] |
encryptKeyData(byte[] key,
byte[] iv,
byte[] keyData,
int keyOff,
int keyLen)
Encrypt the passed in keyData using the key and the iv provided.
|
abstract byte[] |
encryptKeyData(byte[] key,
byte[] keyData,
int keyOff,
int keyLen) |
byte[] |
encryptKeyData(byte[] keyData,
int keyOff,
int keyLen)
Key encryption method invoked for V4 keys and greater.
|
int |
getAlgorithm() |
abstract byte[] |
getCipherIV() |
int |
getHashAlgorithm() |
byte[] |
getKey() |
S2K |
getS2K() |
protected int encAlgorithm
protected char[] passPhrase
protected PGPDigestCalculator s2kDigestCalculator
protected int s2kCount
protected S2K s2k
protected java.security.SecureRandom random
protected PBESecretKeyEncryptor(int encAlgorithm, PGPDigestCalculator s2kDigestCalculator, java.security.SecureRandom random, char[] passPhrase)
protected PBESecretKeyEncryptor(int encAlgorithm, PGPDigestCalculator s2kDigestCalculator, int s2kCount, java.security.SecureRandom random, char[] passPhrase)
public int getAlgorithm()
public int getHashAlgorithm()
public byte[] getKey() throws PGPException
PGPException
public S2K getS2K()
public byte[] encryptKeyData(byte[] keyData, int keyOff, int keyLen) throws PGPException
keyData
- raw key datakeyOff
- offset into raw key datakeyLen
- length of key data to use.PGPException
- on error in the underlying encryption process.public abstract byte[] encryptKeyData(byte[] key, byte[] keyData, int keyOff, int keyLen) throws PGPException
PGPException
public byte[] encryptKeyData(byte[] key, byte[] iv, byte[] keyData, int keyOff, int keyLen) throws PGPException
This method is only used for processing version 3 keys.
PGPException
public abstract byte[] getCipherIV()