use of org.keycloak.dom.saml.v2.assertion.EncryptedAssertionType in project keycloak by keycloak.
the class SAML2Response method getEncryptedAssertion.
/**
* Get an encrypted assertion from the stream
*
* @param is
*
* @return
*
* @throws org.keycloak.saml.common.exceptions.ParsingException
* @throws ProcessingException
* @throws ConfigurationException
*/
public EncryptedAssertionType getEncryptedAssertion(InputStream is) throws ParsingException, ConfigurationException, ProcessingException {
if (is == null)
throw logger.nullArgumentError("InputStream");
Document samlDocument = DocumentUtil.getDocument(is);
SAMLParser samlParser = SAMLParser.getInstance();
JAXPValidationUtil.checkSchemaValidation(samlDocument);
return (EncryptedAssertionType) samlParser.parse(samlDocument);
}
use of org.keycloak.dom.saml.v2.assertion.EncryptedAssertionType in project keycloak by keycloak.
the class SAMLParserTest method testSaml20EncryptedAssertion.
@Test
public void testSaml20EncryptedAssertion() throws Exception {
EncryptedAssertionType ea = assertParsed("saml20-assertion-encrypted.xml", EncryptedAssertionType.class);
assertThat(ea, notNullValue());
assertThat(ea.getEncryptedElement(), notNullValue());
assertThat(ea.getEncryptedElement().getLocalName(), is("EncryptedAssertion"));
}
Aggregations