Uploaded image for project: 'Santuario'
  1. Santuario
  2. SANTUARIO-594

XMLEncryptionException: key was not an RSAKey is thrown when doing encryption with an ECDSA certificate

    XMLWordPrintableJSON

Details

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

      Attachments

        Activity

          People

            coheigea Colm O hEigeartaigh
            chenym@sg.ibm.com chenym
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: