Class UnprotectedKeysProtector

java.lang.Object
org.pgpainless.key.protection.UnprotectedKeysProtector
All Implemented Interfaces:
SecretKeyRingProtector

public class UnprotectedKeysProtector extends Object implements SecretKeyRingProtector
Implementation of the SecretKeyRingProtector which assumes that all handled keys are not password protected.
  • Constructor Details

    • UnprotectedKeysProtector

      public UnprotectedKeysProtector()
  • Method Details

    • hasPassphraseFor

      public boolean hasPassphraseFor(Long keyId)
      Specified by:
      hasPassphraseFor in interface SecretKeyRingProtector
    • getDecryptor

      @Nullable public org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor getDecryptor(Long keyId)
      Description copied from interface: SecretKeyRingProtector
      Return a decryptor for the key of id keyId. This method returns null if the key is unprotected.
      Specified by:
      getDecryptor in interface SecretKeyRingProtector
      Parameters:
      keyId - id of the key
      Returns:
      decryptor for the key
    • getEncryptor

      @Nullable public org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor getEncryptor(Long keyId)
      Description copied from interface: SecretKeyRingProtector
      Return an encryptor for the key of id keyId. This method returns null if the key is unprotected.
      Specified by:
      getEncryptor in interface SecretKeyRingProtector
      Parameters:
      keyId - id of the key
      Returns:
      encryptor for the key