Class PgpSignatory
java.lang.Object
org.gradle.plugins.signing.signatory.SignatorySupport
org.gradle.plugins.signing.signatory.pgp.PgpSignatory
- All Implemented Interfaces:
Signatory
- Direct Known Subclasses:
PgpSignatoryInternal
PGP signatory from PGP key and password.
-
Constructor Summary
ConstructorsConstructorDescriptionPgpSignatory(String name, org.bouncycastle.openpgp.PGPSecretKey secretKey, String password) PgpSignatory(String name, Provider<org.bouncycastle.openpgp.PGPSecretKey> secretKey, Provider<org.bouncycastle.openpgp.PGPPrivateKey> privateKey) Creates a PGP signatory from secret and private key. -
Method Summary
Modifier and TypeMethodDescriptionorg.bouncycastle.openpgp.PGPSignatureGeneratorgetKeyId()Returns the id of the key that will be used for signing.final StringgetName()An identifying name for this signatory.voidsign(InputStream toSign, OutputStream signatureDestination) ExhauststoSign, and writes the signature tosignatureDestination.Methods inherited from class SignatorySupport
sign
-
Constructor Details
-
PgpSignatory
PgpSignatory(String name, Provider<org.bouncycastle.openpgp.PGPSecretKey> secretKey, Provider<org.bouncycastle.openpgp.PGPPrivateKey> privateKey) Creates a PGP signatory from secret and private key.Warning: the dependencies of providers aren't exposed anywhere. Consider using
PgpSignatoryFactoryto create instances of this class instead.- Parameters:
name- the name of the signatorysecretKey- the secret keyprivateKey- the private key extracted from the secret key
-
PgpSignatory
-
-
Method Details
-
getName
-
sign
ExhauststoSign, and writes the signature tosignatureDestination. The caller is responsible for closing the streams, though the output WILL be flushed.- Parameters:
toSign- The source of the data to be signedsignatureDestination- Where the signature will be written to
-
getKeyId
-
createSignatureGenerator
public org.bouncycastle.openpgp.PGPSignatureGenerator createSignatureGenerator()
-