Skip to Content.
Sympa Menu

mace-opensaml-users - Re: [OpenSAML] getting and setting x509 credential

Subject: OpenSAML user discussion

List archive

Re: [OpenSAML] getting and setting x509 credential


Chronological Thread 
  • From: "JASON D'CRUZ" <>
  • To:
  • Subject: Re: [OpenSAML] getting and setting x509 credential
  • Date: Tue, 30 Mar 2010 20:49:09 +0530
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Z0y0rJ8RToarZ908DEkwWlksBRFhXzi5wFAmxU/QLGstLhkFrdZe6FdTz3u5xCWgEV vdxFTooJ5KkghuAy7vCXaUW4yftRqhzWji/b3ay3JTn41U80puRy6xhfMZneSPzzM0zk dHIvLiJHDPXrN2k849u6712q0H3UHBsWnoiDI=

check your package.

the setEntityCertficiate () method requires the java,security.cert.X509Certificate

You appear to have used the javax,security.cert.X509Certificate class

On Tue, Mar 30, 2010 at 8:39 PM, <> wrote:
Hello all,

I'm totally new to using SAML and OpenSAML in particular.  I need to create a sender-vouches assertion that is signed using an x509 key. (for NYS Heal5 HIE, if anyone is wondering)  I have the following code:

DefaultBootstrap.bootstrap(); // initialize the opensaml library
// jtc -- now, build the assertion
XMLObjectBuilderFactory builderFactory = Configuration.getBuilderFactory();
SAMLObjectBuilder<Assertion> builder = (SAMLObjectBuilder<Assertion>) builderFactory.getBuilder(Assertion.DEFAULT_ELEMENT_NAME);
Assertion assertion = builder.buildObject();
// jtc -- we have the naked assertion now.  let's add the interesting stuff.

// jtc - signature and credential
BasicX509Credential privateCredential = new BasicX509Credential();
InputStream inStream = new FileInputStream((String) samlInfoVector.get(0));
// position 0 has the key file
X509Certificate cert = X509Certificate.getInstance(inStream);
inStream.close();
privateCredential.setEntityCertificate(cert);

I'm having a problem with that last line, setting the EntityCertificate.  The error I'm getting is:

The method setEntityCertificate(X509Certificate) in the type BasicX509Credential is not applicable for the arguments (X509Certificate)

Any guidance on what's going here would be much appreciated.

Thanks
Jason Countryman



--
Regards,
Jason



Archive powered by MHonArc 2.6.16.

Top of Page