Interface EncryptionProvider

    • Method Detail

      • 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 Strength
        providerID - 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 Strength
        providerID - 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
      • decryptKey

        Key decryptKey​(Element encryptedKey,
                       String certAlias)
        Decrypt the given encrypted key.
        Parameters:
        encryptedKey - the encrypted key element
        certAlias - the private key alias
        Returns:
        the key associated with the decrypted key.