Class MapBasedPassphraseProvider

    • Constructor Detail

      • MapBasedPassphraseProvider

        public MapBasedPassphraseProvider​(java.util.Map<java.lang.Long,​Passphrase> passphraseMap)
        Create a new map based passphrase provider.
        Parameters:
        passphraseMap - map of key-ids and passphrases
    • Method Detail

      • getPassphraseFor

        @Nullable
        public Passphrase getPassphraseFor​(java.lang.Long keyId)
        Description copied from interface: SecretKeyPassphraseProvider
        Return a passphrase for the given key. If no record has been found, return null. Note: In case of an unprotected secret key, this method must may not return null, but a Passphrase with a content of null.
        Specified by:
        getPassphraseFor in interface SecretKeyPassphraseProvider
        Parameters:
        keyId - if of the secret key
        Returns:
        passphrase or null, if no passphrase record has been found.