Show / Hide Table of Contents

Class JsonWebSignature

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

Inheritance
System.Object
JsonWebSignature
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Google.Apis.Auth
Assembly: Google.Apis.Auth.dll
Syntax
public class JsonWebSignature

Methods

VerifySignedTokenAsync(String, SignedTokenVerificationOptions, CancellationToken)

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

Declaration
public static Task<JsonWebSignature.Payload> VerifySignedTokenAsync(string signedJwt, SignedTokenVerificationOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String signedJwt

The token to verify.

SignedTokenVerificationOptions options

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

System.Threading.CancellationToken cancellationToken

The cancellation token for the operation.

Returns
Type Description
System.Threading.Tasks.Task<JsonWebSignature.Payload>

The payload contained by the token.

Exceptions
Type Condition
InvalidJwtException

If the token is invalid or expired.

VerifySignedTokenAsync<TPayload>(String, SignedTokenVerificationOptions, CancellationToken)

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

Declaration
public static Task<TPayload> VerifySignedTokenAsync<TPayload>(string signedJwt, SignedTokenVerificationOptions options = null, CancellationToken cancellationToken = default(CancellationToken))
    where TPayload : JsonWebSignature.Payload
Parameters
Type Name Description
System.String signedJwt

The token to verify.

SignedTokenVerificationOptions options

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

System.Threading.CancellationToken cancellationToken

The cancellation token for the operation.

Returns
Type Description
System.Threading.Tasks.Task<TPayload>

The payload contained by the token.

Type Parameters
Name Description
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
Type Condition
InvalidJwtException

If the token is invalid or expired.

In This Article
Back to top