public final class FMEncProvider extends Object implements EncProvider
FMEncProvier
is a class for encrypting and
decrypting XML documents, it implements EncProvider
.Constructor and Description |
---|
FMEncProvider() |
Modifier and Type | Method and Description |
---|---|
Element |
decrypt(String xmlString,
Set<PrivateKey> privateKeys)
Decrypts an XML document that contains encrypted data.
|
Element |
encrypt(String xmlString,
Key recipientPublicKey,
SecretKey secretKey,
String dataEncAlgorithm,
int dataEncStrength,
String recipientEntityID,
String outerElementName)
Encrypts the root element of the given XML document.
|
Element |
encrypt(String xmlString,
Key recipientPublicKey,
String dataEncAlgorithm,
int dataEncStrength,
String recipientEntityID,
String outerElementName)
Encrypts the root element of the given XML document.
|
SecretKey |
getSecretKey(String xmlString,
Set<PrivateKey> privateKeys)
Returns the secret key that encrypts encrypted data and is encrypted
with recipient's public key in the XML document.
|
public Element encrypt(String xmlString, Key recipientPublicKey, String dataEncAlgorithm, int dataEncStrength, String recipientEntityID, String outerElementName) throws SAML2Exception
encrypt
in interface EncProvider
xmlString
- String representing an XML document whose root
element is to be encrypted.recipientPublicKey
- Public key used to encrypt the data encryption
(secret) key, it is the public key of the
recipient of the XML document to be encrypted.dataEncAlgorithm
- Data encryption algorithm.dataEncStrength
- Data encryption strength.recipientEntityID
- Unique identifier of the recipient, it is used
as the index to the cached secret key so that
the key can be reused for the same recipient;
It can be null in which case the secret key will
be generated every time and will not be cached
and reused. Note that the generation of a secret
key is a relatively expensive operation.outerElementName
- Name of the element that will wrap around the
encrypted data and encrypted key(s) sub-elementsSAML2Exception
- if there is an error during the encryption
processpublic Element encrypt(String xmlString, Key recipientPublicKey, SecretKey secretKey, String dataEncAlgorithm, int dataEncStrength, String recipientEntityID, String outerElementName) throws SAML2Exception
encrypt
in interface EncProvider
xmlString
- String representing an XML document whose root
element is to be encrypted.recipientPublicKey
- Public key used to encrypt the data encryption
(secret) key, it is the public key of the
recipient of the XML document to be encrypted.secretKey
- the secret key used to encrypted data.dataEncAlgorithm
- Data encryption algorithm.dataEncStrength
- Data encryption strength.recipientEntityID
- Unique identifier of the recipient, it is used
as the index to the cached secret key so that
the key can be reused for the same recipient;
It can be null in which case the secret key will
be generated every time and will not be cached
and reused. Note that the generation of a secret
key is a relatively expensive operation.outerElementName
- Name of the element that will wrap around the
encrypted data and encrypted key(s) sub-elementsSAML2Exception
- if there is an error during the encryption
processpublic SecretKey getSecretKey(String xmlString, Set<PrivateKey> privateKeys) throws SAML2Exception
EncProvider
getSecretKey
in interface EncProvider
xmlString
- String representing an XML document with encrypted
secret key.privateKeys
- Private keys used to decrypt the secret key.SAML2Exception
- if there is an error during the decryption
processpublic Element decrypt(String xmlString, Set<PrivateKey> privateKeys) throws SAML2Exception
EncProvider
decrypt
in interface EncProvider
xmlString
- String representing an XML document with encrypted
data.privateKeys
- Private keys used to decrypt the secret key.SAML2Exception
- if there is an error during the decryption
processCopyright © 2010–2025 Open Identity Platform Community. All rights reserved.