mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-25 04:17:59 +01:00
Kotlin conversion: UnprotectedKeysProtector
This commit is contained in:
parent
b82c49b7c0
commit
ccd209468a
2 changed files with 15 additions and 33 deletions
|
@ -1,33 +0,0 @@
|
||||||
// SPDX-FileCopyrightText: 2018 Paul Schaub <vanitasvitae@fsfe.org>
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
package org.pgpainless.key.protection;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor;
|
|
||||||
import org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Implementation of the {@link SecretKeyRingProtector} which assumes that all handled keys are not password protected.
|
|
||||||
*/
|
|
||||||
public class UnprotectedKeysProtector implements SecretKeyRingProtector {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasPassphraseFor(long keyId) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Nullable
|
|
||||||
public PBESecretKeyDecryptor getDecryptor(long keyId) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Nullable
|
|
||||||
public PBESecretKeyEncryptor getEncryptor(long keyId) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
// SPDX-FileCopyrightText: 2023 Paul Schaub <vanitasvitae@fsfe.org>
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
package org.pgpainless.key.protection
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementation of the [SecretKeyRingProtector] which assumes that all handled keys are not password protected.
|
||||||
|
*/
|
||||||
|
class UnprotectedKeysProtector : SecretKeyRingProtector {
|
||||||
|
override fun hasPassphraseFor(keyId: Long) = true
|
||||||
|
|
||||||
|
override fun getDecryptor(keyId: Long) = null
|
||||||
|
|
||||||
|
override fun getEncryptor(keyId: Long) = null
|
||||||
|
}
|
Loading…
Reference in a new issue