Skip to content

Latest commit

 

History

History
51 lines (31 loc) · 1.49 KB

jwe.md

File metadata and controls

51 lines (31 loc) · 1.49 KB

Namespace: jwe

Module jwt aims to provide an implementation of the JSON Web Encryption. Only compact serialization is supported.

Table of contents

Functions

Functions

decryptAsString

decryptAsString(key: Key, jwe: string): string

Decrypt JWE serialized form based to string payload (e.g. json)

Parameters

Name Type Description
key Key The Key wrapping key
jwe string JWE in compact serialization

Returns: string

string jwe payload as string (e.g. json)


encrypt

encrypt(key: Key, payload: string, encAlg: string, keyAlg: string): string

Create JWE serialized form based on string payload (e.g. json)

Parameters

Name Type Description
key Key The key wrapping key
payload string The payload to sign. e.g. json claims
encAlg string Content encryption algorithm. See JWA RFC chapter 4 for details on supported algorithms
keyAlg string Key wrapping encryption algorithm. See JWA RFC chapter 5 for details on supported algorithms

Returns: string

string jwe string in serialized form