From 731ba7fb8a77e233a1dfbe62d5c6a8eb0cb4574b Mon Sep 17 00:00:00 2001 From: Joe Flateau Date: Wed, 10 Oct 2018 16:13:56 -0400 Subject: [PATCH] node-forge: add types for pkcs7 (#29374) * add types for pkcs7 * bump version number * revert change of node-forge version number * mark content/contentInfo as optional and add arg for sign(options?) --- types/node-forge/index.d.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/types/node-forge/index.d.ts b/types/node-forge/index.d.ts index e30a217ddc..99d3f5b45d 100644 --- a/types/node-forge/index.d.ts +++ b/types/node-forge/index.d.ts @@ -5,6 +5,7 @@ // Aakash Goenka // Rafal2228 // Beeno Tung +// Joe Flateau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -410,6 +411,26 @@ declare module "node-forge" { function pkcs12FromAsn1(obj: any, strict?: boolean, password?: string): Pkcs12Pfx; function pkcs12FromAsn1(obj: any, password?: string): Pkcs12Pfx; } + namespace pkcs7 { + interface PkcsSignedData { + content?: string | util.ByteBuffer; + contentInfo?: { value: any[] }; + + addCertificate(certificate: pki.Certificate): void; + addSigner(options: { + key: string; + certificate: pki.Certificate; + digestAlgorithm: string; + authenticatedAttributes: { type: string; value?: string }[]; + }): void; + sign(options?:{ + detached?: boolean + }): void; + toAsn1(): asn1.Asn1; + } + + function createSignedData(): PkcsSignedData; + } namespace md {