/** * Sets the entity certificate for this credential. * * @param cert entity certificate for this credential */ public void setEntityCertificate(X509Certificate cert) { entityCert = cert; if (cert != null) { setPublicKey(cert.getPublicKey()); } else { setPublicKey(null); } }
/** * Sets the entity certificate for this credential. * * @param cert entity certificate for this credential */ public void setEntityCertificate(X509Certificate cert) { entityCert = cert; if (cert != null) { setPublicKey(cert.getPublicKey()); } else { setPublicKey(null); } }
private static Credential getCredential(X509Certificate certificate) { BasicX509Credential credential = new BasicX509Credential(); credential.setEntityCertificate(certificate); credential.setPublicKey(certificate.getPublicKey()); credential.setCRLs(Collections.emptyList()); return credential; }
basicX509Credential.setEntityCertificate(x509cert); basicX509Credential.setPrivateKey((PrivateKey) keystore.getKey(keystoreAlias, keystoreAliasPassword)); basicX509Credential.setPublicKey(keystore.getCertificate(keystoreAlias).getPublicKey()); credential = basicX509Credential; break;
/** * Validate the specified opensaml XML Signature * * @param signature * the XML signature * @return list of {@link X509Certificate}'s in the XML signature * @throws CertificateException * something went wrong extracting the certificates from the XML * Signature. * @throws ValidationException * validation failed */ public static List<X509Certificate> validateSignature(Signature signature) throws CertificateException, ValidationException { List<X509Certificate> certChain = KeyInfoHelper .getCertificates(signature.getKeyInfo()); SAMLSignatureProfileValidator pv = new SAMLSignatureProfileValidator(); pv.validate(signature); BasicX509Credential credential = new BasicX509Credential(); credential.setPublicKey(getEndCertificate(certChain).getPublicKey()); SignatureValidator sigValidator = new SignatureValidator(credential); sigValidator.validate(signature); return certChain; }
credential.setPublicKey(credential.getEntityCertificate().getPublicKey());
credential.setEntityCertificate(samlKeyInfo.getCerts()[0]); } else if (samlKeyInfo.getPublicKey() != null) { credential.setPublicKey(samlKeyInfo.getPublicKey()); } else { throw new WSSecurityException(
credential.setEntityCertificate(samlKeyInfo.getCerts()[0]); } else if (samlKeyInfo.getPublicKey() != null) { credential.setPublicKey(samlKeyInfo.getPublicKey()); } else { throw new WSSecurityException(
keyInfoCredential.setEntityCertificate(keyInfo.getCertificate()); } else if (keyInfo.getPublicKey() != null) { keyInfoCredential.setPublicKey(keyInfo.getPublicKey());
keyInfoCredential.setEntityCertificate(keyInfo.getCertificate()); } else if (keyInfo.getPublicKey() != null) { keyInfoCredential.setPublicKey(keyInfo.getPublicKey());
keyInfoCredential.setEntityCertificate(keyInfo.getCertificate()); } else if (keyInfo.getPublicKey() != null) { keyInfoCredential.setPublicKey(keyInfo.getPublicKey());