Interface DecryptionProvider

  • All Superinterfaces:
    org.refcodes.security.Decrypter<String,String,org.refcodes.security.DecryptionException>
    All Known Implementing Classes:
    DecryptionProviderImpl


    public interface DecryptionProvider
    extends org.refcodes.security.Decrypter<String,String,org.refcodes.security.DecryptionException>
    The DecryptionProvider is bound to a namespace and is being used by the business logic to decrypt data.

    The DecryptionProvider provides decrypting functionality as encrypted data must be decrypted again by another service or system. This system must now be able to retrieve all known ciphers versions (by a DecryptionService) for determining the correct cipher for decrypting encrypted text (as encrypted text is prefixed by the cipher UID identifying the cipher to use for decryption).

    • Method Detail

      • toDecrypted

        String toDecrypted​(String aEncryptedText)
                    throws UnknownCipherUidException,
                           NoCipherUidException
        Encrypts a text with the latest known valid cipher.
        Specified by:
        toDecrypted in interface org.refcodes.security.Decrypter<String,String,org.refcodes.security.DecryptionException>
        Parameters:
        aEncryptedText - The text to be encrypted
        Returns:
        The encrypted text with a version prefixed identifying the cipher being used for encryption.
        Throws:
        UnknownCipherUidException - in case the cipher UID prefixed to the encrypted text is unknown
        NoCipherUidException - in case no cipher UID was found prefixed to the provided text.