Package org.pgpainless.decryption_verification

# Class HardwareSecurity.HardwareDataDecryptorFactory

java.lang.Object
org.bouncycastle.openpgp.operator.AbstractPublicKeyDataDecryptorFactory
org.pgpainless.decryption_verification.CustomPublicKeyDataDecryptorFactory
org.pgpainless.decryption_verification.HardwareSecurity.HardwareDataDecryptorFactory

All Implemented Interfaces:
  `org.bouncycastle.openpgp.operator.PGPDataDecryptorFactory`, `org.bouncycastle.openpgp.operator.PublicKeyDataDecryptorFactory`

Enclosing class:
  `HardwareSecurity`

public static class HardwareSecurity.HardwareDataDecryptorFactory extends CustomPublicKeyDataDecryptorFactory
Implementation of `PublicKeyDataDecryptorFactory` which delegates decryption of encrypted session keys to a `HardwareSecurity.DecryptionCallback`. Users can provide such a callback to delegate decryption of messages to hardware security SDKs.

## Constructor Summary

Constructors
Constructor
Description
`HardwareDataDecryptorFactory(SubkeyIdentifier subkeyIdentifier, HardwareSecurity.DecryptionCallback callback)`
Create a new `HardwareSecurity.HardwareDataDecryptorFactory`.

## Method Summary

Modifier and Type
Method
Description
`org.bouncycastle.openpgp.operator.PGPDataDecryptor`
`createDataDecryptor(boolean withIntegrityPacket, int encAlgorithm, byte[] key)`
`org.bouncycastle.openpgp.operator.PGPDataDecryptor`
`createDataDecryptor(org.bouncycastle.bcpg.AEADEncDataPacket aeadEncDataPacket, org.bouncycastle.openpgp.PGPSessionKey sessionKey)`
`org.bouncycastle.openpgp.operator.PGPDataDecryptor`
`createDataDecryptor(org.bouncycastle.bcpg.SymmetricEncIntegrityPacket seipd, org.bouncycastle.openpgp.PGPSessionKey sessionKey)`
`SubkeyIdentifier`
`getSubkeyIdentifier()`
`byte[]`
`recoverSessionData(int keyAlgorithm, byte[][] secKeyData, int pkeskVersion)`

### Methods inherited from class org.bouncycastle.openpgp.operator.AbstractPublicKeyDataDecryptorFactory

`checkRange, containsSKAlg, prependSKAlgorithmToSessionData, recoverSessionData, recoverSessionData`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### HardwareDataDecryptorFactory

public HardwareDataDecryptorFactory(SubkeyIdentifier subkeyIdentifier, HardwareSecurity.DecryptionCallback callback)
Create a new `HardwareSecurity.HardwareDataDecryptorFactory`.

Parameters:
  `subkeyIdentifier` - identifier of the decryption subkey
  `callback` - decryption callback

## Method Details

### recoverSessionData

public byte[] recoverSessionData(int keyAlgorithm, byte[][] secKeyData, int pkeskVersion) throws org.bouncycastle.openpgp.PGPException

Throws:
  `org.bouncycastle.openpgp.PGPException`

### createDataDecryptor

public org.bouncycastle.openpgp.operator.PGPDataDecryptor createDataDecryptor(boolean withIntegrityPacket, int encAlgorithm, byte[] key) throws org.bouncycastle.openpgp.PGPException

Throws:
  `org.bouncycastle.openpgp.PGPException`

### createDataDecryptor

public org.bouncycastle.openpgp.operator.PGPDataDecryptor createDataDecryptor(org.bouncycastle.bcpg.AEADEncDataPacket aeadEncDataPacket, org.bouncycastle.openpgp.PGPSessionKey sessionKey) throws org.bouncycastle.openpgp.PGPException

Throws:
  `org.bouncycastle.openpgp.PGPException`

### createDataDecryptor

public org.bouncycastle.openpgp.operator.PGPDataDecryptor createDataDecryptor(org.bouncycastle.bcpg.SymmetricEncIntegrityPacket seipd, org.bouncycastle.openpgp.PGPSessionKey sessionKey) throws org.bouncycastle.openpgp.PGPException

Throws:
  `org.bouncycastle.openpgp.PGPException`

### getSubkeyIdentifier

public SubkeyIdentifier getSubkeyIdentifier()