Use private key algorithm

pull/185/head
M66B 4 years ago
parent 37953b2168
commit 5b00bbd321

@ -2716,7 +2716,12 @@ public class FragmentCompose extends FragmentBase {
CMSSignedDataGenerator cmsGenerator = new CMSSignedDataGenerator();
cmsGenerator.addCertificates(store);
ContentSigner contentSigner = new JcaContentSignerBuilder("SHA256withRSA")
String algorithm = privkey.getAlgorithm();
Log.i("Private key algorithm=" + algorithm);
if (TextUtils.isEmpty(algorithm))
algorithm = "RSA";
ContentSigner contentSigner = new JcaContentSignerBuilder("SHA256with" + algorithm)
.build(privkey);
DigestCalculatorProvider digestCalculator = new JcaDigestCalculatorProviderBuilder()
.build();

Loading…
Cancel
Save