Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
Java 3.0.0
-
None
Description
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?