File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 3232import org .bouncycastle .crypto .engines .RSABlindedEngine ;
3333import org .bouncycastle .crypto .util .DigestFactory ;
3434import org .bouncycastle .internal .asn1 .oiw .OIWObjectIdentifiers ;
35+ import org .bouncycastle .jcajce .util .AnnotatedPrivateKey ;
3536import org .bouncycastle .util .Arrays ;
3637
3738public class DigestSignatureSpi
@@ -81,6 +82,11 @@ protected void engineInitSign(
8182 PrivateKey privateKey )
8283 throws InvalidKeyException
8384 {
85+ if (privateKey instanceof AnnotatedPrivateKey )
86+ {
87+ privateKey = ((AnnotatedPrivateKey )privateKey ).getKey ();
88+ }
89+
8490 if (!(privateKey instanceof RSAPrivateKey ))
8591 {
8692 throw new InvalidKeyException ("Supplied key (" + getType (privateKey ) + ") is not a RSAPrivateKey instance" );
You can’t perform that action at this time.
0 commit comments