Table of Contents

ToSignedUri Method

Definition

Namespace
Cuemon.Extensions.Net.Security
Assemblies
Cuemon.Extensions.Net.dll
Source
src/Cuemon.Extensions.Net/Security/StringExtensions.cs

ToSignedUri(string, byte[], DateTime?, DateTime?, Action<SignedUriOptions>)

Converts the specified uriString to a signed and tampering protected Uri.

public static Uri ToSignedUri(this string uriString, byte[] secret, DateTime? start = null, DateTime? expiry = null, Action<SignedUriOptions> setup = null)

Parameters

uriString string

The URI to protect from tampering.

secret byte[]

The secret key for the encryption.

start DateTime?

The time, expressed as the Coordinated Universal Time (UTC), at which the signed URI becomes valid.

expiry DateTime?

The time, expressed as the Coordinated Universal Time (UTC), at which the signed URI becomes invalid.

setup Action<SignedUriOptions>

The SignedUriOptions which may be configured.

Returns

Uri

A Uri that is equivalent to uriString but signed and protected from tampering.

Remarks

If either of start or expiry has a Kind different from Utc, they will be adjusted without changing the value of the DateTime itself.

Exceptions

ArgumentNullException

uriString cannot be null - or - secret cannot be null.

ArgumentException

uriString cannot be empty or consist only of white-space characters.

See Also