Gmail API . users . settings . cse . keypairs

Instance Methods

close()

Close httplib2 connections.

create(userId, body=None, x__xgafv=None)

Creates and uploads a client-side encryption S/MIME public key certificate chain and private key metadata for the authenticated user.

disable(userId, keyPairId, body=None, x__xgafv=None)

Turns off a client-side encryption key pair. The authenticated user can no longer use the key pair to decrypt incoming CSE message texts or sign outgoing CSE mail. To regain access, use the EnableCseKeyPair to turn on the key pair. After 30 days, you can permanently delete the key pair by using the ObliterateCseKeyPair method.

enable(userId, keyPairId, body=None, x__xgafv=None)

Turns on a client-side encryption key pair that was turned off. The key pair becomes active again for any associated client-side encryption identities.

get(userId, keyPairId, x__xgafv=None)

Retrieves an existing client-side encryption key pair.

list(userId, pageSize=None, pageToken=None, x__xgafv=None)

Lists client-side encryption key pairs for an authenticated user.

list_next()

Retrieves the next page of results.

obliterate(userId, keyPairId, body=None, x__xgafv=None)

Deletes a client-side encryption key pair permanently and immediately. You can only permanently delete key pairs that have been turned off for more than 30 days. To turn off a key pair, use the DisableCseKeyPair method. Gmail can't restore or decrypt any messages that were encrypted by an obliterated key. Authenticated users and Google Workspace administrators lose access to reading the encrypted messages.

Method Details

close()
Close httplib2 connections.
create(userId, body=None, x__xgafv=None)
Creates and uploads a client-side encryption S/MIME public key certificate chain and private key metadata for the authenticated user.

Args:
  userId: string, The requester's primary email address. To indicate the authenticated user, you can use the special value `me`. (required)
  body: object, The request body.
    The object takes the form of:

{ # A client-side encryption S/MIME key pair, which is comprised of a public key, its certificate chain, and metadata for its paired private key. Gmail uses the key pair to complete the following tasks: - Sign outgoing client-side encrypted messages. - Save and reopen drafts of client-side encrypted messages. - Save and reopen sent messages. - Decrypt incoming or archived S/MIME messages.
  "disableTime": "A String", # Output only. If a key pair is set to `DISABLED`, the time that the key pair's state changed from `ENABLED` to `DISABLED`. This field is present only when the key pair is in state `DISABLED`.
  "enablementState": "A String", # Output only. The current state of the key pair.
  "keyPairId": "A String", # Output only. The immutable ID for the client-side encryption S/MIME key pair.
  "pem": "A String", # Output only. The public key and its certificate chain, in [PEM](https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail) format.
  "pkcs7": "A String", # Input only. The public key and its certificate chain. The chain must be in [PKCS#7](https://en.wikipedia.org/wiki/PKCS_7) format and use PEM encoding and ASCII armor.
  "privateKeyMetadata": [ # Metadata for instances of this key pair's private key.
    { # Metadata for a private key instance.
      "hardwareKeyMetadata": { # Metadata for hardware keys. # Metadata for hardware keys.
        "description": "A String", # Description about the hardware key.
      },
      "kaclsKeyMetadata": { # Metadata for private keys managed by an external key access control list service. For details about managing key access, see [Google Workspace CSE API Reference](https://developers.google.com/workspace/cse/reference). # Metadata for a private key instance managed by an external key access control list service.
        "kaclsData": "A String", # Opaque data generated and used by the key access control list service. Maximum size: 8 KiB.
        "kaclsUri": "A String", # The URI of the key access control list service that manages the private key.
      },
      "privateKeyMetadataId": "A String", # Output only. The immutable ID for the private key metadata instance.
    },
  ],
  "subjectEmailAddresses": [ # Output only. The email address identities that are specified on the leaf certificate.
    "A String",
  ],
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A client-side encryption S/MIME key pair, which is comprised of a public key, its certificate chain, and metadata for its paired private key. Gmail uses the key pair to complete the following tasks: - Sign outgoing client-side encrypted messages. - Save and reopen drafts of client-side encrypted messages. - Save and reopen sent messages. - Decrypt incoming or archived S/MIME messages.
  "disableTime": "A String", # Output only. If a key pair is set to `DISABLED`, the time that the key pair's state changed from `ENABLED` to `DISABLED`. This field is present only when the key pair is in state `DISABLED`.
  "enablementState": "A String", # Output only. The current state of the key pair.
  "keyPairId": "A String", # Output only. The immutable ID for the client-side encryption S/MIME key pair.
  "pem": "A String", # Output only. The public key and its certificate chain, in [PEM](https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail) format.
  "pkcs7": "A String", # Input only. The public key and its certificate chain. The chain must be in [PKCS#7](https://en.wikipedia.org/wiki/PKCS_7) format and use PEM encoding and ASCII armor.
  "privateKeyMetadata": [ # Metadata for instances of this key pair's private key.
    { # Metadata for a private key instance.
      "hardwareKeyMetadata": { # Metadata for hardware keys. # Metadata for hardware keys.
        "description": "A String", # Description about the hardware key.
      },
      "kaclsKeyMetadata": { # Metadata for private keys managed by an external key access control list service. For details about managing key access, see [Google Workspace CSE API Reference](https://developers.google.com/workspace/cse/reference). # Metadata for a private key instance managed by an external key access control list service.
        "kaclsData": "A String", # Opaque data generated and used by the key access control list service. Maximum size: 8 KiB.
        "kaclsUri": "A String", # The URI of the key access control list service that manages the private key.
      },
      "privateKeyMetadataId": "A String", # Output only. The immutable ID for the private key metadata instance.
    },
  ],
  "subjectEmailAddresses": [ # Output only. The email address identities that are specified on the leaf certificate.
    "A String",
  ],
}
disable(userId, keyPairId, body=None, x__xgafv=None)
Turns off a client-side encryption key pair. The authenticated user can no longer use the key pair to decrypt incoming CSE message texts or sign outgoing CSE mail. To regain access, use the EnableCseKeyPair to turn on the key pair. After 30 days, you can permanently delete the key pair by using the ObliterateCseKeyPair method.

