26
26
import org .bouncycastle .bcpg .ArmoredOutputStream ;
27
27
import org .bouncycastle .bcpg .BCPGOutputStream ;
28
28
import org .bouncycastle .bcpg .HashAlgorithmTags ;
29
+ import org .bouncycastle .jce .provider .BouncyCastleProvider ;
29
30
import org .bouncycastle .openpgp .PGPEncryptedData ;
30
31
import org .bouncycastle .openpgp .PGPException ;
31
32
import org .bouncycastle .openpgp .PGPKeyPair ;
@@ -1143,7 +1144,7 @@ public void testFailedSignatureVerification() throws Exception {
1143
1144
}
1144
1145
1145
1146
public PGPSecretKey newSecretKey () throws NoSuchAlgorithmException , NoSuchProviderException , PGPException {
1146
- final KeyPairGenerator kpg = KeyPairGenerator .getInstance ("RSA" , "BC" );
1147
+ final KeyPairGenerator kpg = KeyPairGenerator .getInstance ("RSA" );
1147
1148
kpg .initialize (2048 );
1148
1149
final KeyPair pair = kpg .generateKeyPair ();
1149
1150
final PGPDigestCalculator sha1Calc = new JcaPGPDigestCalculatorProviderBuilder ().build ().get (HashAlgorithmTags .SHA1 );
@@ -1156,7 +1157,9 @@ public PGPSecretKey newSecretKey() throws NoSuchAlgorithmException, NoSuchProvid
1156
1157
null ,
1157
1158
null ,
1158
1159
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 ()));
1160
1163
}
1161
1164
1162
1165
private Function <byte [], String > checksum (final MessageDigest digest ) {
0 commit comments