[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xml-security-dev
Subject:    Re: Is the sample program for XML encryption ok?
From:       Gary Tse <gary.garytse () gmail ! com>
Date:       2009-02-20 8:38:04
Message-ID: 4557d9290902200038p3a1e295cobb28bf5424f5c194 () mail ! gmail ! com
[Download RAW message or body]

Dear gurus,

I'm getting confused at this point about the KeyInfo and EncryptedKey.  I
have a XML to be encrypted by an AES session key then wrapped by RSA.

Which of the formats should I use or any other suggestions?

Format 1 (certificate placed at 1st layer of KeyInfo,
EncryptedData/KeyInfo/X509Data):
<xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
        Type="http://www.w3.org/2001/04/xmlenc#Content">
    <xenc:EncryptionMethod Algorithm="
http://www.w3.org/2001/04/xmlenc#aes256-cbc"
        xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"/>
    <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
        <xenc:EncryptedKey xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
            <xenc:EncryptionMethod Algorithm="
http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"
                xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"/>
            <xenc:CipherData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
                <xenc:CipherValue xmlns:xenc="
http://www.w3.org/2001/04/xmlenc#">...</xenc:CipherValue>
            </xenc:CipherData>
        </xenc:EncryptedKey>
        <ds:X509Data>
            <!--Cert for key-wrapping-->
            <ds:X509Certificate>
                MIIC...
            </ds:X509Certificate>
        </ds:X509Data>
    </ds:KeyInfo>
    <xenc:CipherData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
        <xenc:CipherValue xmlns:xenc="http://www.w3.org/2001/04/xmlenc#
">...</xenc:CipherValue>
    </xenc:CipherData>
</xenc:EncryptedData>


Format 2 (certificate placed at under
EncryptedData/EncryptedKey/KeyInfo/X509Data):
<xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
        Type="http://www.w3.org/2001/04/xmlenc#Content">
    <xenc:EncryptionMethod Algorithm="
http://www.w3.org/2001/04/xmlenc#aes256-cbc"></xenc:EncryptionMethod>
    <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    <xenc:EncryptedKey>
        <xenc:EncryptionMethod Algorithm="
http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"></xenc:EncryptionMethod>
        <ds:KeyInfo>
            <ds:X509Data>
                <!--Cert for key-wrapping-->
                <ds:X509Certificate>
                    MIIC...
                </ds:X509Certificate>
            </ds:X509Data>
        </ds:KeyInfo>
    <xenc:CipherData>
        <xenc:CipherValue>...</xenc:CipherValue>
    </xenc:CipherData>
    </xenc:EncryptedKey>
    </ds:KeyInfo>
    <xenc:CipherData>
        <xenc:CipherValue>...</xenc:CipherValue>
    </xenc:CipherData>
</xenc:EncryptedData>

Thanks in advance,
Gary


On Wed, Feb 18, 2009 at 10:51 PM, Sean Mullan <Sean.Mullan@sun.com> wrote:

> Gary Tse wrote:
>
>> Dear gurus,
>>
>> I'm working with the Apache XML security 1.4.2 (Java version) and suspect
>> a problem in the sample.
>>
>> This sample is supplied with the 1.4.2 package:
>>
>> <xml-security-1_4_2>/src_samples/org/apache/xml/security/samples/encryption/Encrypter.java
>>
>> The sample runs fine and produced this (and the key-encryption-key file
>> kek):
>> <apache:RootElement xmlns:apache="http://www.apache.org/ns/#app1">
>>    <xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
>> Type="http://www.w3.org/2001/04/xmlenc#Content">
>>        <xenc:EncryptionMethod Algorithm="
>> http://www.w3.org/2001/04/xmlenc#aes128-cbc" xmlns:xenc="
>> http://www.w3.org/2001/04/xmlenc#"/>
>>        <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
>>            <*xenc:EncryptedKey *xmlns:xenc="
>> http://www.w3.org/2001/04/xmlenc#">
>>                <xenc:EncryptionMethod Algorithm="
>> http://www.w3.org/2001/04/xmlenc#kw-tripledes" xmlns:xenc="
>> http://www.w3.org/2001/04/xmlenc#"/>
>>                <xenc:CipherData xmlns:xenc="
>> http://www.w3.org/2001/04/xmlenc#">
>>                    <xenc:CipherValue xmlns:xenc="
>> http://www.w3.org/2001/04/xmlenc#
>> ">YD/20hNbr8wNAGCJRxg+IqQaJF2I+pahDknGvmVAC3I=</xenc:CipherValue>
>>                </xenc:CipherData>
>>            </*xenc:EncryptedKey*>
>>        </ds:KeyInfo>
>>        <xenc:CipherData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
>>            <xenc:CipherValue xmlns:xenc="
>> http://www.w3.org/2001/04/xmlenc#
>> ">mblZKJ25HspqQopvfwUELnbE1hqrKDt54N849eksaQBMZZ4FgWf+N4HYTyA87GLh0m+bZSt3JtlX
>>
>>  GWmPx395ZyGVGEaz3Ic7LoBK+65DSjkmWqKGt1XHSuqpSOK3UKdB4skLqnv7Ji48tmpyHF513Q==</xenc:CipherValue>
>>        </xenc:CipherData>
>>    </xenc:EncryptedData>
>> </apache:RootElement>
>>
>>
>> In the XML encryption spec,  link here:
>>
>> http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#sec-Extensions-to-KeyInfo
>>
>> /"The |EncryptedData| or |EncryptedKey| element specify the associated
>> keying material via a child of |ds:KeyInfo|. All of the child elements of
>> ds:|KeyInfo| specified in [XML-DSIG <
>> http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#ref-XML-DSIG>]
>> MAY be used as qualified: /"
>>
>>  From the XML spec, does it mean that an extra <ds:KeyInfo> should be
>> placed in the <xenc:EncryptedKey> element to provide information about the
>> encrypted key?  If so, sample code might need updating.
>>
>
> It's not mandatory, but something to help identify the key would be useful,
> for example:
>
> <xenc:EncryptedKey xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
>  <ds:KeyInfo xmlns:ds='http://www.w3.org/2000/09/xmldsig#'>
>    <ds:KeyName>Key XXX</ds:KeyName>
>  </ds:KeyInfo>
> ...
>
> Keep in mind these are just samples and you should modify or adapt them to
> your specific requirements.
>
> Thanks,
> Sean
>
>
>

[Attachment #3 (text/html)]

Dear gurus,<br><br>I&#39;m getting confused at this point about the KeyInfo and \
EncryptedKey.&nbsp; I have a XML to be encrypted by an AES session key then wrapped \
by RSA.&nbsp; <br><br>Which of the formats should I use or any other \
suggestions?&nbsp; <br> <br>Format 1 (certificate placed at 1st layer of KeyInfo, \
EncryptedData/KeyInfo/X509Data):<br><font style="font-family: courier new,monospace;" \
size="2"><font size="1">&lt;xenc:EncryptedData xmlns:xenc=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#">http://www.w3.org/2001/04/xmlenc#</a>&quot; \
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#Content">http://www.w3.org/2001/04/xmlenc#Content</a>&quot;&gt;<br>&nbsp;&nbsp;&nbsp; \
&lt;xenc:EncryptionMethod Algorithm=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#aes256-cbc">http://www.w3.org/2001/04/xmlenc#aes256-cbc</a>&quot;<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlns:xenc=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#">http://www.w3.org/2001/04/xmlenc#</a>&quot;/&gt;<br>&nbsp;&nbsp;&nbsp; \
&lt;ds:KeyInfo xmlns:ds=&quot;<a \
href="http://www.w3.org/2000/09/xmldsig#">http://www.w3.org/2000/09/xmldsig#</a>&quot;&gt;<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xenc:EncryptedKey xmlns:xenc=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#">http://www.w3.org/2001/04/xmlenc#</a>&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;xenc:EncryptionMethod Algorithm=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p</a>&quot; \
<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
xmlns:xenc=&quot;<a href="http://www.w3.org/2001/04/xmlenc#">http://www.w3.org/2001/04 \
/xmlenc#</a>&quot;/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;xenc:CipherData xmlns:xenc=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#">http://www.w3.org/2001/04/xmlenc#</a>&quot;&gt;<br>
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;xenc:CipherValue xmlns:xenc=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#">http://www.w3.org/2001/04/xmlenc#</a>&quot;&g \
t;...&lt;/xenc:CipherValue&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;/xenc:CipherData&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;/xenc:EncryptedKey&gt;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;ds:X509Data&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;!--Cert for key-wrapping--&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;ds:X509Certificate&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
MIIC... <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;/ds:X509Certificate&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;/ds:X509Data&gt;<br> &nbsp;&nbsp;&nbsp; &lt;/ds:KeyInfo&gt;<br>&nbsp;&nbsp;&nbsp; \
&lt;xenc:CipherData xmlns:xenc=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#">http://www.w3.org/2001/04/xmlenc#</a>&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;xenc:CipherValue xmlns:xenc=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#">http://www.w3.org/2001/04/xmlenc#</a>&quot;&gt;...&lt;/xenc:CipherValue&gt;<br>
 &nbsp;&nbsp;&nbsp; &lt;/xenc:CipherData&gt;<br>&lt;/xenc:EncryptedData&gt;</font><br></font><br><br>Format \
2 (certificate placed at under EncryptedData/EncryptedKey/KeyInfo/X509Data):<br><font \
size="1"><span style="font-family: courier new,monospace;">&lt;xenc:EncryptedData \
xmlns:xenc=&quot;<a href="http://www.w3.org/2001/04/xmlenc#">http://www.w3.org/2001/04/xmlenc#</a>&quot; \
</span><br style="font-family: courier new,monospace;"> <span style="font-family: \
courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Type=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#Content">http://www.w3.org/2001/04/xmlenc#Content</a>&quot;&gt;</span><br \
style="font-family: courier new,monospace;"> <span style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp; &lt;xenc:EncryptionMethod Algorithm=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#aes256-cbc">http://www.w3.org/2001/04/xmlenc#aes256-cbc</a>&quot;&gt;&lt;/xenc:EncryptionMethod&gt;</span><br \
style="font-family: courier new,monospace;"> <span style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp; &lt;ds:KeyInfo xmlns:ds=&quot;<a \
href="http://www.w3.org/2000/09/xmldsig#">http://www.w3.org/2000/09/xmldsig#</a>&quot;&gt;</span><br \
style="font-family: courier new,monospace;"> <span style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp; &lt;xenc:EncryptedKey&gt;</span><br \
style="font-family: courier new,monospace;"><span style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xenc:EncryptionMethod \
Algorithm=&quot;<a href="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">http://www.w \
3.org/2001/04/xmlenc#rsa-oaep-mgf1p</a>&quot;&gt;&lt;/xenc:EncryptionMethod&gt;</span><br \
style="font-family: courier new,monospace;"> <span style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;ds:KeyInfo&gt;</span><br style="font-family: courier new,monospace;"><span \
style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;ds:X509Data&gt;<br></span></font><font style="font-family: courier \
new,monospace;" size="2"><font \
size="1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;!--Cert for key-wrapping--&gt;</font></font><br style="font-family: courier \
new,monospace;"> <font size="1"><span style="font-family: courier \
new,monospace;"></span><span style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;ds:X509Certificate&gt;</span><br style="font-family: courier \
new,monospace;"><span style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
MIIC...</span><br style="font-family: courier new,monospace;"> <span \
style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;/ds:X509Certificate&gt;</span><br style="font-family: courier \
new,monospace;"><span style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;/ds:X509Data&gt;</span><br style="font-family: courier new,monospace;"> <span \
style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;/ds:KeyInfo&gt;</span><br style="font-family: courier new,monospace;"><span \
style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; \
&lt;xenc:CipherData&gt;</span><br style="font-family: courier new,monospace;"> <span \
style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;xenc:CipherValue&gt;...&lt;/xenc:CipherValue&gt;</span><br style="font-family: \
courier new,monospace;"><span style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp; &lt;/xenc:CipherData&gt;</span><br \
style="font-family: courier new,monospace;"> <span style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp; &lt;/xenc:EncryptedKey&gt;</span><br \
style="font-family: courier new,monospace;"><span style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp; &lt;/ds:KeyInfo&gt;</span><br style="font-family: \
courier new,monospace;"> <span style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp; &lt;xenc:CipherData&gt;</span><br \
style="font-family: courier new,monospace;"><span style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;xenc:CipherValue&gt;...&lt;/xenc:CipherValue&gt;</span><br style="font-family: \
courier new,monospace;"> <span style="font-family: courier \
new,monospace;">&nbsp;&nbsp;&nbsp; &lt;/xenc:CipherData&gt;</span><br \
style="font-family: courier new,monospace;"><span style="font-family: courier \
new,monospace;">&lt;/xenc:EncryptedData&gt;</span></font><br> <br>Thanks in \
advance,<br>Gary<br><br><br><div class="gmail_quote">On Wed, Feb 18, 2009 at 10:51 \
PM, Sean Mullan <span dir="ltr">&lt;<a \
href="mailto:Sean.Mullan@sun.com">Sean.Mullan@sun.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Gary Tse wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); \
margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c"> \
Dear gurus,<br> <br>
I&#39;m working with the Apache XML security 1.4.2 (Java version) and suspect a \
problem in the sample.<br> <br>
This sample is supplied with the 1.4.2 package:<br>
&lt;xml-security-1_4_2&gt;/src_samples/org/apache/xml/security/samples/encryption/Encrypter.java<br>
 <br>
The sample runs fine and produced this (and the key-encryption-key file kek):<br>
&lt;apache:RootElement xmlns:apache=&quot;<a href="http://www.apache.org/ns/#app1" \
target="_blank">http://www.apache.org/ns/#app1</a>&quot;&gt;<br>  &nbsp; \
&nbsp;&lt;xenc:EncryptedData xmlns:xenc=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#" \
target="_blank">http://www.w3.org/2001/04/xmlenc#</a>&quot; Type=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#Content" \
target="_blank">http://www.w3.org/2001/04/xmlenc#Content</a>&quot;&gt;<br>

 &nbsp; &nbsp; &nbsp; &nbsp;&lt;xenc:EncryptionMethod Algorithm=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#aes128-cbc" \
target="_blank">http://www.w3.org/2001/04/xmlenc#aes128-cbc</a>&quot; \
xmlns:xenc=&quot;<a href="http://www.w3.org/2001/04/xmlenc#" \
target="_blank">http://www.w3.org/2001/04/xmlenc#</a>&quot;/&gt;<br>

 &nbsp; &nbsp; &nbsp; &nbsp;&lt;ds:KeyInfo xmlns:ds=&quot;<a \
href="http://www.w3.org/2000/09/xmldsig#" \
target="_blank">http://www.w3.org/2000/09/xmldsig#</a>&quot;&gt;<br>  &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp;&lt;*xenc:EncryptedKey *xmlns:xenc=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#" \
target="_blank">http://www.w3.org/2001/04/xmlenc#</a>&quot;&gt;<br>  &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;xenc:EncryptionMethod Algorithm=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#kw-tripledes" \
target="_blank">http://www.w3.org/2001/04/xmlenc#kw-tripledes</a>&quot; \
xmlns:xenc=&quot;<a href="http://www.w3.org/2001/04/xmlenc#" \
target="_blank">http://www.w3.org/2001/04/xmlenc#</a>&quot;/&gt;<br>

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;xenc:CipherData \
xmlns:xenc=&quot;<a href="http://www.w3.org/2001/04/xmlenc#" \
target="_blank">http://www.w3.org/2001/04/xmlenc#</a>&quot;&gt;<br>  &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;xenc:CipherValue \
xmlns:xenc=&quot;<a href="http://www.w3.org/2001/04/xmlenc#" \
target="_blank">http://www.w3.org/2001/04/xmlenc#</a>&quot;&gt;YD/20hNbr8wNAGCJRxg+IqQaJF2I+pahDknGvmVAC3I=&lt;/xenc:CipherValue&gt;<br>


 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/xenc:CipherData&gt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/*xenc:EncryptedKey*&gt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;/ds:KeyInfo&gt;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;xenc:CipherData xmlns:xenc=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#" \
target="_blank">http://www.w3.org/2001/04/xmlenc#</a>&quot;&gt;<br>  &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp;&lt;xenc:CipherValue xmlns:xenc=&quot;<a \
href="http://www.w3.org/2001/04/xmlenc#" \
target="_blank">http://www.w3.org/2001/04/xmlenc#</a>&quot;&gt;mblZKJ25HspqQopvfwUELnbE1hqrKDt54N849eksaQBMZZ4FgWf+N4HYTyA87GLh0m+bZSt3JtlX<br>


 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;GWmPx395ZyGVGEaz3Ic7LoBK+65DSjkmWqKGt1XHSuqpSOK3UKdB4skLqnv7Ji48tmpyHF513Q==&lt;/xenc:CipherValue&gt;<br>
  &nbsp; &nbsp; &nbsp; &nbsp;&lt;/xenc:CipherData&gt;<br>
 &nbsp; &nbsp;&lt;/xenc:EncryptedData&gt;<br>
&lt;/apache:RootElement&gt;<br>
<br>
<br>
In the XML encryption spec, &nbsp;link here:<br>
<a href="http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#sec-Extensions-to-KeyInfo" \
target="_blank">http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#sec-Extensions-to-KeyInfo</a><br>
 <br></div></div>
/&quot;The |EncryptedData| or |EncryptedKey| element specify the associated keying \
material via a child of |ds:KeyInfo|. All of the child elements of ds:|KeyInfo| \
specified in [XML-DSIG &lt;<a \
href="http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#ref-XML-DSIG" \
target="_blank">http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#ref-XML-DSIG</a>&gt;] \
MAY be used as qualified: /&quot;<div class="Ih2E3d"> <br>
<br>
&nbsp;From the XML spec, does it mean that an extra &lt;ds:KeyInfo&gt; should be \
placed in the &lt;xenc:EncryptedKey&gt; element to provide information about the \
encrypted key? &nbsp;If so, sample code might need updating.<br> </div></blockquote>
<br>
It&#39;s not mandatory, but something to help identify the key would be useful, for \
example:<div class="Ih2E3d"><br> <br>
&lt;xenc:EncryptedKey xmlns:xenc=&quot;<a href="http://www.w3.org/2001/04/xmlenc#" \
target="_blank">http://www.w3.org/2001/04/xmlenc#</a>&quot;&gt;<br></div>  \
&nbsp;&lt;ds:KeyInfo xmlns:ds=&#39;<a href="http://www.w3.org/2000/09/xmldsig#" \
target="_blank">http://www.w3.org/2000/09/xmldsig#</a>&#39;&gt;<br>  &nbsp; \
&nbsp;&lt;ds:KeyName&gt;Key XXX&lt;/ds:KeyName&gt;<br>  &nbsp;&lt;/ds:KeyInfo&gt;<br>
...<br>
<br>
Keep in mind these are just samples and you should modify or adapt them to your \
specific requirements.<br> <br>
Thanks,<br><font color="#888888">
Sean<br>
<br>
<br>
</font></blockquote></div><br>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic