Skip to content

Commit ed2d439

Browse files
committed
Add note that only SHA1withRSA issuer is actually used
1 parent e7f8a72 commit ed2d439

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkix/src/test/java/org/bouncycastle/cms/test/CMSTestUtil.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,10 @@ public static X509Certificate makeOaepCertificate(KeyPair subKP, String _subDN,
504504

505505
private static JcaContentSignerBuilder makeContentSignerBuilder(PublicKey issPub)
506506
{
507+
/*
508+
* NOTE: Current ALL test certificates are issued under a SHA1withRSA root, so this list is mostly
509+
* redundant (and also incomplete in that it doesn't handle EdDSA or ML-DSA issuers).
510+
*/
507511
JcaContentSignerBuilder contentSignerBuilder;
508512
if (issPub instanceof RSAPublicKey)
509513
{
@@ -521,10 +525,14 @@ else if (issPub.getAlgorithm().equals("ECGOST3410"))
521525
{
522526
contentSignerBuilder = new JcaContentSignerBuilder("GOST3411withECGOST3410");
523527
}
524-
else
528+
else if (issPub.getAlgorithm().equals("GOST3410"))
525529
{
526530
contentSignerBuilder = new JcaContentSignerBuilder("GOST3411WithGOST3410");
527531
}
532+
else
533+
{
534+
throw new UnsupportedOperationException("Algorithm handlers incomplete");
535+
}
528536

529537
contentSignerBuilder.setProvider(BouncyCastleProvider.PROVIDER_NAME);
530538

0 commit comments

Comments
 (0)