Class SignMessageDecrypter
java.lang.Object
se.swedenconnect.opensaml.sweid.saml2.signservice.SignMessageDecrypter
A bean for decrypting encrypted messages within
SignMessage objects.- Author:
- Martin Lindström (martin@idsec.se)
-
Constructor Summary
ConstructorsConstructorDescriptionSignMessageDecrypter(List<Credential> decryptionCredentials) Constructor accepting several credentials (certificates or key pairs) to be used when decrypting.SignMessageDecrypter(Credential decryptionCredential) Constructor given the credential to use to decrypt the messages (certificate or key pair)SignMessageDecrypter(KeyInfoCredentialResolver keyEncryptionKeyResolver) Constructor accepting a key encryption key resolver. -
Method Summary
Modifier and TypeMethodDescriptiondecrypt(SignMessage signMessage) Decrypts the encrypted message of aSignMessageand returns the cleartextMessage.voidsetBlacklistedAlgorithms(Collection<String> blacklistedAlgorithms) Assigns a list of black listed algorithmsvoidsetPkcs11Workaround(boolean pkcs11Workaround) If using a HSM it is likely that the SunPKCS11 crypto provider is used.voidsetWhitelistedAlgorithms(Collection<String> whitelistedAlgorithms) Assigns a list of white listed algorithms
-
Constructor Details
-
SignMessageDecrypter
Constructor given the credential to use to decrypt the messages (certificate or key pair)- Parameters:
decryptionCredential- decryption credential
-
SignMessageDecrypter
Constructor accepting several credentials (certificates or key pairs) to be used when decrypting. This may be useful after a key rollover.- Parameters:
decryptionCredentials- decryption credentials
-
SignMessageDecrypter
Constructor accepting a key encryption key resolver.- Parameters:
keyEncryptionKeyResolver- the resolver
-
-
Method Details
-
decrypt
Decrypts the encrypted message of aSignMessageand returns the cleartextMessage.- Parameters:
signMessage- the element holding the encrypted message- Returns:
- a cleartext
Messageelement - Throws:
DecryptionException- for decryption errors
-
setBlacklistedAlgorithms
Assigns a list of black listed algorithms- Parameters:
blacklistedAlgorithms- non allowed algorithms
-
setWhitelistedAlgorithms
Assigns a list of white listed algorithms- Parameters:
whitelistedAlgorithms- white listed algorithms
-
setPkcs11Workaround
public void setPkcs11Workaround(boolean pkcs11Workaround) If using a HSM it is likely that the SunPKCS11 crypto provider is used. This provider does not have support for OAEP padding. This is used commonly for XML encryption sincehttp://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1pis the default algorithm to use for key encryption. This class has a workaround for this limitation that is enabled by setting thepkcs11Workaroundflag.- Parameters:
pkcs11Workaround- whether to run in PKCS11 workaround mode
-