Search in sources :

Example 1 with DigestMethod

use of org.opensaml.saml.ext.saml2alg.DigestMethod in project pac4j by pac4j.

the class SAML2MetadataGenerator method generateMetadataExtensions.

protected final Extensions generateMetadataExtensions() {
    final SAMLObjectBuilder<Extensions> builderExt = (SAMLObjectBuilder<Extensions>) this.builderFactory.getBuilder(Extensions.DEFAULT_ELEMENT_NAME);
    final Extensions extensions = builderExt.buildObject();
    extensions.getNamespaceManager().registerAttributeName(DigestMethod.TYPE_NAME);
    final SAMLObjectBuilder<DigestMethod> builder = (SAMLObjectBuilder<DigestMethod>) this.builderFactory.getBuilder(DigestMethod.DEFAULT_ELEMENT_NAME);
    DigestMethod method = builder.buildObject();
    method.setAlgorithm("http://www.w3.org/2001/04/xmlenc#sha512");
    extensions.getUnknownXMLObjects().add(method);
    method = builder.buildObject();
    method.setAlgorithm("http://www.w3.org/2001/04/xmldsig-more#sha384");
    extensions.getUnknownXMLObjects().add(method);
    method = builder.buildObject();
    method.setAlgorithm("http://www.w3.org/2001/04/xmlenc#sha256");
    extensions.getUnknownXMLObjects().add(method);
    method = builder.buildObject();
    method.setAlgorithm("http://www.w3.org/2001/04/xmldsig-more#sha224");
    extensions.getUnknownXMLObjects().add(method);
    method = builder.buildObject();
    method.setAlgorithm("http://www.w3.org/2000/09/xmldsig#sha1");
    extensions.getUnknownXMLObjects().add(method);
    method = builder.buildObject();
    method.setAlgorithm("http://www.w3.org/2001/04/xmldsig-more#rsa-sha512");
    extensions.getUnknownXMLObjects().add(method);
    method = builder.buildObject();
    method.setAlgorithm("http://www.w3.org/2001/04/xmldsig-more#rsa-sha384");
    extensions.getUnknownXMLObjects().add(method);
    method = builder.buildObject();
    method.setAlgorithm("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256");
    extensions.getUnknownXMLObjects().add(method);
    method = builder.buildObject();
    method.setAlgorithm("http://www.w3.org/2000/09/xmldsig#rsa-sha1");
    extensions.getUnknownXMLObjects().add(method);
    method = builder.buildObject();
    method.setAlgorithm("http://www.w3.org/2000/09/xmldsig#dsa-sha1");
    extensions.getUnknownXMLObjects().add(method);
    return extensions;
}
Also used : SAMLObjectBuilder(org.opensaml.saml.common.SAMLObjectBuilder) DigestMethod(org.opensaml.saml.ext.saml2alg.DigestMethod) Extensions(org.opensaml.saml.saml2.metadata.Extensions)

Aggregations

SAMLObjectBuilder (org.opensaml.saml.common.SAMLObjectBuilder)1 DigestMethod (org.opensaml.saml.ext.saml2alg.DigestMethod)1 Extensions (org.opensaml.saml.saml2.metadata.Extensions)1