Search in sources :

Example 1 with DecryptionException

use of org.opensaml.xmlsec.encryption.support.DecryptionException in project verify-hub by alphagov.

the class AssertionDecrypter method decrypt.

private Assertion decrypt(EncryptedAssertion encryptedAssertion) {
    Decrypter decrypter = new DecrypterFactory().createDecrypter(ImmutableList.of(new BasicCredential(publicKey, privateKey)));
    decrypter.setRootInNewDocument(true);
    try {
        return decrypter.decrypt(encryptedAssertion);
    } catch (DecryptionException e) {
        throw new RuntimeException(e);
    }
}
Also used : DecrypterFactory(uk.gov.ida.saml.security.DecrypterFactory) Decrypter(org.opensaml.saml.saml2.encryption.Decrypter) DecryptionException(org.opensaml.xmlsec.encryption.support.DecryptionException) BasicCredential(org.opensaml.security.credential.BasicCredential)

Aggregations

Decrypter (org.opensaml.saml.saml2.encryption.Decrypter)1 BasicCredential (org.opensaml.security.credential.BasicCredential)1 DecryptionException (org.opensaml.xmlsec.encryption.support.DecryptionException)1 DecrypterFactory (uk.gov.ida.saml.security.DecrypterFactory)1