# Interface Signatory

All Known Implementing Classes:
  `PgpSignatory, PgpSignatoryInternal, SignatorySupport`

public interface Signatory
A signatory is an object capable of providing a signature for an arbitrary stream of bytes.

Since:
  1.0

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getKeyId()`
  Returns the id of the key that will be used for signing.
  `String`
  `getName()`
  An identifying name for this signatory.
  `byte[]`
  `sign(InputStream toSign)`
  Exhausts `toSign`, and returns the raw signature bytes.
  `void`
  `sign(InputStream toSign, OutputStream destination)`
  Exhausts `toSign`, and writes the signature to `signatureDestination`.

- ## Method Details

  - ### getName

    @Internal String getName()

    An identifying name for this signatory.

    The name must be constant for the life of the signatory and should uniquely identify it within a project.

    Since:
      1.0

  - ### sign

    void sign(InputStream toSign, OutputStream destination)
    Exhausts `toSign`, and writes the signature to `signatureDestination`. The caller is responsible for closing the streams, though the output WILL be flushed.
    Parameters:
      `toSign` - The source of the data to be signed
      `destination` - Where the signature will be written to
    Since:
      1.0

  - ### sign

    byte[] sign(InputStream toSign)
    Exhausts `toSign`, and returns the raw signature bytes.
    Parameters:
      `toSign` - The source of the data to be signed
    Returns:
      The raw bytes of the signature
    Since:
      1.0

  - ### getKeyId

    @Input @Optional String getKeyId()
    Returns the id of the key that will be used for signing.
    Returns:
      The key id
    Since:
      4.5