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 ddf by codice.
the class AttributeQueryClient method createSoapMessage.
/**
* Creates a SOAP message of the AttributeQuery request.
*
* @param attributeQuery is added to the SOAP message
* @return soapElement is the Element of the SOAP message
*/
private Element createSoapMessage(AttributeQuery attributeQuery) throws AttributeQueryException {
LOGGER.debug("Creating SOAP message from the SAML AttributeQuery.");
Envelope envelope = SamlProtocol.createSoapMessage(attributeQuery);
LOGGER.debug("SOAP message from the SAML AttributeQuery created.");
try {
return new EnvelopeMarshaller().marshall(envelope);
} catch (MarshallingException e) {
throw new AttributeQueryException("Cannot marshall SOAP object to an Element.", e);
}
}
use of org.opensaml.core.xml.io.MarshallingException in project verify-hub by alphagov.
the class NodeMetadataFactory method createCountryEntityDescriptor.
public static EntityDescriptor createCountryEntityDescriptor(String entityID) {
Signature entityDescriptorSignature = createSignature();
KeyDescriptor keyDescriptor = KeyDescriptorBuilder.aKeyDescriptor().withX509ForSigning(TEST_PUBLIC_CERT).build();
IDPSSODescriptor idpssoDescriptor = IdpSsoDescriptorBuilder.anIdpSsoDescriptor().addKeyDescriptor(keyDescriptor).build();
try {
return getEntityDescriptor(entityID, idpssoDescriptor, entityDescriptorSignature);
} catch (MarshallingException | SignatureException e) {
throw Throwables.propagate(e);
}
}
use of org.opensaml.core.xml.io.MarshallingException in project verify-hub by alphagov.
the class NodeMetadataFactory method createCountryEntityDescriptor.
public static EntityDescriptor createCountryEntityDescriptor(String entityID) {
Signature entityDescriptorSignature = createSignature();
KeyDescriptor keyDescriptor = KeyDescriptorBuilder.aKeyDescriptor().withX509ForSigning(TEST_PUBLIC_CERT).build();
IDPSSODescriptor idpssoDescriptor = IdpSsoDescriptorBuilder.anIdpSsoDescriptor().addKeyDescriptor(keyDescriptor).build();
try {
return getEntityDescriptor(entityID, idpssoDescriptor, entityDescriptorSignature);
} catch (MarshallingException | SignatureException e) {
throw Throwables.propagate(e);
}
}
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);
}
}
Aggregations