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?)
This commit is contained in:
Joe Flateau
2018-10-10 16:13:56 -04:00
committed by Andy
parent 3901652c11
commit 731ba7fb8a

View File

@@ -5,6 +5,7 @@
// Aakash Goenka <https://github.com/a-k-g>
// Rafal2228 <https://github.com/rafal2228>
// Beeno Tung <https://github.com/beenotung>
// Joe Flateau <https://github.com/joeflateau>
// 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 {