Args:
  userId: string, The requester's primary email address. To indicate the authenticated user, you can use the special value `me`. (required)
  keyPairId: string, The identifier of the key pair to turn off. (required)
  body: object, The request body.
    The object takes the form of:

{ # Requests to turn off a client-side encryption key pair.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A client-side encryption S/MIME key pair, which is comprised of a public key, its certificate chain, and metadata for its paired private key. Gmail uses the key pair to complete the following tasks: - Sign outgoing client-side encrypted messages. - Save and reopen drafts of client-side encrypted messages. - Save and reopen sent messages. - Decrypt incoming or archived S/MIME messages.
  "disableTime": "A String", # Output only. If a key pair is set to `DISABLED`, the time that the key pair's state changed from `ENABLED` to `DISABLED`. This field is present only when the key pair is in state `DISABLED`.
  "enablementState": "A String", # Output only. The current state of the key pair.
  "keyPairId": "A String", # Output only. The immutable ID for the client-side encryption S/MIME key pair.
  "pem": "A String", # Output only. The public key and its certificate chain, in [PEM](https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail) format.
  "pkcs7": "A String", # Input only. The public key and its certificate chain. The chain must be in [PKCS#7](https://en.wikipedia.org/wiki/PKCS_7) format and use PEM encoding and ASCII armor.
  "privateKeyMetadata": [ # Metadata for instances of this key pair's private key.
    { # Metadata for a private key instance.
      "hardwareKeyMetadata": { # Metadata for hardware keys. # Metadata for hardware keys.
        "description": "A String", # Description about the hardware key.
      },
      "kaclsKeyMetadata": { # Metadata for private keys managed by an external key access control list service. For details about managing key access, see [Google Workspace CSE API Reference](https://developers.google.com/workspace/cse/reference). # Metadata for a private key instance managed by an external key access control list service.
        "kaclsData": "A String", # Opaque data generated and used by the key access control list service. Maximum size: 8 KiB.
        "kaclsUri": "A String", # The URI of the key access control list service that manages the private key.
      },
      "privateKeyMetadataId": "A String", # Output only. The immutable ID for the private key metadata instance.
    },
  ],
  "subjectEmailAddresses": [ # Output only. The email address identities that are specified on the leaf certificate.
    "A String",
  ],
}
enable(userId, keyPairId, body=None, x__xgafv=None)
Turns on a client-side encryption key pair that was turned off. The key pair becomes active again for any associated client-side encryption identities.

