Skip to content

Commit 3620a94

Browse files
committed
Make PBESecretKeyEncryptorFactory an Interface
1 parent 88936f2 commit 3620a94

5 files changed

+7
-7
lines changed

pg/src/main/java/org/bouncycastle/openpgp/operator/PBESecretKeyEncryptorFactory.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* A concrete implementation of this class can not only choose the cryptographic backend (e.g. BC, JCA/JCE),
88
* but also, whether to use AEAD (RFC9580) or classic CFB (RFC4880).
99
*/
10-
public abstract class PBESecretKeyEncryptorFactory
10+
public interface PBESecretKeyEncryptorFactory
1111
{
1212

1313
/**
@@ -17,5 +17,5 @@ public abstract class PBESecretKeyEncryptorFactory
1717
* @param pubKeyPacket public-key packet of the key to protect (needed for AEAD)
1818
* @return key encryptor
1919
*/
20-
public abstract PBESecretKeyEncryptor build(char[] passphrase, PublicKeyPacket pubKeyPacket);
20+
PBESecretKeyEncryptor build(char[] passphrase, PublicKeyPacket pubKeyPacket);
2121
}

pg/src/main/java/org/bouncycastle/openpgp/operator/bc/BcAEADSecretKeyEncryptorFactory.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* for the Argon2 key derivation (see {@link S2K.Argon2Params#memoryConstrainedParameters()}).
1717
*/
1818
public class BcAEADSecretKeyEncryptorFactory
19-
extends PBESecretKeyEncryptorFactory
19+
implements PBESecretKeyEncryptorFactory
2020
{
2121
@Override
2222
public PBESecretKeyEncryptor build(char[] passphrase, PublicKeyPacket pubKeyPacket)
@@ -25,7 +25,7 @@ public PBESecretKeyEncryptor build(char[] passphrase, PublicKeyPacket pubKeyPack
2525
{
2626
return null;
2727
}
28-
return new BcAEADSecretKeyEncryptorBuilder(
28+
return new org.bouncycastle.openpgp.operator.bc.BcAEADSecretKeyEncryptorBuilder(
2929
AEADAlgorithmTags.OCB,
3030
SymmetricKeyAlgorithmTags.AES_256,
3131
S2K.Argon2Params.memoryConstrainedParameters())

pg/src/main/java/org/bouncycastle/openpgp/operator/bc/BcCFBSecretKeyEncryptorFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* and uses AES256 for secret key protection.
1818
*/
1919
public class BcCFBSecretKeyEncryptorFactory
20-
extends PBESecretKeyEncryptorFactory
20+
implements PBESecretKeyEncryptorFactory
2121
{
2222
@Override
2323
public PBESecretKeyEncryptor build(char[] passphrase, PublicKeyPacket pubKeyPacket)

pg/src/main/java/org/bouncycastle/openpgp/operator/jcajce/JcaAEADSecretKeyEncryptorFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import java.security.Provider;
1111

1212
public class JcaAEADSecretKeyEncryptorFactory
13-
extends PBESecretKeyEncryptorFactory
13+
implements PBESecretKeyEncryptorFactory
1414
{
1515
private JcaAEADSecretKeyEncryptorBuilder builder = new JcaAEADSecretKeyEncryptorBuilder(
1616
AEADAlgorithmTags.OCB,

pg/src/main/java/org/bouncycastle/openpgp/operator/jcajce/JcaCFBSecretKeyEncryptorFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import java.security.Provider;
1111

1212
public class JcaCFBSecretKeyEncryptorFactory
13-
extends PBESecretKeyEncryptorFactory
13+
implements PBESecretKeyEncryptorFactory
1414
{
1515
private JcaPGPDigestCalculatorProviderBuilder digestCalcProviderBuilder =
1616
new JcaPGPDigestCalculatorProviderBuilder();

0 commit comments

Comments
 (0)