Class OCBPBEProtectionRemoverFactory
- java.lang.Object
-
- org.eclipse.jgit.gpg.bc.internal.keys.OCBPBEProtectionRemoverFactory
-
- All Implemented Interfaces:
org.bouncycastle.openpgp.operator.PBEProtectionRemoverFactory
class OCBPBEProtectionRemoverFactory extends java.lang.Object implements org.bouncycastle.openpgp.operator.PBEProtectionRemoverFactory
APBEProtectionRemoverFactory
using AES/OCB/NoPadding for decryption. It accepts an AAD in the factory's constructor, so the factory can be used to create aPBESecretKeyDecryptor
only for a particular input.For JGit's needs, this is sufficient, but for a general upstream implementation that limitation might not be acceptable.
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
aad
private org.bouncycastle.openpgp.operator.PGPDigestCalculatorProvider
calculatorProvider
private char[]
passphrase
-
Constructor Summary
Constructors Constructor Description OCBPBEProtectionRemoverFactory(char[] passphrase, org.bouncycastle.openpgp.operator.PGPDigestCalculatorProvider calculatorProvider, byte[] aad)
Creates a new factory instance with the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor
createDecryptor(java.lang.String protection)
-
-
-
Constructor Detail
-
OCBPBEProtectionRemoverFactory
OCBPBEProtectionRemoverFactory(char[] passphrase, org.bouncycastle.openpgp.operator.PGPDigestCalculatorProvider calculatorProvider, byte[] aad)
Creates a new factory instance with the given parameters.Because the AAD is given at factory level, the
PBESecretKeyDecryptor
s created by the factory can be used to decrypt only a particular input matching this AAD.- Parameters:
passphrase
- to use for secret key derivationcalculatorProvider
- for computing digestsaad
- for the OCB decryption
-
-
Method Detail
-
createDecryptor
public org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor createDecryptor(java.lang.String protection) throws org.bouncycastle.openpgp.PGPException
- Specified by:
createDecryptor
in interfaceorg.bouncycastle.openpgp.operator.PBEProtectionRemoverFactory
- Throws:
org.bouncycastle.openpgp.PGPException
-
-