use of org.opensaml.core.xml.io.MarshallingException in project spring-security by spring-projects.
the class OpenSamlSigningUtils method serialize.
static String serialize(XMLObject object) {
try {
Marshaller marshaller = XMLObjectProviderRegistrySupport.getMarshallerFactory().getMarshaller(object);
Element element = marshaller.marshall(object);
return SerializeSupport.nodeToString(element);
} catch (MarshallingException ex) {
throw new Saml2Exception(ex);
}
}
use of org.opensaml.core.xml.io.MarshallingException in project verify-hub by alphagov.
the class IdpMetadataPublicKeyStoreTest method idpEntityDescriptor.
private static EntityDescriptor idpEntityDescriptor(String idpEntityId, String public_signing_certificate) {
KeyDescriptor keyDescriptor = buildKeyDescriptor(public_signing_certificate);
IDPSSODescriptor idpssoDescriptor = IdpSsoDescriptorBuilder.anIdpSsoDescriptor().addKeyDescriptor(keyDescriptor).withoutDefaultSigningKey().build();
try {
return EntityDescriptorBuilder.anEntityDescriptor().withEntityId(idpEntityId).withIdpSsoDescriptor(idpssoDescriptor).withValidUntil(DateTime.now().plusWeeks(2)).withSignature(null).withoutSigning().setAddDefaultSpServiceDescriptor(false).build();
} catch (MarshallingException | SignatureException e) {
throw new RuntimeException(e);
}
}
Aggregations