Skip to content
This repository has been archived by the owner on Sep 22, 2020. It is now read-only.

Commit

Permalink
Fixing some of the lint issues (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
beejones committed May 6, 2019
1 parent eb04773 commit 44669d0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/security/JweToken.ts
Expand Up @@ -13,12 +13,19 @@ type EncryptDelegate = (data: Buffer, jwk: PublicKey) => Promise<Buffer>;
* 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
};

Expand Down Expand Up @@ -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<FlatJsonJwe> {

Expand Down
4 changes: 4 additions & 0 deletions lib/security/JwsToken.ts
Expand Up @@ -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
};

Expand Down

0 comments on commit 44669d0

Please sign in to comment.