From 939c7230abd41d34ec44f67dc3728110b58ccfb1 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Wed, 27 Jun 2018 12:33:25 +0200 Subject: [PATCH] Add documentation to SecretKeyRingProtector --- .../pgpainless/key/SecretKeyRingProtector.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/vanitasvitae/crypto/pgpainless/key/SecretKeyRingProtector.java b/src/main/java/de/vanitasvitae/crypto/pgpainless/key/SecretKeyRingProtector.java index 6aa3cadd..9666b60a 100644 --- a/src/main/java/de/vanitasvitae/crypto/pgpainless/key/SecretKeyRingProtector.java +++ b/src/main/java/de/vanitasvitae/crypto/pgpainless/key/SecretKeyRingProtector.java @@ -15,13 +15,27 @@ */ package de.vanitasvitae.crypto.pgpainless.key; +import org.bouncycastle.openpgp.PGPException; import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor; import org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor; public interface SecretKeyRingProtector { + /** + * Return a decryptor for the key of id {@code keyId}. + * + * @param keyId id of the key + * @return decryptor for the key + */ PBESecretKeyDecryptor getDecryptor(Long keyId); - PBESecretKeyEncryptor getEncryptor(Long keyId); + /** + * Return an encryptor for the key of id {@code keyId}. + * + * @param keyId id of the key + * @return encryptor for the key + * @throws PGPException if the encryptor cannot be created for some reason + */ + PBESecretKeyEncryptor getEncryptor(Long keyId) throws PGPException; }