Class JsonWebSignature (1.55.0)

public class JsonWebSignature

JSON Web Signature (JWS) implementation as specified in http://tools.ietf.org/html/draft-ietf-jose-json-web-signature-11.

Inheritance

Object > JsonWebSignature

Namespace

Google.Apis.Auth

Assembly

Google.Apis.Auth.dll

Methods

VerifySignedTokenAsync(String, SignedTokenVerificationOptions, CancellationToken)

public static Task<JsonWebSignature.Payload> VerifySignedTokenAsync(string signedJwt, SignedTokenVerificationOptions options = null, CancellationToken cancellationToken = default(CancellationToken))

Verifies that the given token is a valid, not expired, signed token.

Parameters
NameDescription
signedJwtString

The token to verify.

optionsSignedTokenVerificationOptions

The options to use for verification. May be null in which case default options will be used.

cancellationTokenCancellationToken

The cancellation token for the operation.

Returns
TypeDescription
Task<JsonWebSignature.Payload>

The payload contained by the token.

Exceptions
TypeDescription
InvalidJwtException

If the token is invalid or expired.

VerifySignedTokenAsync<TPayload>(String, SignedTokenVerificationOptions, CancellationToken)

public static Task<TPayload> VerifySignedTokenAsync<TPayload>(string signedJwt, SignedTokenVerificationOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
    where TPayload : JsonWebSignature.Payload

Verifies that the given token is a valid, not expired, signed token.

Parameters
NameDescription
signedJwtString

The token to verify.

optionsSignedTokenVerificationOptions

The options to use for verification. May be null in which case default options will be used.

cancellationTokenCancellationToken

The cancellation token for the operation.

Returns
TypeDescription
Task<TPayload>

The payload contained by the token.

Type Parameter
NameDescription
TPayload

The type of the payload to return, so user code can validate additional claims. Should extend JsonWebSignature.Payload. Payload information will be deserialized using Instance.

Exceptions
TypeDescription
InvalidJwtException

If the token is invalid or expired.

Extension Method