public sealed class UrlSigner.HmacBlobSigner : UrlSigner.IBlobSignerReference documentation and code samples for the Google Cloud Storage v1 API class UrlSigner.HmacBlobSigner.
Blob signer to implement signing using an HMAC secret.
Implements
UrlSignerIBlobSignerNamespace
Google.Cloud.Storage.V1Assembly
Google.Cloud.Storage.V1.dll
Properties
Algorithm
public string Algorithm { get; }The signing algorithm used by this blob signer.
| Property Value | |
|---|---|
| Type | Description |
string |
|
Id
public string Id { get; }The identity of the signer, typically an email address.
| Property Value | |
|---|---|
| Type | Description |
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 |
stringThe HMAC key ID. Must not be null or empty. |
secret |
stringThe HMAC key secret. Must not be null or empty. |
| Returns | |
|---|---|
| Type | Description |
UrlSignerHmacBlobSigner |
|
CreateSignature(byte[], BlobSignerParameters)
public string CreateSignature(byte[] data, UrlSigner.BlobSignerParameters parameters)Synchronously signs the given blob.
| Parameters | |
|---|---|
| Name | Description |
data |
System.ByteThe data to sign. Must not be null. |
parameters |
UrlSignerBlobSignerParametersParameters to use when deriving the signing key. Concrete implementations may allow a null value if no parameters are required. |
| Returns | |
|---|---|
| Type | Description |
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.ByteThe data to sign. Must not be null. |
parameters |
UrlSignerBlobSignerParametersParameters to use when deriving the signing key. Concrete implementations may allow a null value if no parameters are required. |
cancellationToken |
CancellationTokenThe token to monitor for cancellation requests. |
| Returns | |
|---|---|
| Type | Description |
Taskstring |
A task representing the asynchronous operation, with a result returning the blob signature as base64 text. |