001// SPDX-FileCopyrightText: 2018 Paul Schaub <vanitasvitae@fsfe.org> 002// 003// SPDX-License-Identifier: Apache-2.0 004 005package org.pgpainless.key.protection; 006 007import javax.annotation.Nullable; 008 009import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor; 010import org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor; 011 012/** 013 * Implementation of the {@link SecretKeyRingProtector} which assumes that all handled keys are not password protected. 014 */ 015public class UnprotectedKeysProtector implements SecretKeyRingProtector { 016 017 @Override 018 public boolean hasPassphraseFor(Long keyId) { 019 return true; 020 } 021 022 @Override 023 @Nullable 024 public PBESecretKeyDecryptor getDecryptor(Long keyId) { 025 return null; 026 } 027 028 @Override 029 @Nullable 030 public PBESecretKeyEncryptor getEncryptor(Long keyId) { 031 return null; 032 } 033}