In my input source (a signed XML), I encounter some encrypted data. For example:
<cpix:Key>
<enc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" />
<enc:CipherData>
<enc:CipherValue>rJXrk2Y...</enc:CipherValue>
</enc:CipherData>
</cpix:Key>
The Algorithm
attribute in tag EncryptionMethod
denotes the algorithm being used.
Is there a canonical way to translate the algorithm URI to a Java/Cipher
-compatible transformation format, which can be passed to Cipher.getInstance("...")
?
In the example above, I believe this would be translated into Cipher.getInstance("RSA/ECB/OAEPPadding")
.