Skip to Content.
Sympa Menu

mace-opensaml-users - Re: [OpenSAML] Problems creating KeyInfo object

Subject: OpenSAML user discussion

List archive

Re: [OpenSAML] Problems creating KeyInfo object


Chronological Thread 
  • From: "Joana M. F. Trindade" <>
  • To:
  • Subject: Re: [OpenSAML] Problems creating KeyInfo object
  • Date: Wed, 25 Jun 2008 23:08:49 -0300
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=gCNR4T6EoI2IprppN7Gi8VSp+ZUGm1/Tyow5FMV4C/0mCzVzhn3LDFzrkEbINPB90m W+HK4qxKSO+Oy52VlxB2p0OscHpO0a5du0Q5WD/fX2fgab2Aqds7g8CEzLKMw0S9JyYc B+NyR40d8lG//e1uMX708LEQcc7fhaEmaoN2U=

Hi Kurt,

Thanks a lot for your suggestion. I browsed through the xmltooling code for SecurityHelper and KeyInfoHelper, and it solved it :-)

Now what I have is this:

// ----
Signature signature = (Signature)Configuration.getBuilderFactory()
.getBuilder(Signature.DEFAULT_ELEMENT_NAME).buildObject(Signature.DEFAULT_ELEMENT_NAME);

signature.setSigningCredential(credential);
signature.setSignatureAlgorithm(SignatureConstants.ALGO_ID_SIGNATURE_RSA);
            signature.setCanonicalizationAlgorithm(SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);

/* changed */
KeyInfoGenerator kiGenerator = SecurityHelper.getKeyInfoGenerator(credential, null, null);
KeyInfo keyInfo = kiGenerator.generate(credential);
KeyInfoHelper.addCertificate(keyInfo, (X509Certificate));
/* changed */
                      
signature.setKeyInfo(keyInfo);
// ----

Thanks,
Joana
--
Joana M. F. da Trindade

Email:
Personal Homepage: http://www.inf.ufrgs.br/~jmftrindade
LinkedIn: http://www.linkedin.com/in/joanatrindade


Archive powered by MHonArc 2.6.16.

Top of Page