【发布时间】:2014-10-25 18:01:21
【问题描述】:
我使用带有密钥和随机 IV 的 AES 加密我的数据。我使用 RSA 加密此密钥并将其包含在我的 EncryptedData 中,如下所示。我也需要包含 IV,但是由于 KeyInfo 元素已经被 EncryptedKey 元素占用,我该如何将它包含在 XML 加密语法中?
<?xml version='1.0' encoding='UTF-8'?>
<EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"
xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbf" />
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
<KeySize>256</KeySize>
<OAEPparams>AA==</OAEPparams>
<DigestMethod xmlns="http://www.w3.org/2000/09/xmldsig#"
Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
</EncryptionMethod>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<KeyName>client provided public key</KeyName>
</KeyInfo>
<CipherData>
<CipherValue>...</CipherValue>
</CipherData>
</EncryptedKey>
</KeyInfo>
<CipherData>
<CipherValue>...</CipherValue>
</CipherData>
</EncryptedData>
【问题讨论】:
标签: xml encryption cryptography public-key-encryption xml-encryption