mace-opensaml-users - Re: [OpenSAML] Encrypt/Decrypt assertion
Subject: OpenSAML user discussion
List archive
- From: Brent Putman <>
- To:
- Subject: Re: [OpenSAML] Encrypt/Decrypt assertion
- Date: Mon, 15 Dec 2008 01:55:41 -0500
wrote:
> Hi,
>
> I'm new to opensaml, and I was able to solve most everything, but now I
> cannot encrypt an assertion and later decrypt it. The decrypter keeps
> telling me "Data encryption key may not be null".
>
>
>
Yeah, that means it can't successfully resolve the data decryption key,
and since you're using an encrypted key transported via an EncryptedKey,
ultimately it means it can't decrypt the EncryptedKey.
> BasicX509Credential credential = new BasicX509Credential();
> credential.setEntityCertificate(certificate);
>
> KeyInfoCredentialResolver keyResolver = new
> StaticKeyInfoCredentialResolver(credential);
>
> InlineEncryptedKeyResolver encryptionKeyResolver = new
> InlineEncryptedKeyResolver();
>
> Decrypter decrypter = new Decrypter(null, keyResolver,
> encryptionKeyResolver);
>
>
>
Remember that you decrypt with the recipient's private key. So you need
to also set the PrivateKey object on the Credential above with which you
are going to encrypt (the one that gets resolved and used by the Decrypter)
Offhand, everything else looks right, as far as I can tell.
--Brent
- Encrypt/Decrypt assertion, ivanhu, 12/13/2008
- Re: [OpenSAML] Encrypt/Decrypt assertion, Brent Putman, 12/15/2008
- Re: [OpenSAML] Encrypt/Decrypt assertion, Brent Putman, 12/15/2008
- Read saml1 response, Wang, Shengke, 12/15/2008
- Re: [OpenSAML] Read saml1 response, Chad La Joie, 12/15/2008
- Read saml1 response, Wang, Shengke, 12/15/2008
- Re: [OpenSAML] Read saml1 response, Chad La Joie, 12/15/2008
- RE: [OpenSAML] Read saml1 response, Wang, Shengke, 12/15/2008
- WSS4J with opensaml2, Wang, Shengke, 12/16/2008
- Re: [OpenSAML] WSS4J with opensaml2, Brent Putman, 12/16/2008
- RE: [OpenSAML] WSS4J with opensaml2, George Stanchev, 12/16/2008
- RE: [OpenSAML] WSS4J with opensaml2, Wang, Shengke, 12/16/2008
- Re: [OpenSAML] Read saml1 response, Chad La Joie, 12/15/2008
- Read saml1 response, Wang, Shengke, 12/15/2008
- Re: [OpenSAML] Read saml1 response, Chad La Joie, 12/15/2008
- Re: [OpenSAML] Encrypt/Decrypt assertion, Brent Putman, 12/15/2008
Archive powered by MHonArc 2.6.16.