2626import org .bouncycastle .bcpg .ArmoredOutputStream ;
2727import org .bouncycastle .bcpg .BCPGOutputStream ;
2828import org .bouncycastle .bcpg .HashAlgorithmTags ;
29+ import org .bouncycastle .jce .provider .BouncyCastleProvider ;
2930import org .bouncycastle .openpgp .PGPEncryptedData ;
3031import org .bouncycastle .openpgp .PGPException ;
3132import org .bouncycastle .openpgp .PGPKeyPair ;
@@ -1143,7 +1144,7 @@ public void testFailedSignatureVerification() throws Exception {
11431144 }
11441145
11451146 public PGPSecretKey newSecretKey () throws NoSuchAlgorithmException , NoSuchProviderException , PGPException {
1146- final KeyPairGenerator kpg = KeyPairGenerator .getInstance ("RSA" , "BC" );
1147+ final KeyPairGenerator kpg = KeyPairGenerator .getInstance ("RSA" );
11471148 kpg .initialize (2048 );
11481149 final KeyPair pair = kpg .generateKeyPair ();
11491150 final PGPDigestCalculator sha1Calc = new JcaPGPDigestCalculatorProviderBuilder ().build ().get (HashAlgorithmTags .SHA1 );
@@ -1156,7 +1157,9 @@ public PGPSecretKey newSecretKey() throws NoSuchAlgorithmException, NoSuchProvid
11561157 null ,
11571158 null ,
11581159 new JcaPGPContentSignerBuilder (pkp .getPublicKey ().getAlgorithm (), HashAlgorithmTags .SHA1 ),
1159- new JcePBESecretKeyEncryptorBuilder (PGPEncryptedData .CAST5 , sha1Calc ).setProvider ("BC" ).build ("passphrase" .toCharArray ()));
1160+ new JcePBESecretKeyEncryptorBuilder (PGPEncryptedData .CAST5 , sha1Calc )
1161+ .setProvider (new BouncyCastleProvider ())
1162+ .build ("passphrase" .toCharArray ()));
11601163 }
11611164
11621165 private Function <byte [], String > checksum (final MessageDigest digest ) {
0 commit comments