[ https://issues.apache.org/jira/browse/PDFBOX-5940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17921376#comment-17921376 ]
Tilman Hausherr edited comment on PDFBOX-5940 at 1/27/25 2:09 PM: ------------------------------------------------------------------ [~mkl] Thanks, how would be know the correct algorithm - from {{privateKey.getAlgorithm()}} ? Update: I just tried that one and it didn't work, because that one returns "RSA" only, instead of "SHA256withRSA". Or should I just add "SHA256With" to it? (or one of the others mentioned in the "SubFilter value algorithm support" table in the PDF specification)? was (Author: tilman): [~mkl] Thanks, how would be know the correct algorithm - from {{privateKey.getAlgorithm()}} ? Update: I just tried that one and it didn't work, because that one returns "RSA" only, instead of "SHA256withRSA". Or should I just add "SHA256With" to it? > InvalidKeyException: Supplied key (sun.security.ec.ECPrivateKeyImpl) is not a > RSAPrivateKey > ------------------------------------------------------------------------------------------- > > Key: PDFBOX-5940 > URL: https://issues.apache.org/jira/browse/PDFBOX-5940 > Project: PDFBox > Issue Type: Bug > Components: Crypto, Signing > Affects Versions: 2.0.33, 3.0.4 PDFBox, 4.0.0 > Reporter: Tilman Hausherr > Assignee: Tilman Hausherr > Priority: Trivial > Fix For: 2.0.34, 3.0.5 PDFBox, 4.0.0 > > > InvalidKeyException: Supplied key (sun.security.ec.ECPrivateKeyImpl) is not a > RSAPrivateKey instance > at > org.bouncycastle.jcajce.provider.asymmetric.rsa.DigestSignatureSpi.engineInitSign(Unknown > Source) > at > java.base/java.security.Signature$Delegate.tryOperation(Signature.java:1321) > at > java.base/java.security.Signature$Delegate.chooseProvider(Signature.java:1275) > at > java.base/java.security.Signature$Delegate.engineInitSign(Signature.java:1359) > at java.base/java.security.Signature.initSign(Signature.java:635) -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org