1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-22 19:08:00 +01:00

Depend on pgp-certificate-store again

This commit is contained in:
Paul Schaub 2022-08-12 15:05:42 +02:00
parent d486a17cf1
commit 6dc5b84d66
2 changed files with 7 additions and 6 deletions

View file

@ -32,8 +32,8 @@ import org.pgpainless.key.SubkeyIdentifier;
import org.pgpainless.key.info.KeyAccessor;
import org.pgpainless.key.info.KeyRingInfo;
import org.pgpainless.util.Passphrase;
import pgp.certificate_store.Certificate;
import pgp.certificate_store.CertificateStore;
import pgp.certificate_store.PGPCertificateStore;
import pgp.certificate_store.certificate.Certificate;
import pgp.certificate_store.exception.BadDataException;
import pgp.certificate_store.exception.BadNameException;
@ -242,7 +242,7 @@ public class EncryptionOptions {
}
/**
* Add a recipient by providing a {@link CertificateStore} and the {@link OpenPgpFingerprint} of the recipients key.
* Add a recipient by providing a {@link PGPCertificateStore} and the {@link OpenPgpFingerprint} of the recipients key.
* If no such certificate is found in the store, a {@link NoSuchElementException is thrown}.
*
* @param certificateStore certificate store
@ -253,7 +253,7 @@ public class EncryptionOptions {
* @throws IOException in case of an IO error
* @throws NoSuchElementException if the store does not contain a certificate for the given fingerprint
*/
public EncryptionOptions addRecipient(@Nonnull CertificateStore certificateStore,
public EncryptionOptions addRecipient(@Nonnull PGPCertificateStore certificateStore,
@Nonnull OpenPgpFingerprint certificateFingerprint)
throws BadDataException, BadNameException, IOException {
String fingerprint = certificateFingerprint.toString().toLowerCase();
@ -261,7 +261,8 @@ public class EncryptionOptions {
if (certificateRecord == null) {
throw new NoSuchElementException("Cannot find certificate '" + certificateFingerprint + "'");
}
PGPPublicKeyRing recipientCertificate = PGPainless.readKeyRing().publicKeyRing(certificateRecord.getInputStream());
PGPPublicKeyRing recipientCertificate = PGPainless.readKeyRing()
.publicKeyRing(certificateRecord.getInputStream());
return addRecipient(recipientCertificate);
}

View file

@ -17,7 +17,7 @@ allprojects {
junitVersion = '5.8.2'
logbackVersion = '1.2.11'
mockitoVersion = '4.5.1'
pgpCertificateStoreVersion = '0.1.1'
pgpCertificateStoreVersion = '0.1.2-SNAPSHOT'
slf4jVersion = '1.7.36'
sopJavaVersion = '4.0.7'
}