# REST Resource: projects.attestors

- [Resource: Attestor](https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#Attestor)
  - [JSON representation](https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#Attestor.SCHEMA_REPRESENTATION)
- [UserOwnedGrafeasNote](https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#UserOwnedGrafeasNote)
  - [JSON representation](https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#UserOwnedGrafeasNote.SCHEMA_REPRESENTATION)
- [AttestorPublicKey](https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#AttestorPublicKey)
  - [JSON representation](https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#AttestorPublicKey.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#METHODS_SUMMARY)

## Resource: Attestor

An `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#Attestor` that attests to container image artifacts. An existing attestor cannot be modified except where indicated.

| JSON representation |
|---|
| ``` { "name": string, "description": string, "updateTime": string, "etag": string, // Union field `attestor_type` can be only one of the following: "userOwnedGrafeasNote": { object (`https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#UserOwnedGrafeasNote`) } // End of list of possible types for union field `attestor_type`. } ``` |

| Fields ||
|---|---|
| `name` | `string` Required. The resource name, in the format: `projects/*/attestors/*`. This field may not be updated. |
| `description` | `string` Optional. A descriptive comment. This field may be updated. The field may be displayed in chooser dialogs. |
| `updateTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Output only. Time when the attestor was last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `etag` | `string` Optional. A checksum, returned by the server, that can be sent on update requests to ensure the attestor has an up-to-date value before attempting to update it. See <https://google.aip.dev/154>. |
| Union field `attestor_type`. `attestor_type` can be only one of the following: ||
| `userOwnedGrafeasNote` | ``object (`https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#UserOwnedGrafeasNote`)`` This specifies how an attestation will be read, and how it will be used during policy enforcement. |

## UserOwnedGrafeasNote

An `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#UserOwnedGrafeasNote` references a Grafeas Attestation.Authority Note created by the user.

| JSON representation |
|---|
| ``` { "noteReference": string, "publicKeys": [ { object (`https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#AttestorPublicKey`) } ], "delegationServiceAccountEmail": string } ``` |

| Fields ||
|---|---|
| `noteReference` | `string` Required. The Grafeas resource name of a Attestation.Authority Note, created by the user, in the format: `projects/[PROJECT_ID]/notes/*`. This field may not be updated. A project ID must be used, not a project number. An attestation by this attestor is stored as a Grafeas Attestation.Authority Occurrence that names a container image and that links to this Note. Grafeas is an external dependency. |
| `publicKeys[]` | ``object (`https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#AttestorPublicKey`)`` Optional. Public keys that verify attestations signed by this attestor. This field may be updated. If this field is non-empty, one of the specified public keys must verify that an attestation was signed by this attestor for the image specified in the admission request. If this field is empty, this attestor always returns that no valid attestations exist. |
| `delegationServiceAccountEmail` | `string` Output only. This field will contain the service account email address that this attestor will use as the principal when querying Container Analysis. Attestor administrators must grant this service account the IAM role needed to read attestations from the \[noteReference\]\[Note\] in Container Analysis (`containeranalysis.notes.occurrences.viewer`). This email address is fixed for the lifetime of the attestor, but callers should not make any other assumptions about the service account email; future versions may use an email based on a different naming pattern. |

## AttestorPublicKey

An `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#AttestorPublicKey` that will be used to verify attestations signed by this attestor.

| JSON representation |
|---|
| ``` { "comment": string, "id": string, // Union field `public_key` can be only one of the following: "asciiArmoredPgpPublicKey": string, "pkixPublicKey": { object (`https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/PkixPublicKey`) } // End of list of possible types for union field `public_key`. } ``` |

| Fields ||
|---|---|
| `comment` | `string` Optional. A descriptive comment. This field may be updated. |
| `id` | `string` The ID of this public key. Signatures verified by Binary Authorization must include the ID of the public key that can be used to verify them, and that ID must match the contents of this field exactly. Additional restrictions on this field can be imposed based on which public key type is encapsulated. See the documentation on `publicKey` cases below for details. |
| Union field `public_key`. `public_key` can be only one of the following: ||
| `asciiArmoredPgpPublicKey` | `string` ASCII-armored representation of a PGP public key, as the entire output by the command `gpg --export --armor foo@example.com` (either LF or CRLF line endings). When using this field, `id` should be left blank. The Binary Authorization API handlers will calculate the ID and fill it in automatically. Binary Authorization computes this ID as the OpenPGP RFC4880 V4 fingerprint, represented as upper-case hex. If `id` is provided by the caller, it will be overwritten by the API-calculated ID. |
| `pkixPublicKey` | ``object (`https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/PkixPublicKey`)`` A raw PKIX SubjectPublicKeyInfo format public key. NOTE: `id` may be explicitly provided by the caller when using this type of public key, but it MUST be a valid RFC3986 URI. If `id` is left blank, a default one will be computed based on the digest of the DER encoding of the public key. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors/create` | Creates an `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#Attestor`, and returns a copy of the new `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#Attestor`. |
| ### `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors/delete` | Deletes an `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#Attestor`. |
| ### `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors/get` | Gets an `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#Attestor`. |
| ### `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors/getIamPolicy` | Gets the access control policy for a resource. |
| ### `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors/list` | Lists `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#Attestor`. |
| ### `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors/setIamPolicy` | Sets the access control policy on the specified resource. |
| ### `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors/testIamPermissions` | Returns permissions that a caller has on the specified resource. |
| ### `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors/update` | Updates an `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors#Attestor`. |
| ### `https://docs.cloud.google.com/binary-authorization/docs/reference/rest/v1/projects.attestors/validateAttestationOccurrence` | Returns whether the given `Attestation` for the given image URI was signed by the given `Attestor` |