Args:
  userId: string, The requester's primary email address. To indicate the authenticated user, you can use the special value `me`. (required)
  keyPairId: string, The identifier of the key pair to turn on. (required)
  body: object, The request body.
    The object takes the form of:

{ # Requests to turn on a client-side encryption key pair.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A client-side encryption S/MIME key pair, which is comprised of a public key, its certificate chain, and metadata for its paired private key. Gmail uses the key pair to complete the following tasks: - Sign outgoing client-side encrypted messages. - Save and reopen drafts of client-side encrypted messages. - Save and reopen sent messages. - Decrypt incoming or archived S/MIME messages.
  "disableTime": "A String", # Output only. If a key pair is set to `DISABLED`, the time that the key pair's state changed from `ENABLED` to `DISABLED`. This field is present only when the key pair is in state `DISABLED`.
  "enablementState": "A String", # Output only. The current state of the key pair.
  "keyPairId": "A String", # Output only. The immutable ID for the client-side encryption S/MIME key pair.
  "pem": "A String", # Output only. The public key and its certificate chain, in [PEM](https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail) format.
  "pkcs7": "A String", # Input only. The public key and its certificate chain. The chain must be in [PKCS#7](https://en.wikipedia.org/wiki/PKCS_7) format and use PEM encoding and ASCII armor.
  "privateKeyMetadata": [ # Metadata for instances of this key pair's private key.
    { # Metadata for a private key instance.
      "hardwareKeyMetadata": { # Metadata for hardware keys. # Metadata for hardware keys.
        "description": "A String", # Description about the hardware key.
      },
      "kaclsKeyMetadata": { # Metadata for private keys managed by an external key access control list service. For details about managing key access, see [Google Workspace CSE API Reference](https://developers.google.com/workspace/cse/reference). # Metadata for a private key instance managed by an external key access control list service.
        "kaclsData": "A String", # Opaque data generated and used by the key access control list service. Maximum size: 8 KiB.
        "kaclsUri": "A String", # The URI of the key access control list service that manages the private key.
      },
      "privateKeyMetadataId": "A String", # Output only. The immutable ID for the private key metadata instance.
    },
  ],
  "subjectEmailAddresses": [ # Output only. The email address identities that are specified on the leaf certificate.
    "A String",
  ],
}
get(userId, keyPairId, x__xgafv=None)
Retrieves an existing client-side encryption key pair.

Args:
  userId: string, The requester's primary email address. To indicate the authenticated user, you can use the special value `me`. (required)
  keyPairId: string, The identifier of the key pair to retrieve. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A client-side encryption S/MIME key pair, which is comprised of a public key, its certificate chain, and metadata for its paired private key. Gmail uses the key pair to complete the following tasks: - Sign outgoing client-side encrypted messages. - Save and reopen drafts of client-side encrypted messages. - Save and reopen sent messages. - Decrypt incoming or archived S/MIME messages.
  "disableTime": "A String", # Output only. If a key pair is set to `DISABLED`, the time that the key pair's state changed from `ENABLED` to `DISABLED`. This field is present only when the key pair is in state `DISABLED`.
  "enablementState": "A String", # Output only. The current state of the key pair.
  "keyPairId": "A String", # Output only. The immutable ID for the client-side encryption S/MIME key pair.
  "pem": "A String", # Output only. The public key and its certificate chain, in [PEM](https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail) format.
  "pkcs7": "A String", # Input only. The public key and its certificate chain. The chain must be in [PKCS#7](https://en.wikipedia.org/wiki/PKCS_7) format and use PEM encoding and ASCII armor.
  "privateKeyMetadata": [ # Metadata for instances of this key pair's private key.
    { # Metadata for a private key instance.
      "hardwareKeyMetadata": { # Metadata for hardware keys. # Metadata for hardware keys.
        "description": "A String", # Description about the hardware key.
      },
      "kaclsKeyMetadata": { # Metadata for private keys managed by an external key access control list service. For details about managing key access, see [Google Workspace CSE API Reference](https://developers.google.com/workspace/cse/reference). # Metadata for a private key instance managed by an external key access control list service.
        "kaclsData": "A String", # Opaque data generated and used by the key access control list service. Maximum size: 8 KiB.
        "kaclsUri": "A String", # The URI of the key access control list service that manages the private key.
      },
      "privateKeyMetadataId": "A String", # Output only. The immutable ID for the private key metadata instance.
    },
  ],
  "subjectEmailAddresses": [ # Output only. The email address identities that are specified on the leaf certificate.
    "A String",
  ],
}
list(userId, pageSize=None, pageToken=None, x__xgafv=None)
Lists client-side encryption key pairs for an authenticated user.

