Bouncy Castle Cryptography Library 1.79

org.bouncycastle.openpgp.operator
Class AbstractPublicKeyDataDecryptorFactory

java.lang.Object
  |
  +--org.bouncycastle.openpgp.operator.AbstractPublicKeyDataDecryptorFactory
All Implemented Interfaces:
PGPDataDecryptorFactory, PublicKeyDataDecryptorFactory
Direct Known Subclasses:
BcPublicKeyDataDecryptorFactory

public abstract class AbstractPublicKeyDataDecryptorFactory
extends java.lang.Object
implements PublicKeyDataDecryptorFactory


Constructor Summary
AbstractPublicKeyDataDecryptorFactory()
           
 
Method Summary
protected static void checkRange(int pLen, byte[] enc)
           
protected  boolean containsSKAlg(int pkeskVersion)
           
protected  byte[] prependSKAlgorithmToSessionData(PublicKeyEncSessionPacket pkesk, InputStreamPacket encData, byte[] decryptedSessionData)
           
 byte[] recoverSessionData(int keyAlgorithm, byte[][] secKeyData)
          Recover the plain session info by decrypting the encrypted session key.
 byte[] recoverSessionData(PublicKeyEncSessionPacket pkesk, InputStreamPacket encData)
          Recover the plain session info by decrypting the encrypted session key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.bouncycastle.openpgp.operator.PublicKeyDataDecryptorFactory
recoverSessionData
 
Methods inherited from interface org.bouncycastle.openpgp.operator.PGPDataDecryptorFactory
createDataDecryptor, createDataDecryptor, createDataDecryptor
 

Constructor Detail

AbstractPublicKeyDataDecryptorFactory

public AbstractPublicKeyDataDecryptorFactory()
Method Detail

recoverSessionData

public final byte[] recoverSessionData(PublicKeyEncSessionPacket pkesk,
                                       InputStreamPacket encData)
                                throws PGPException
Description copied from interface: PublicKeyDataDecryptorFactory
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]?
Specified by:
recoverSessionData in interface PublicKeyDataDecryptorFactory
Following copied from interface: org.bouncycastle.openpgp.operator.PublicKeyDataDecryptorFactory
Parameters:
pkesk - public-key encrypted session-key packet
encData - encrypted data (sed/seipd/oed) packet
Returns:
decrypted session info
Throws:
PGPException -  

recoverSessionData

public byte[] recoverSessionData(int keyAlgorithm,
                                 byte[][] secKeyData)
                          throws PGPException
Description copied from interface: PublicKeyDataDecryptorFactory
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]?
Specified by:
recoverSessionData in interface PublicKeyDataDecryptorFactory
Following copied from interface: org.bouncycastle.openpgp.operator.PublicKeyDataDecryptorFactory
Parameters:
keyAlgorithm - public key algorithm
secKeyData - encrypted session key data
Returns:
decrypted session info
Throws:
PGPException -  

prependSKAlgorithmToSessionData

protected byte[] prependSKAlgorithmToSessionData(PublicKeyEncSessionPacket pkesk,
                                                 InputStreamPacket encData,
                                                 byte[] decryptedSessionData)
                                          throws PGPException

containsSKAlg

protected boolean containsSKAlg(int pkeskVersion)

checkRange

protected static void checkRange(int pLen,
                                 byte[] enc)
                          throws PGPException

Bouncy Castle Cryptography Library 1.79