You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by "Colm O hEigeartaigh (Jira)" <ji...@apache.org> on 2022/10/17 09:08:00 UTC
[jira] [Commented] (SANTUARIO-594) XMLEncryptionException: key was not an RSAKey is thrown when doing encryption with an ECDSA certificate
[ https://issues.apache.org/jira/browse/SANTUARIO-594?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17618775#comment-17618775 ]
Colm O hEigeartaigh commented on SANTUARIO-594:
-----------------------------------------------
Can you submit a complete test-case?
> XMLEncryptionException: key was not an RSAKey is thrown when doing encryption with an ECDSA certificate
> -------------------------------------------------------------------------------------------------------
>
> Key: SANTUARIO-594
> URL: https://issues.apache.org/jira/browse/SANTUARIO-594
> Project: Santuario
> Issue Type: Bug
> Components: Java
> Affects Versions: Java 3.0.0
> Reporter: chenym
> Assignee: Colm O hEigeartaigh
> Priority: Major
> Fix For: Java 3.0.0
>
>
> Following Exception is thrown when doing encryption with Santuario API with an ECDSA certificate:
> org.apache.xml.security.encryption.XMLEncryptionException: key was not an RSAKey
> Original Exception was java.security.InvalidKeyException: key was not an RSAKey
> #011at org.apache.xml.security.encryption.XMLCipher.encryptKey(XMLCipher.java:1390)
> #011at org.apache.xml.security.encryption.XMLCipher.encryptKey(XMLCipher.java:1321)
> #011at org.apache.xml.security.encryption.XMLCipher.encryptKey(XMLCipher.java:1301)
>
> Following is the code snippet on the encryption, Exception above is thrown in the last line of code:
> XMLCipher kekCipher = XMLCipher.getInstance(keyTransportUri);
> kekCipher.init(XMLCipher.WRAP_MODE, ecdsaCert.getPublicKey());
> org.apache.xml.security.encryption.EncryptedKey encryptedKey = kekCipher.encryptKey(doc, secretKey);
>
> Can anyone share if Santuario API supports encryption / decryption with ECDSA certificate? is the above Exception as expected?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)