Top Fields Constructors Methods
org.bouncycastle.openpgp.operator

public abstract Class PBESecretKeyEncryptor

extends Object
Class Inheritance
Imports
java.security.SecureRandom, org.bouncycastle.bcpg.S2K, org.bouncycastle.openpgp.PGPException

Field Summary

Modifier and TypeField and Description
protected int
protected char[]
protected SecureRandom
protected S2K
protected int
protected PGPDigestCalculator

Constructor Summary

AccessConstructor and Description
protected
PBESecretKeyEncryptor(int encAlgorithm, PGPDigestCalculator s2kDigestCalculator, SecureRandom random, char[] passPhrase)

protected
PBESecretKeyEncryptor(int encAlgorithm, PGPDigestCalculator s2kDigestCalculator, int s2kCount, SecureRandom random, char[] passPhrase)

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

an encryption of the passed in keyData.
encryptKeyData
(byte[]
raw key data
keyData
,
int
offset into raw key data
keyOff
,
int
length of key data to use.
keyLen
)

Key encryption method invoked for V4 keys and greater.

public abstract byte[]
encryptKeyData(byte[] key, byte[] keyData, int keyOff, int keyLen)

public byte[]
encryptKeyData(byte[] key, byte[] iv, byte[] keyData, int keyOff, int keyLen)

Encrypt the passed in keyData using the key and the iv provided.

public int
public abstract byte[]
public int
public byte[]
public S2K
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

encAlgorithmback to summary
protected int encAlgorithm
passPhraseback to summary
protected char[] passPhrase
randomback to summary
protected SecureRandom random
s2kback to summary
protected S2K s2k
s2kCountback to summary
protected int s2kCount
s2kDigestCalculatorback to summary
protected PGPDigestCalculator s2kDigestCalculator

Constructor Detail

PBESecretKeyEncryptorback to summary
protected PBESecretKeyEncryptor(int encAlgorithm, PGPDigestCalculator s2kDigestCalculator, SecureRandom random, char[] passPhrase)
PBESecretKeyEncryptorback to summary
protected PBESecretKeyEncryptor(int encAlgorithm, PGPDigestCalculator s2kDigestCalculator, int s2kCount, SecureRandom random, char[] passPhrase)

Method Detail

encryptKeyDataback to summary
public byte[] encryptKeyData(byte[] keyData, int keyOff, int keyLen) throws PGPException

Key encryption method invoked for V4 keys and greater.

Parameters
keyData:byte[]

raw key data

keyOff:int

offset into raw key data

keyLen:int

length of key data to use.

Returns:byte[]

an encryption of the passed in keyData.

Exceptions
PGPException:
on error in the underlying encryption process.
encryptKeyDataback to summary
public abstract byte[] encryptKeyData(byte[] key, byte[] keyData, int keyOff, int keyLen) throws PGPException
encryptKeyDataback to summary
public byte[] encryptKeyData(byte[] key, byte[] iv, byte[] keyData, int keyOff, int keyLen) throws PGPException

Encrypt the passed in keyData using the key and the iv provided.

This method is only used for processing version 3 keys.

getAlgorithmback to summary
public int getAlgorithm()
getCipherIVback to summary
public abstract byte[] getCipherIV()
getHashAlgorithmback to summary
public int getHashAlgorithm()
getKeyback to summary
public byte[] getKey() throws PGPException
getS2Kback to summary
public S2K getS2K()