Code example for X509Certificate

Methods: getPublicKey

0
    /** {@inheritDoc} */ 
    protected void setUp() throws Exception { 
        super.setUp(); 
         
        entityCert = SecurityHelper.buildJavaX509Cert(entityCertBase64);
        entityCert.getPublicKey();
        subjectName = new X500Principal("cn=foobar.example.org, O=Internet2");
         
        credential = new BasicX509Credential();
        credential.setEntityCertificate(entityCert);
         
        certSelector = new X509CertSelector();
         
        evalCrit = new EvaluableX509CertSelectorCredentialCriteria(certSelector);
    } 
     
    public void testSatifsyByCert() { 
        certSelector.setCertificate(entityCert);
        assertTrue("Credential should have matched the evaluable criteria", evalCrit.evaluate(credential));
    }