public class SignMessageFactory extends Object
SignMessage
.Constructor and Description |
---|
SignMessageFactory(se.litsec.opensaml.saml2.metadata.provider.MetadataProvider federationMetadataProvider)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
SignMessage |
create(String message,
SignMessageMimeTypeEnum mimeType,
Boolean mustShow,
String displayEntity,
boolean encrypt)
Creates a
SignMessage object. |
EncryptedMessage |
encrypt(Message message,
Credential credential)
Given a
Message object and key encryption credentials the method encrypts the message into a
EncryptedMessage object. |
Credential |
getKeyEncryptionCredential(String idpEntityID)
Locates a encryption credential for the given IdP from the federaion metadata.
|
void |
setEncryptionAlgorithmId(String encryptionAlgorithmId)
Assigns the encryption algorithm to use when encrypting messages.
|
public SignMessageFactory(se.litsec.opensaml.saml2.metadata.provider.MetadataProvider federationMetadataProvider)
federationMetadataProvider
- the federation metadata that is used for locating IdP encryption keyspublic SignMessage create(String message, SignMessageMimeTypeEnum mimeType, Boolean mustShow, String displayEntity, boolean encrypt) throws ResolverException, EncryptionException
SignMessage
object.message
- the message to include (in cleartext)mimeType
- the MIME type of the messagemustShow
- when this parameter is set to true
then the requested signature MUST NOT be created unless this
message has been displayed and accepted by the signerdisplayEntity
- the entityID of the entity responsible for displaying the sign message to the signer. When the sign
message is encrypted, then this entity is also the holder of the private decryption key necessary to
decrypt the sign messageencrypt
- should the message be encryped?SignMessage
objectResolverException
- for metadata related errorsEncryptionException
- for encryption errorspublic Credential getKeyEncryptionCredential(String idpEntityID)
idpEntityID
- the IdP entityIDnull
if none is foundpublic EncryptedMessage encrypt(Message message, Credential credential) throws EncryptionException
Message
object and key encryption credentials the method encrypts the message into a
EncryptedMessage
object.message
- the message to encryptcredential
- the key encryption credential (IdP public key/certificate)EncryptedMessage
objectEncryptionException
- for encryption errorspublic void setEncryptionAlgorithmId(String encryptionAlgorithmId)
The default is EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES128
.
Note that if an algorithm that uses larger keys is required the JCE unlimited strength policy files must be installed. For Java 8, download it from http://www.oracle.com/ technetwork/java/javase/downloads/jce8-download-2133166.html.
encryptionAlgorithmId
- the algorithm to assignCopyright © 2018 Litsec AB. All rights reserved.