<div dir="ltr"><div>Thank you Brent and Scott.<br><br></div>That cleared up everything for me. Everything works well now.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 21, 2015 at 7:55 PM, Brent Putman <span dir="ltr">&lt;<a href="mailto:putmanb@georgetown.edu" target="_blank">putmanb@georgetown.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000"><span class="">
    <br>
    <div>On 1/21/15 6:53 AM, Sandy wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div><br>
                <div>ERROR org.opensaml.xml.encryption.Decrypter  -
                  Error decrypting the encrypted data element<br>
                  org.apache.xml.security.encryption.XMLEncryptionException:
                  Invalid AES key length: 1218 bytes<br>
                  <br>
                </div>
                <div>My Cryptography knowledge is limited, so pardon me
                  if I&#39;m wrong. WikiPedia says AES is symmetric key
                  algorithm. If IdP uses public key for encryption, why
                  does org.opensaml.xml.encryption.Decrypter</div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br></span>
    Unrelated to your problem, but for SAML-specific decryption you
    should really use:  org.opensaml.saml2.encryption.Decrypter<span class=""><br>
    <br>
    <blockquote type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div> try to decrypt using AES and fails?<br>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <br></span>
    As Scott said, you are (implicitly) trying to decrypt the data
    directly rather than the key.  See below.<span class=""><br>
    <br>
    <br>
    <br>
    <blockquote type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>    StaticKeyInfoCredentialResolver skicr = new
              StaticKeyInfoCredentialResolver(trustedCredentials);<br>
                  Decrypter samlDecrypter = new
              Decrypter(skicr,null,null);<br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <br></span>
    I said &quot;implicitly&quot; b/c the error is that you are passing in your
    KeyInfoCredentialResolver instance containing the decryption private
    key as the wrong argument.  It should be the 2nd constructor arg,
    not the 1st.  The 1st can be null in this case.  You do need to also
    pass a non-null 3rd arg, an EncryptedKeyResolver instance.  Rather
    than re-gurgitate details on the latter, I&#39;ll refer you to the wiki,
    which has some good examples:<br>
    <br>
<a href="https://wiki.shibboleth.net/confluence/display/OpenSAML/OSTwoUserManJavaXMLEncryption" target="_blank">https://wiki.shibboleth.net/confluence/display/OpenSAML/OSTwoUserManJavaXMLEncryption</a><span class="HOEnZb"><font color="#888888"><br>
    <br>
    <br>
    --Brent<br>
    <br>
    <br>
    <br>
    <br>
  </font></span></div>

<br>--<br>
To unsubscribe from this list send an email to <a href="mailto:dev-unsubscribe@shibboleth.net">dev-unsubscribe@shibboleth.net</a><br></blockquote></div><br></div>