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 Countryman" <>
  • To:
  • Subject: Re: [OpenSAML] getting and setting x509 credential
  • Date: Tue, 30 Mar 2010 11:29:53 -0400

Thank you both, you guys were right on.  Changed the packaged to java.security.cert.X509Certificate and my code looks like this now:

CertificateFactory cf = CertificateFactory.getInstance("X.509");
X509Certificate cert = (X509Certificate)cf.generateCertificate(inStream);                 
inStream.close();                 
privateCredential.setEntityCertificate(cert);

You guys rock.


______________________________
Jason T. Countryman
Programmer
Community Computer Service


---------- Original Message -----------
From: "JASON D'CRUZ" <>
To:
Sent: Tue, 30 Mar 2010 20:49:09 +0530
Subject: Re: [OpenSAML] getting and setting x509 credential

> 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
------- End of Original Message -------
This message has been scanned for viruses and dangerous content by MailScanner, SpamAssassin & ClamAV.

This message and any attachments may contain information that is protected by law as privileged and confidential, and
is transmitted for the sole use of the intended recipient(s). If you are not the intended recipient, you are hereby notified
that any use, dissemination, copying or retention of this e-mail or the information contained herein is strictly prohibited.
If you received this e-mail in error, please immediately notify the sender by e-mail, and permanently delete this e-mail.



Archive powered by MHonArc 2.6.16.

Top of Page