Args:
  userId: string, The requester's primary email address. To indicate the authenticated user, you can use the special value `me`. (required)
  pageSize: integer, The number of key pairs to return. If not provided, the page size will default to 20 entries.
  pageToken: string, Pagination token indicating which page of key pairs to return. If the token is not supplied, then the API will return the first page of results.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    {
  "cseKeyPairs": [ # One page of the list of CSE key pairs installed for the user.
    { # A client-side encryption S/MIME key pair, which is comprised of a public key, its certificate chain, and metadata for its paired private key. Gmail uses the key pair to complete the following tasks: - Sign outgoing client-side encrypted messages. - Save and reopen drafts of client-side encrypted messages. - Save and reopen sent messages. - Decrypt incoming or archived S/MIME messages.
      "disableTime": "A String", # Output only. If a key pair is set to `DISABLED`, the time that the key pair's state changed from `ENABLED` to `DISABLED`. This field is present only when the key pair is in state `DISABLED`.
      "enablementState": "A String", # Output only. The current state of the key pair.
      "keyPairId": "A String", # Output only. The immutable ID for the client-side encryption S/MIME key pair.
      "pem": "A String", # Output only. The public key and its certificate chain, in [PEM](https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail) format.
      "pkcs7": "A String", # Input only. The public key and its certificate chain. The chain must be in [PKCS#7](https://en.wikipedia.org/wiki/PKCS_7) format and use PEM encoding and ASCII armor.
      "privateKeyMetadata": [ # Metadata for instances of this key pair's private key.
        { # Metadata for a private key instance.
          "hardwareKeyMetadata": { # Metadata for hardware keys. # Metadata for hardware keys.
            "description": "A String", # Description about the hardware key.
          },
          "kaclsKeyMetadata": { # Metadata for private keys managed by an external key access control list service. For details about managing key access, see [Google Workspace CSE API Reference](https://developers.google.com/workspace/cse/reference). # Metadata for a private key instance managed by an external key access control list service.
            "kaclsData": "A String", # Opaque data generated and used by the key access control list service. Maximum size: 8 KiB.
            "kaclsUri": "A String", # The URI of the key access control list service that manages the private key.
          },
          "privateKeyMetadataId": "A String", # Output only. The immutable ID for the private key metadata instance.
        },
      ],
      "subjectEmailAddresses": [ # Output only. The email address identities that are specified on the leaf certificate.
        "A String",
      ],
    },
  ],
  "nextPageToken": "A String", # Pagination token to be passed to a subsequent ListCseKeyPairs call in order to retrieve the next page of key pairs. If this value is not returned, then no further pages remain.
}
list_next()
Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call 'execute()' on to request the next
          page. Returns None if there are no more items in the collection.
        
obliterate(userId, keyPairId, body=None, x__xgafv=None)
Deletes a client-side encryption key pair permanently and immediately. You can only permanently delete key pairs that have been turned off for more than 30 days. To turn off a key pair, use the DisableCseKeyPair method. Gmail can't restore or decrypt any messages that were encrypted by an obliterated key. Authenticated users and Google Workspace administrators lose access to reading the encrypted messages.

Args:
  userId: string, The requester's primary email address. To indicate the authenticated user, you can use the special value `me`. (required)
  keyPairId: string, The identifier of the key pair to obliterate. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request to obliterate a CSE key pair.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format