Package com.sun.identity.xmlenc
Interface EncryptionProvider
-
- All Known Implementing Classes:
AMEncryptionProvider
,WSSEncryptionProvider
public interface EncryptionProvider
EncryptionProvier
is an interface for encrypting and decrypting XML documents.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Document
decryptAndReplace(Document encryptedDoc, String certAlias)
Decrypts an XML Document that contains encrypted data.Document
decryptAndReplace(Document encryptedDoc, Key privKey)
Decrypts an XML Document that contains encrypted data.Key
decryptKey(Element encryptedKey, String certAlias)
Decrypt the given encrypted key.Document
encryptAndReplace(Document doc, Element element, String secretKeyAlg, int keyStrength, String certAlias, int kekStrength)
Encrypts the given XML element in a given XML Context document.Document
encryptAndReplace(Document doc, Element element, String secretKeyAlg, int keyStrength, String certAlias, int kekStrength, String providerID)
Encrypts the given XML element in a given XML Context document.Document
encryptAndReplace(Document doc, Element element, String secretKeyAlg, int keyStrength, Key kek, int kekStrength, String providerID)
Encrypts the given XML element in a given XML Context document.Document
encryptAndReplaceResourceID(Document doc, Element element, String secretKeyAlg, int keyStrength, String certAlias, int kekStrength, String providerID)
Encrypts the given ResourceID XML element in a given XML Context document.Document
encryptAndReplaceResourceID(Document doc, Element element, String secretKeyAlg, int keyStrength, Key kek, int kekStrength, String providerID)
Encrypts the given XML element in a given XML Context document.Document
encryptAndReplaceWSSElements(Document doc, Map elmMap, String encDataEncAlg, int encDataEncAlgStrength, String certAlias, int kekStrength, String tokenType, String providerID)
Encrypts the given WSS XML element in a given XML Context document.void
initialize(KeyProvider keyProvider)
Initializes encryption provider.
-
-
-
Method Detail
-
initialize
void initialize(KeyProvider keyProvider) throws EncryptionException
Initializes encryption provider.- Throws:
EncryptionException
-
encryptAndReplace
Document encryptAndReplace(Document doc, Element element, String secretKeyAlg, int keyStrength, String certAlias, int kekStrength) throws EncryptionException
Encrypts the given XML element in a given XML Context document.- Parameters:
doc
- the context XML Document.element
- Element to be encrypted.secretKeyAlg
- Encryption Key Algorithm.keyStrength
- Encryption Key Strength.certAlias
- KeyEncryption Key cert alias.kekStrength
- Key Encryption Key Strength.- Returns:
- org.w3c.dom.Document XML Document replaced with encrypted data for a given XML element.
- Throws:
EncryptionException
-
encryptAndReplace
Document encryptAndReplace(Document doc, Element element, String secretKeyAlg, int keyStrength, String certAlias, int kekStrength, String providerID) throws EncryptionException
Encrypts the given XML element in a given XML Context document.- Parameters:
doc
- the context XML Document.element
- Element to be encrypted.secretKeyAlg
- Encryption Key Algorithm.keyStrength
- Encryption Key Strength.certAlias
- KeyEncryption Key cert alias.kekStrength
- Key Encryption Key Strength.- Returns:
- org.w3c.dom.Document XML Document replaced with encrypted data for a given XML element.
- Throws:
EncryptionException
-
encryptAndReplaceResourceID
Document encryptAndReplaceResourceID(Document doc, Element element, String secretKeyAlg, int keyStrength, String certAlias, int kekStrength, String providerID) throws EncryptionException
Encrypts the given ResourceID XML element in a given XML Context document.- Parameters:
doc
- the context XML Document.element
- Element to be encrypted.secretKeyAlg
- Encryption Key Algorithm.keyStrength
- Encryption Key Strength.certAlias
- KeyEncryption Key cert alias.kekStrength
- Key Encryption Key Strength.- Returns:
- org.w3c.dom.Document EncryptedResourceID XML Document.
- Throws:
EncryptionException
-
encryptAndReplace
Document encryptAndReplace(Document doc, Element element, String secretKeyAlg, int keyStrength, Key kek, int kekStrength, String providerID) throws EncryptionException
Encrypts the given XML element in a given XML Context document.- Parameters:
doc
- the context XML Document.element
- Element to be encrypted.secretKeyAlg
- Encryption Key Algorithm.keyStrength
- Encryption Key Strength.kek
- Key Encryption Key.kekStrength
- Key Encryption Key StrengthproviderID
- Provider ID.- Returns:
- org.w3c.dom.Document XML Document replaced with encrypted data for a given XML element.
- Throws:
EncryptionException
-
encryptAndReplaceResourceID
Document encryptAndReplaceResourceID(Document doc, Element element, String secretKeyAlg, int keyStrength, Key kek, int kekStrength, String providerID) throws EncryptionException
Encrypts the given XML element in a given XML Context document.- Parameters:
doc
- the context XML Document.element
- Element to be encrypted.secretKeyAlg
- Encryption Key Algorithm.keyStrength
- Encryption Key Strength.kek
- Key Encryption Key.kekStrength
- Key Encryption Key StrengthproviderID
- Provider ID.- Returns:
- org.w3c.dom.Document XML Document replaced with encrypted data for a given XML element.
- Throws:
EncryptionException
-
encryptAndReplaceWSSElements
Document encryptAndReplaceWSSElements(Document doc, Map elmMap, String encDataEncAlg, int encDataEncAlgStrength, String certAlias, int kekStrength, String tokenType, String providerID) throws EncryptionException
Encrypts the given WSS XML element in a given XML Context document.- Parameters:
doc
- the context XML Document.elmMap
- Map of (Element, wsu_id) to be encrypted.encDataEncAlg
- Encryption Key Algorithm.encDataEncAlgStrength
- Encryption Key Strength.certAlias
- Key Encryption Key cert alias.kekStrength
- Key Encryption Key Strength.tokenType
- Security token type.providerID
- Provider ID.- Returns:
- org.w3c.dom.Document XML Document replaced with encrypted data for a given XML element.
- Throws:
EncryptionException
-
decryptAndReplace
Document decryptAndReplace(Document encryptedDoc, String certAlias) throws EncryptionException
Decrypts an XML Document that contains encrypted data.- Parameters:
encryptedDoc
- XML Document with encrypted data.certAlias
- Private Key Certificate Alias.- Returns:
- org.w3c.dom.Document Decrypted XML Document.
- Throws:
EncryptionException
-
decryptAndReplace
Document decryptAndReplace(Document encryptedDoc, Key privKey) throws EncryptionException
Decrypts an XML Document that contains encrypted data.- Parameters:
encryptedDoc
- XML Document with encrypted data.privKey
- Key Encryption Key used for encryption.- Returns:
- org.w3c.dom.Document Decrypted XML Document.
- Throws:
EncryptionException
-
-