use of com.github.zhenwei.pkix.operator.DigestAlgorithmIdentifierFinder in project LinLong-Java by zhenwei1108.
the class JcaContentSignerBuilder method createPSSParams.
private static RSASSAPSSparams createPSSParams(PSSParameterSpec pssSpec) {
DigestAlgorithmIdentifierFinder digFinder = new DefaultDigestAlgorithmIdentifierFinder();
AlgorithmIdentifier digId = digFinder.find(pssSpec.getDigestAlgorithm());
if (digId.getParameters() == null) {
digId = new AlgorithmIdentifier(digId.getAlgorithm(), DERNull.INSTANCE);
}
AlgorithmIdentifier mgfDig = digFinder.find(((MGF1ParameterSpec) pssSpec.getMGFParameters()).getDigestAlgorithm());
if (mgfDig.getParameters() == null) {
mgfDig = new AlgorithmIdentifier(mgfDig.getAlgorithm(), DERNull.INSTANCE);
}
return new RSASSAPSSparams(digId, new AlgorithmIdentifier(PKCSObjectIdentifiers.id_mgf1, mgfDig), new ASN1Integer(pssSpec.getSaltLength()), new ASN1Integer(pssSpec.getTrailerField()));
}
Aggregations