Bouncy Castle Cryptography Library 1.79

org.bouncycastle.openpgp.operator
Class PublicKeyKeyEncryptionMethodGenerator

java.lang.Object
  |
  +--org.bouncycastle.openpgp.operator.PGPKeyEncryptionMethodGenerator
        |
        +--org.bouncycastle.openpgp.operator.PublicKeyKeyEncryptionMethodGenerator
Direct Known Subclasses:
BcPublicKeyKeyEncryptionMethodGenerator, JcePublicKeyKeyEncryptionMethodGenerator

public abstract class PublicKeyKeyEncryptionMethodGenerator
extends PGPKeyEncryptionMethodGenerator


Field Summary
static java.lang.String SESSION_KEY_OBFUSCATION_PROPERTY
           
protected  boolean sessionKeyObfuscation
           
protected  boolean useWildcardKeyID
           
static long WILDCARD
           
 
Constructor Summary
protected PublicKeyKeyEncryptionMethodGenerator(PGPPublicKey pubKey)
           
 
Method Summary
protected abstract  byte[] encryptSessionInfo(PGPPublicKey pubKey, byte[] sessionInfo)
           
 ContainedPacket generate(int encAlgorithm, byte[] sessionInfo)
          Generates a packet encoding the details of this encryption method.
 ContainedPacket generateV5(int encAlgorithm, int aeadAlgorithm, byte[] sessionInfo)
           
 ContainedPacket generateV6(int encAlgorithm, int aeadAlgorithm, byte[] sessionInfo)
           
protected static byte[] getSessionInfo(byte[] ephPubEncoding, byte[] c)
           
protected static byte[] getSessionInfo(byte[] VB, int sysmmetricKeyAlgorithm, byte[] c)
           
 byte[][] processSessionInfo(byte[] encryptedSessionInfo)
           
 PublicKeyKeyEncryptionMethodGenerator setSessionKeyObfuscation(boolean enabled)
          Controls whether to obfuscate the size of ECDH session keys using extra padding where necessary.
 PublicKeyKeyEncryptionMethodGenerator setUseWildcardKeyID(boolean enabled)
          Controls whether the recipient key ID is hidden (replaced by a wildcard ID 0
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SESSION_KEY_OBFUSCATION_PROPERTY

public static final java.lang.String SESSION_KEY_OBFUSCATION_PROPERTY

WILDCARD

public static final long WILDCARD

sessionKeyObfuscation

protected boolean sessionKeyObfuscation

useWildcardKeyID

protected boolean useWildcardKeyID
Constructor Detail

PublicKeyKeyEncryptionMethodGenerator

protected PublicKeyKeyEncryptionMethodGenerator(PGPPublicKey pubKey)
Method Detail

setSessionKeyObfuscation

public PublicKeyKeyEncryptionMethodGenerator setSessionKeyObfuscation(boolean enabled)
Controls whether to obfuscate the size of ECDH session keys using extra padding where necessary.

The default behaviour can be configured using the system property "", or else it will default to enabled.

Returns:
the current generator.

setUseWildcardKeyID

public PublicKeyKeyEncryptionMethodGenerator setUseWildcardKeyID(boolean enabled)
Controls whether the recipient key ID is hidden (replaced by a wildcard ID 0).
Parameters:
enabled - boolean
Returns:
this

processSessionInfo

public byte[][] processSessionInfo(byte[] encryptedSessionInfo)
                            throws PGPException

generate

public ContainedPacket generate(int encAlgorithm,
                                byte[] sessionInfo)
                         throws PGPException
Description copied from class: PGPKeyEncryptionMethodGenerator
Generates a packet encoding the details of this encryption method.
Overrides:
generate in class PGPKeyEncryptionMethodGenerator
Following copied from class: org.bouncycastle.openpgp.operator.PGPKeyEncryptionMethodGenerator
Parameters:
encAlgorithm - the encryption algorithm being used
sessionInfo - session data generated by the encrypted data generator.
Returns:
a packet encoding the provided information and the configuration of this instance.
Throws:
PGPException - if an error occurs constructing the packet.

generateV5

public ContainedPacket generateV5(int encAlgorithm,
                                  int aeadAlgorithm,
                                  byte[] sessionInfo)
                           throws PGPException
Overrides:
generateV5 in class PGPKeyEncryptionMethodGenerator

generateV6

public ContainedPacket generateV6(int encAlgorithm,
                                  int aeadAlgorithm,
                                  byte[] sessionInfo)
                           throws PGPException
Overrides:
generateV6 in class PGPKeyEncryptionMethodGenerator

encryptSessionInfo

protected abstract byte[] encryptSessionInfo(PGPPublicKey pubKey,
                                             byte[] sessionInfo)
                                      throws PGPException

getSessionInfo

protected static byte[] getSessionInfo(byte[] ephPubEncoding,
                                       byte[] c)
                                throws java.io.IOException

getSessionInfo

protected static byte[] getSessionInfo(byte[] VB,
                                       int sysmmetricKeyAlgorithm,
                                       byte[] c)

Bouncy Castle Cryptography Library 1.79