<HTML>
<P>
<STYLE> BODY { font-family:Arial, Helvetica, sans-serif;font-size:12px; }</STYLE>
Hi, all.&nbsp; I want to programmatically retrieve the certificate&nbsp;(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).&nbsp; 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>

&nbsp;&nbsp;&nbsp;&nbsp; .get("default").getDefaultSigningCredential()).getEntityCertificate()</P>
<P>If I replace the get("default") with get(&lt;entity ID of SP&gt;), it still returns the same key to me.</P>
<P>Any suggestions?</P>
<P>Thanks!</P>
<P>-Ken</P></HTML>