Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 948 Bytes

jwk_from_key_like.fromkeylike.md

File metadata and controls

40 lines (27 loc) · 948 Bytes

Function: fromKeyLike

jwk/from_key_like.fromKeyLike

fromKeyLike(key): Promise<JWK>

Converts a runtime-specific key representation (KeyLike) to a JWK.

example ESM import

import { fromKeyLike } from 'jose/jwk/from_key_like'

example CJS import

const { fromKeyLike } = require('jose/jwk/from_key_like')

example Usage

const privateJwk = await fromKeyLike(privateKey)
const publicJwk = await fromKeyLike(publicKey)

console.log(privateJwk)
console.log(publicJwk)

Parameters

Name Type Description
key KeyLike Key representation to transform to a JWK.

Returns

Promise<JWK>

Defined in

jwk/from_key_like.ts:28