Class SignMessageDecrypter
- java.lang.Object
-
- se.litsec.swedisheid.opensaml.saml2.signservice.SignMessageDecrypter
-
public class SignMessageDecrypter extends Object
A bean for decrypting encrypted messages withinSignMessageobjects.- Author:
- Martin Lindström (martin.lindstrom@litsec.se)
-
-
Constructor Summary
Constructors Constructor Description SignMessageDecrypter(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Messagedecrypt(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 Detail
-
SignMessageDecrypter
public SignMessageDecrypter(Credential decryptionCredential)
Constructor given the credential to use to decrypt the messages (certificate or key pair)- Parameters:
decryptionCredential- decryption credential
-
SignMessageDecrypter
public SignMessageDecrypter(List<Credential> decryptionCredentials)
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
public SignMessageDecrypter(KeyInfoCredentialResolver keyEncryptionKeyResolver)
Constructor accepting a key encryption key resolver.- Parameters:
keyEncryptionKeyResolver- the resolver
-
-
Method Detail
-
decrypt
public Message decrypt(SignMessage signMessage) throws DecryptionException
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
public void setBlacklistedAlgorithms(Collection<String> blacklistedAlgorithms)
Assigns a list of black listed algorithms- Parameters:
blacklistedAlgorithms- non allowed algorithms
-
setWhitelistedAlgorithms
public void setWhitelistedAlgorithms(Collection<String> whitelistedAlgorithms)
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
-
-