private string GetModulusFromPopToken(string popToken) { var handler = new JwtSecurityTokenHandler(); var jsonToken = handler.ReadJwtToken(popToken); var jwtDecoded = Base64UrlHelpers.Decode(jsonToken.EncodedPayload); var jObj = JObject.Parse(jsonToken.Payload.First().Value.ToString()); return(jObj["jwk"]["n"].ToString()); }
[InlineData("", "")] // Empty string public void DecodeToString_ValidBase64UrlString_ReturnsDecodedString(string stringToDecode, string expectedDecodedString) { var actualDecodedString = Base64UrlHelpers.Decode(stringToDecode); Assert.Equal(expectedDecodedString, actualDecodedString); }
public void Decode_String_New() { Base64UrlHelpers.Decode(s4); Base64UrlHelpers.Decode(s5); Base64UrlHelpers.Decode(s6); }