Ejemplo n.º 1
0
        /// <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}");
        }
Ejemplo n.º 2
0
 /// <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();