共用方式為


JsonWebTokenHandler.DecryptToken Method

Definition

Decrypts a JWE and returns the clear text.

public string DecryptToken (Microsoft.IdentityModel.JsonWebTokens.JsonWebToken jwtToken, Microsoft.IdentityModel.Tokens.TokenValidationParameters validationParameters);
member this.DecryptToken : Microsoft.IdentityModel.JsonWebTokens.JsonWebToken * Microsoft.IdentityModel.Tokens.TokenValidationParameters -> string
Public Function DecryptToken (jwtToken As JsonWebToken, validationParameters As TokenValidationParameters) As String

Parameters

jwtToken
JsonWebToken

The JWE that contains the cypher text.

validationParameters
TokenValidationParameters

The TokenValidationParameters to be used for validating the token.

Returns

The decoded / cleartext contents of the JWE.

Exceptions

Thrown if validationParameters is null.

Thrown if Enc is null or empty.

Thrown if the decompression failed.

Thrown if Kid is not null AND the decryption fails.

Thrown if the JWE was not able to be decrypted.

Applies to