import base64url from 'base64url' ; import { createHash } from 'crypto' ; param jwk returns export function createJwkThumbprint ( jwk ) { const key = { crv : jwk . crv , e : jwk . e , kty : jwk . kty , n : jwk . n , x : jwk . x , y : jwk . y , } ; const preimage = JSON . stringify ( key ) ; const digest = createHash ( 'sha256' ) . update ( preimage , 'utf8' ) . digest ( ) ; return base64url ( digest ) ; }