Package org.gradle.plugins.signing.signatory.pgp

# Class PgpSignatoryInternal

java.lang.Object
org.gradle.plugins.signing.signatory.SignatorySupport
org.gradle.plugins.signing.signatory.pgp.PgpSignatory
org.gradle.plugins.signing.signatory.pgp.PgpSignatoryInternal

All Implemented Interfaces:
  `Signatory`

class PgpSignatoryInternal extends PgpSignatory
This is an implementation of PgpSignatory that uses `PgpSignatoryService` to cache computed keys.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PgpSignatoryInternal(Provider<org.gradle.plugins.signing.signatory.internal.pgp.PgpSignatoryService> signatoryService, String name, Provider<org.bouncycastle.openpgp.PGPSecretKey> secretKey, Provider<org.bouncycastle.openpgp.PGPPrivateKey> privateKey)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Provider<org.gradle.plugins.signing.signatory.internal.pgp.PgpSignatoryService>`
  `getSignatoryService()`
  A reference to the signatory service to adhere to the contract of `Task.usesService(Provider)`.
  `void`
  `sign(InputStream toSign, OutputStream signatureDestination)`
  Exhausts `toSign`, and writes the signature to `signatureDestination`.

  ### Methods inherited from class org.gradle.plugins.signing.signatory.pgp.PgpSignatory

  `createSignatureGenerator, getKeyId, getName`

  ### Methods inherited from class org.gradle.plugins.signing.signatory.SignatorySupport

  `sign`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### PgpSignatoryInternal

    public PgpSignatoryInternal(Provider<org.gradle.plugins.signing.signatory.internal.pgp.PgpSignatoryService> signatoryService, String name, Provider<org.bouncycastle.openpgp.PGPSecretKey> secretKey, Provider<org.bouncycastle.openpgp.PGPPrivateKey> privateKey)

- ## Method Details

  - ### getSignatoryService

    @ServiceReference public Provider<org.gradle.plugins.signing.signatory.internal.pgp.PgpSignatoryService> getSignatoryService()
    A reference to the signatory service to adhere to the contract of `Task.usesService(Provider)`. The service is used as a base of secretKey and privateKey providers.

  - ### sign

    public void sign(InputStream toSign, OutputStream signatureDestination)
    Description copied from class: `PgpSignatory`
    Exhausts `toSign`, and writes the signature to `signatureDestination`. The caller is responsible for closing the streams, though the output WILL be flushed.
    Specified by:
      `sign` in interface `Signatory`
    Overrides:
      `sign` in class `PgpSignatory`
    Parameters:
      `toSign` - The source of the data to be signed
      `signatureDestination` - Where the signature will be written to