Cloud Storage Client - Class CreatedHmacKey (1.44.0)

Reference documentation and code samples for the Cloud Storage Client class CreatedHmacKey.

Represents a newly created HMAC key. Provides access to the key metadata and secret.

Example:

use Google\Cloud\Storage\StorageClient;

$storage = new StorageClient();
$response = $storage->createHmacKey($serviceAccountEmail);

Namespace

Google \ Cloud \ Storage

Methods

__construct

Parameters
Name Description
hmacKey HmacKey

The HMAC Key object.

secret string

The HMAC key secret.

hmacKey

Get the HMAC key object.

Example:

$key = $response->hmacKey();
Returns
Type Description
HmacKey

secret

Get the HMAC key secret.

This value will never be returned from the API after first creation. Make sure to record it for later use immediately upon key creation.

Example:

$secret = $response->secret();
Returns
Type Description
string