# Class PgpSignatoryFactory

java.lang.Object
org.gradle.plugins.signing.signatory.pgp.PgpSignatoryFactory

public class PgpSignatoryFactory extends Object
Creates `PgpSignatory` instances.

Since:
  1.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PgpSignatoryFactory()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `PgpSignatory`
  `createSignatory(String name, String keyId, File keyRing, String password)`
  Create signatory.
  `PgpSignatory`
  `createSignatory(String name, org.bouncycastle.openpgp.PGPSecretKey secretKey, String password)`
  Create signatory.
  `PgpSignatory`
  `createSignatory(Project project)`
  Create signatory.
  `PgpSignatory`
  `createSignatory(Project project, boolean required)`
  Create signatory.
  `PgpSignatory`
  `createSignatory(Project project, String propertyPrefix)`
  Create signatory.
  `PgpSignatory`
  `createSignatory(Project project, String propertyPrefix, boolean required)`
  Create signatory.
  `PgpSignatory`
  `createSignatory(Project project, String name, @Nullable String keyId, String key, String password)`
  Creates a `PgpSignatory` named `name` based on the private key with id `keyId` stored in the ASCII-armored `key` with `password` password.
  `PgpSignatory`
  `createSignatory(Project project, String propertyPrefix, String name)`
  Create signatory.
  `PgpSignatory`
  `createSignatory(Project project, String propertyPrefix, String name, boolean required)`
  Create signatory.
  `PgpSignatory`
  `createSignatory(Project project, String name, String keyId, File keyRing, String password)`
  Creates a `PgpSignatory` named `name` based on the private key with id `keyId` stored in the key ring file `keyRing` with `password` password.
  `protected Object`
  `getQualifiedPropertyName(String propertyPrefix, String name)`
  Returns the qualified property name.
  `protected PgpKeyId`
  `normalizeKeyId(String keyId)`
  Normalize key id.
  `protected PgpSignatory`
  `readProperties(Project project, String prefix, String name)`
  Read properties.
  `protected PgpSignatory`
  `readProperties(Project project, String prefix, String name, boolean required)`
  Read properties.
  `protected org.bouncycastle.openpgp.PGPSecretKey`
  `readSecretKey(InputStream input, String keyId, String sourceDescription)`
  Read secret key.
  `org.bouncycastle.openpgp.PGPSecretKey`
  `readSecretKey(String keyId, File file)`
  Read secret key.
  `protected org.bouncycastle.openpgp.PGPSecretKey`
  `readSecretKey(org.bouncycastle.openpgp.PGPSecretKeyRingCollection keyRings, PgpKeyId keyId, String sourceDescription)`
  Read secret key.

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### PgpSignatoryFactory

    public PgpSignatoryFactory()

- ## Method Details

  - ### createSignatory

    public PgpSignatory createSignatory(Project project, boolean required)
    Create signatory.
    Since:
      1.0

  - ### createSignatory

    public PgpSignatory createSignatory(Project project)
    Create signatory.
    Since:
      1.0

  - ### createSignatory

    public PgpSignatory createSignatory(Project project, String propertyPrefix, boolean required)
    Create signatory.
    Since:
      1.0

  - ### createSignatory

    public PgpSignatory createSignatory(Project project, String propertyPrefix)
    Create signatory.
    Since:
      1.0

  - ### createSignatory

    public PgpSignatory createSignatory(Project project, String propertyPrefix, String name, boolean required)
    Create signatory.
    Since:
      1.0

  - ### createSignatory

    public PgpSignatory createSignatory(Project project, String propertyPrefix, String name)
    Create signatory.
    Since:
      1.0

  - ### createSignatory

    public PgpSignatory createSignatory(String name, String keyId, File keyRing, String password)
    Create signatory.
    Since:
      1.0

  - ### createSignatory

    public PgpSignatory createSignatory(String name, org.bouncycastle.openpgp.PGPSecretKey secretKey, String password)
    Create signatory.
    Since:
      1.0

  - ### createSignatory

    @Incubating public PgpSignatory createSignatory(Project project, String name, String keyId, File keyRing, String password)
    Creates a `PgpSignatory` named `name` based on the private key with id `keyId` stored in the key ring file `keyRing` with `password` password.

    In most cases, you want to use `SigningExtension` to create signatories instead of this method.

    Parameters:
      `project` - the project to which the signing plugin has been applied
      `name` - the name for the signatory
      `keyId` - the key id to look it up in the keyring
      `keyRing` - the keyring file
      `password` - the password for the private key
    Returns:
      the signatory instance
    Since:
      9.5.0

  - ### createSignatory

    @Incubating public PgpSignatory createSignatory(Project project, String name, @Nullable String keyId, String key, String password)
    Creates a `PgpSignatory` named `name` based on the private key with id `keyId` stored in the ASCII-armored `key` with `password` password.

    In most cases, you want to use `SigningExtension` to create signatories instead of this method.

    Parameters:
      `project` - the project to which the signing plugin has been applied
      `name` - the name for the signatory
      `keyId` - the key id to look it up in the keyring (optional if keyring contains only one master key, and it should be used)
      `key` - the ASCII-armored key
      `password` - the password for the private key
    Returns:
      the signatory instance
    Since:
      9.5.0

  - ### readProperties

    protected PgpSignatory readProperties(Project project, String prefix, String name)
    Read properties.
    Since:
      1.0

  - ### readSecretKey

    public org.bouncycastle.openpgp.PGPSecretKey readSecretKey(String keyId, File file)
    Read secret key.
    Since:
      1.0

  - ### readSecretKey

    protected org.bouncycastle.openpgp.PGPSecretKey readSecretKey(InputStream input, String keyId, String sourceDescription)
    Read secret key.
    Since:
      1.0

  - ### readSecretKey

    protected org.bouncycastle.openpgp.PGPSecretKey readSecretKey(org.bouncycastle.openpgp.PGPSecretKeyRingCollection keyRings, PgpKeyId keyId, String sourceDescription)
    Read secret key.
    Since:
      1.0

  - ### normalizeKeyId

    protected PgpKeyId normalizeKeyId(String keyId)
    Normalize key id.
    Since:
      1.0

  - ### readProperties

    protected PgpSignatory readProperties(Project project, String prefix, String name, boolean required)
    Read properties.
    Since:
      1.0

  - ### getQualifiedPropertyName

    protected Object getQualifiedPropertyName(String propertyPrefix, String name)
    Returns the qualified property name.
    Since:
      1.0