Top Description Methods
org.bouncycastle.openpgp.operator

public Interface PublicKeyDataDecryptorFactory

extends PGPDataDecryptorFactory
Known Direct Implementers
org.bouncycastle.openpgp.operator.AbstractPublicKeyDataDecryptorFactory
Imports
org.bouncycastle.bcpg.InputStreamPacket, .PublicKeyEncSessionPacket, org.bouncycastle.openpgp.PGPException

Factory for public-key based PGPDataDecryptors. The purpose of this class is to act as an abstract factory, whose subclasses can decide, which concrete implementation to use to decrypt OpenPGP messages that were encrypted to a public-key.

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

decrypted session info
recoverSessionData
(PublicKeyEncSessionPacket
public-key encrypted session-key packet
pkesk
,
InputStreamPacket
encrypted data (sed/seipd/oed) packet
encData
)

Recover the plain session info by decrypting the encrypted session key.

public byte[]

Returns:

decrypted session info
recoverSessionData
(int
public key algorithm
keyAlgorithm
,
byte[][]
encrypted session key data
secKeyData
)

Recover the plain session info by decrypting the encrypted session key.

public byte[]

Returns:

decrypted session info
recoverSessionData
(int
public key algorithm
keyAlgorithm
,
byte[][]
encrypted session key data
secKeyData
,
int
version of the PKESK packet
pkeskVersion
)

Recover the plain session info by decrypting the encrypted session key.

Inherited from org.bouncycastle.openpgp.operator.PGPDataDecryptorFactory:
createDataDecryptorcreateDataDecryptorcreateDataDecryptor

Method Detail

recoverSessionDataback to summary
public byte[] recoverSessionData(PublicKeyEncSessionPacket pkesk, InputStreamPacket encData) throws PGPException

Recover the plain session info by decrypting the encrypted session key. The session info ALWAYS has the symmetric algorithm ID prefixed, so the return value is:

[sym-alg][session-key][checksum]?
Parameters
pkesk:PublicKeyEncSessionPacket

public-key encrypted session-key packet

encData:InputStreamPacket

encrypted data (sed/seipd/oed) packet

Returns:byte[]

decrypted session info

recoverSessionDataback to summary
public byte[] recoverSessionData(int keyAlgorithm, byte[][] secKeyData) throws PGPException

Recover the plain session info by decrypting the encrypted session key. This method returns the decrypted session info as-is (without prefixing missing cipher algorithm), so the return value is:

[sym-alg]?[session-key][checksum]?
Parameters
keyAlgorithm:int

public key algorithm

secKeyData:byte[][]

encrypted session key data

Returns:byte[]

decrypted session info

recoverSessionDataback to summary
public byte[] recoverSessionData(int keyAlgorithm, byte[][] secKeyData, int pkeskVersion) throws PGPException

Recover the plain session info by decrypting the encrypted session key. This method returns the decrypted session info as-is (without prefixing missing cipher algorithm), so the return value is:

[sym-alg]?[session-key][checksum]?
Parameters
keyAlgorithm:int

public key algorithm

secKeyData:byte[][]

encrypted session key data

pkeskVersion:int

version of the PKESK packet

Returns:byte[]

decrypted session info