From 44669d0a9cb2e61587573593db7fa52a8d74e211 Mon Sep 17 00:00:00 2001 From: beejones Date: Mon, 6 May 2019 15:29:07 +0200 Subject: [PATCH] Fixing some of the lint issues (#28) --- lib/security/JweToken.ts | 10 ++++++++++ lib/security/JwsToken.ts | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/lib/security/JweToken.ts b/lib/security/JweToken.ts index a8fe318..ac75d37 100644 --- a/lib/security/JweToken.ts +++ b/lib/security/JweToken.ts @@ -13,12 +13,19 @@ type EncryptDelegate = (data: Buffer, jwk: PublicKey) => Promise; * JWE in flattened json format */ export type FlatJsonJwe = { + /** The protected (integrity) header. */ protected?: string, + /** The unprotected (unverified) header. */ unprotected?: {[key: string]: string}, + /** Contain the value BASE64URL(JWE Encrypted Key) */ encrypted_key: string, + /** Contains the initial vector used for encryption */ iv: string, + /** The encrypted data */ ciphertext: string, + /** Contain the value BASE64URL(JWE Authentication Tag) */ tag: string, + /** Contains the additional value */ aad?: string }; @@ -165,8 +172,11 @@ export default class JweToken extends JoseToken { */ public async encryptAsFlattenedJson (jwk: PublicKey, options?: { + /** The unprotected (unverified) header. */ unprotected?: {[key: string]: any}, + /** The protected (integrity) header. */ protected?: {[key: string]: any}, + /** Contains the additional value */ aad?: string | Buffer }): Promise { diff --git a/lib/security/JwsToken.ts b/lib/security/JwsToken.ts index f9da8a3..08988a0 100644 --- a/lib/security/JwsToken.ts +++ b/lib/security/JwsToken.ts @@ -12,9 +12,13 @@ type VerifySignatureDelegate = (signedContent: string, signature: string, jwk: P * JWS in flattened json format */ export type FlatJsonJws = { + /** The protected (signed) header. */ protected?: string, + /** The unprotected (unverified) header. */ header?: {[name: string]: string}, + /** The application-specific payload. */ payload: string, + /** The JWS signature. */ signature: string };