mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-22 19:08:00 +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.pgpainless.algorithm.CompressionAlgorithm;
|
||||
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||
import org.pgpainless.provider.ProviderFactory;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
|
||||
/**
|
||||
|
@ -77,9 +78,9 @@ public class SymmetricEncryptorDecryptor {
|
|||
new JcePGPDataEncryptorBuilder(encryptionAlgorithm.getAlgorithmId())
|
||||
.setWithIntegrityPacket(true)
|
||||
.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);
|
||||
|
||||
|
|
|
@ -17,13 +17,13 @@ package org.pgpainless;
|
|||
|
||||
import java.security.Security;
|
||||
|
||||
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
||||
import org.junit.BeforeClass;
|
||||
import org.pgpainless.provider.ProviderFactory;
|
||||
|
||||
public abstract class AbstractPGPainlessTest {
|
||||
|
||||
@BeforeClass
|
||||
public static void registerProvider() {
|
||||
Security.insertProviderAt(new BouncyCastleProvider(), 1);
|
||||
Security.insertProviderAt(ProviderFactory.getProvider(), 1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue