Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types in function update JWE constructor to improve readability #361

Open
Exodiel opened this issue Mar 25, 2022 · 0 comments
Open

Add types in function update JWE constructor to improve readability #361

Exodiel opened this issue Mar 25, 2022 · 0 comments

Comments

@Exodiel
Copy link

Exodiel commented Mar 25, 2022

const encrypt = async (publicToEncrypt: JWK.Key, data: JWS.CreateSignResult): Promise<string> => {
  const encrypted = await JWE
    .createEncrypt({
      contentAlg: 'A256GCM',
      format: 'compact',
      fields: {
        alg: 'RSA-OAEP-256',
        cty: 'JWT',
        enc: 'A256GCM',
        iss: 'COMPANY'
      }
    }, publicToEncrypt)
    .update(data) // <--- here
    .final()

  return encrypted
}

In the update function, the input data is received as a parameter but the data type is any
Here is what I am saying:

(method) JWE.Encryptor.update(input: any): JWE.Encryptor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant