use of xmlbeans.org.oasis.saml2.metadata.EntityDescriptorDocument in project unity by unity-idm.
the class MetadataVerificator method validateSingle.
protected void validateSingle(EntityDescriptorType meta, Date now, MetadataSignatureValidation sigValidation, X509Certificate issuerCertificate) throws MetadataValidationException {
if (meta.isSetValidUntil() && meta.getValidUntil().after(now))
throw new MetadataValidationException("Metadata or its part expired on " + meta.getValidUntil());
if (sigValidation == MetadataSignatureValidation.require) {
EntityDescriptorDocument tmp = EntityDescriptorDocument.Factory.newInstance();
tmp.setEntityDescriptor(meta);
validateSignature(issuerCertificate, meta.getEntityID(), (Document) tmp.getDomNode());
}
}
use of xmlbeans.org.oasis.saml2.metadata.EntityDescriptorDocument in project unity by unity-idm.
the class MetadataServlet method serveMetadata.
protected void serveMetadata(MetadataProvider metaProvider, HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.setContentType("application/samlmetadata+xml");
EntityDescriptorDocument meta;
try {
meta = metaProvider.getMetadata();
} catch (Exception e) {
log.error("Problem generating SAML metadata document.", e);
resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Problem occured when generating metadata.");
return;
}
PrintWriter writer = resp.getWriter();
writer.write(meta.xmlText());
writer.flush();
}
Aggregations