1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-06-25 21:14:49 +02:00

Add SigningOptions.addDetachedSignature(protector, key) shortcut method

This commit is contained in:
Paul Schaub 2022-08-29 12:36:16 +02:00
parent 39ff2bca73
commit d1001412a1
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311

View file

@ -252,6 +252,23 @@ public final class SigningOptions {
return this;
}
/**
* Create a detached signature.
* The signature will be of type {@link DocumentSignatureType#BINARY_DOCUMENT}.
*
* @param secretKeyDecryptor decryptor to unlock the secret signing key
* @param signingKey signing key
* @return this
*
* @throws KeyException if something is wrong with the key
* @throws PGPException if the key cannot be validated or unlocked, or if no signature method can be created
*/
public SigningOptions addDetachedSignature(SecretKeyRingProtector secretKeyDecryptor,
PGPSecretKeyRing signingKey)
throws PGPException {
return addDetachedSignature(secretKeyDecryptor, signingKey, DocumentSignatureType.BINARY_DOCUMENT);
}
/**
* Create a detached signature.
* Detached signatures are not being added into the PGP message itself.