5.0.0 (latest) 4.16.0 4.15.0 4.14.0 4.13.0 4.11.0 4.10.0 4.9.0 4.8.0 4.7.0 4.6.0 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.7.0 3.6.0 3.5.0 3.4.0

    public sealed class UrlSigner.HmacBlobSigner : UrlSigner.IBlobSigner

Reference documentation and code samples for the Google Cloud Storage v1 API class UrlSigner.HmacBlobSigner.

Blob signer to implement signing using an HMAC secret.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> UrlSigner.HmacBlobSigner

## Implements

[UrlSigner](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.UrlSigner)[IBlobSigner](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.UrlSigner.IBlobSigner)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Storage.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1)

## Assembly

Google.Cloud.Storage.V1.dll

## Properties

### Algorithm

    public string Algorithm { get; }

The signing algorithm used by this blob signer.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Id

    public string Id { get; }

The identity of the signer, typically an email address.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

## Methods

### Create(string, string)

    public static UrlSigner.HmacBlobSigner Create(string keyId, string secret)

Creates a new HMAC Blob Signer from an HMAC Key ID and Secret.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `keyId` | `https://learn.microsoft.com/dotnet/api/system.string` The HMAC key ID. Must not be null or empty. |
| `secret` | `https://learn.microsoft.com/dotnet/api/system.string` The HMAC key secret. Must not be null or empty. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.UrlSignerhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.UrlSigner.HmacBlobSigner` |   |

### CreateSignature(byte\[\], BlobSignerParameters)

    public string CreateSignature(byte[] data, UrlSigner.BlobSignerParameters parameters)

Synchronously signs the given blob.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `System.Byte` The data to sign. Must not be null. |
| `parameters` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.UrlSignerhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.UrlSigner.BlobSignerParameters` Parameters to use when deriving the signing key. Concrete implementations may allow a null value if no parameters are required. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` | The blob signature as base64 text. |

### CreateSignatureAsync(byte\[\], BlobSignerParameters, CancellationToken)

    public Task<string> CreateSignatureAsync(byte[] data, UrlSigner.BlobSignerParameters parameters, CancellationToken cancellationToken)

Asynchronously signs the given blob.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `System.Byte` The data to sign. Must not be null. |
| `parameters` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.UrlSignerhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.UrlSigner.BlobSignerParameters` Parameters to use when deriving the signing key. Concrete implementations may allow a null value if no parameters are required. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The token to monitor for cancellation requests. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://learn.microsoft.com/dotnet/api/system.string` | A task representing the asynchronous operation, with a result returning the blob signature as base64 text. |