Skip to Content.
Sympa Menu

mace-opensaml-users - XML Encryption with openSAML

Subject: OpenSAML user discussion

List archive

XML Encryption with openSAML


Chronological Thread 
  • From: Deena Gurajala <>
  • To:
  • Subject: XML Encryption with openSAML
  • Date: Mon, 14 Sep 2009 09:04:05 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=gck6TH4PMWHmDqvluqpbJBnQGto30oJBfwxW0bgHRZuG4DTfGnkFjwxqFakucTf9WV J9S433VP1gza0ikj9PfNoPejsHHo9Fne8G4X2X4hC6z0u1z1zgSkQKcGSeZbKQDdSrzP Q49UWSD7wNZmABbpTausRHCTMyx4xn/2DpbQA=

Hi,

How can we achieve the XML encryption with openSAML library as per SAML 2.0 Spec where it involves both Digital Signature and XML encryption.

SAML 2.0 Spec says the following.

"When a signed <Assertion> element is encrypted, the signature MUST first be calculated and placed within the <Assertion> element before the element is encrypted."

How can we achieve the above? I was able to successfully encrypt the assertion using openSAML. I also know how to do sign the message. But I don't know how to do as it stated in spec.

I was trying to do this.

Response response=getResponse();
Assertion assertion=getAssertion();

Signature signature=getSignature();
assertion.setSignature(
signature);

EncryptedAssertion encAssertion=getEncryptedAssertion(assertion);
response.getEncryptedAssertion.add(encAssertion);

MarshallerFactory marshalFact = Configuration .getMarshallerFactory();
Marshaller marshaller = marshalFact.getMarshaller(response);
Element responseElement = marshaller.marshall(response);

 Signer.signObject(signature);

But I don't see any signature when decrypt the assertion. It has signature in the assertion element. But signature value is empty.

Can some body provide me steps?




Archive powered by MHonArc 2.6.16.

Top of Page