<HTML>
<P>
<STYLE> BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }</STYLE>
Hi, all. I want to programmatically retrieve the certificate (public key) of a particular SP during an authentication session (because I want to encrypt an attribute so that only they can ever decrypt it). How can I do this?</P>
<P>I can get the IDP's certificate from my statically stored ApplicationContext using:</P>
<P>((org.opensaml.xml.security.x509.X509Credential)((edu.internet2.middleware.shibboleth.common.relyingparty.provider.SAMLMDRelyingPartyConfigurationManager)appContext.getApplicationContext().getBean("shibboleth.RelyingPartyConfigurationManager")).getRelyingPartyConfigurations()<br>
.get("default").getDefaultSigningCredential()).getEntityCertificate()</P>
<P>If I replace the get("default") with get(<entity ID of SP>), it still returns the same key to me.</P>
<P>Any suggestions?</P>
<P>Thanks!</P>
<P>-Ken</P></HTML>