/// <summary> /// Computes the key authorization string for <paramref name="challenge"/>. /// </summary> /// <param name="challenge">The challenge.</param> /// <param name="key">The key.</param> /// <returns>The key authorization string.</returns> public static string ComputeKeyAuthorization(this Challenge challenge, IAccountKey key) { var jwkThumbprint = key.GenerateThumbprint(); var jwkThumbprintEncoded = JwsConvert.ToBase64String(jwkThumbprint); var token = challenge.Token; return($"{token}.{jwkThumbprintEncoded}"); }
/// <summary> /// Generates the thumbprint for the given account <paramref name="key"/>. /// </summary> /// <param name="key">The account key.</param> /// <returns>The thumbprint.</returns> public static byte[] GenerateThumbprint(this IAccountKey key) => key.GenerateThumbprint();