mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-01-09 19:57:57 +01:00
Use ProviderFactory instead of 'BC'
This commit is contained in:
parent
9a9f706e83
commit
2c816dd84c
2 changed files with 5 additions and 4 deletions
|
@ -42,6 +42,7 @@ import org.bouncycastle.openpgp.operator.jcajce.JcePGPDataEncryptorBuilder;
|
||||||
import org.bouncycastle.util.io.Streams;
|
import org.bouncycastle.util.io.Streams;
|
||||||
import org.pgpainless.algorithm.CompressionAlgorithm;
|
import org.pgpainless.algorithm.CompressionAlgorithm;
|
||||||
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||||
|
import org.pgpainless.provider.ProviderFactory;
|
||||||
import org.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -77,9 +78,9 @@ public class SymmetricEncryptorDecryptor {
|
||||||
new JcePGPDataEncryptorBuilder(encryptionAlgorithm.getAlgorithmId())
|
new JcePGPDataEncryptorBuilder(encryptionAlgorithm.getAlgorithmId())
|
||||||
.setWithIntegrityPacket(true)
|
.setWithIntegrityPacket(true)
|
||||||
.setSecureRandom(new SecureRandom())
|
.setSecureRandom(new SecureRandom())
|
||||||
.setProvider("BC"));
|
.setProvider(ProviderFactory.getProvider()));
|
||||||
|
|
||||||
encGen.addMethod(new JcePBEKeyEncryptionMethodGenerator(password.getChars()).setProvider("BC"));
|
encGen.addMethod(new JcePBEKeyEncryptionMethodGenerator(password.getChars()).setProvider(ProviderFactory.getProvider()));
|
||||||
|
|
||||||
OutputStream encOut = encGen.open(bOut, compressedData.length);
|
OutputStream encOut = encGen.open(bOut, compressedData.length);
|
||||||
|
|
||||||
|
|
|
@ -17,13 +17,13 @@ package org.pgpainless;
|
||||||
|
|
||||||
import java.security.Security;
|
import java.security.Security;
|
||||||
|
|
||||||
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
|
import org.pgpainless.provider.ProviderFactory;
|
||||||
|
|
||||||
public abstract class AbstractPGPainlessTest {
|
public abstract class AbstractPGPainlessTest {
|
||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void registerProvider() {
|
public static void registerProvider() {
|
||||||
Security.insertProviderAt(new BouncyCastleProvider(), 1);
|
Security.insertProviderAt(ProviderFactory.getProvider(), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue