Skip to content

Commit

Permalink
Merge pull request #22 from JimmyBjorklund/master
Browse files Browse the repository at this point in the history
Corrected types for typescripts
  • Loading branch information
lenchv authored Sep 30, 2024
2 parents 4a4a9e5 + 58ab571 commit 72fea8e
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export type KeyEntry = {
* }
* }
*/
const toPem: (keystore: Buffer, keystorePassword: string, privateKeyPassword?: string) => JksResult;
export declare function toPem(keystore: Buffer, keystorePassword: string, privateKeyPassword?: string): JksResult;

/**
* The raw function to extract certificates
Expand All @@ -51,7 +51,7 @@ const toPem: (keystore: Buffer, keystorePassword: string, privateKeyPassword?: s
* @param {String} password
* @return {(KeyEntry | TrustedKeyEntry)[]}
*/
const parseJks: (keystore: Buffer, password: string) => (KeyEntry | TrustedKeyEntry)[];
export declare function parseJks(keystore: Buffer, password: string): (KeyEntry | TrustedKeyEntry)[];

/**
* Decrypts private key from DER to PEM
Expand All @@ -60,23 +60,13 @@ const parseJks: (keystore: Buffer, password: string) => (KeyEntry | TrustedKeyEn
* @param {String} password password for PKCS8 decryption
* @return {String} - decoded private key
*/
const decrypt: (protectedPrivateKey: Buffer, password: string = '') => string;
export declare function decrypt(protectedPrivateKey: Buffer, password: string): string;

/**
* The function that parses keystore/truststore in PKCS12 format
*
* @param {Buffer} keystore
* @param {String} password
*/
const parsePkcs12: (keystore: Buffer, password: string) => JksResult;
export declare function parsePkcs12(keystore: Buffer, password: string): JksResult;

export {
toPem,
parseJks,
decrypt,
parsePkcs12,
JksResult,
Certificate,
TrustedKeyEntry,
KeyEntry,
};

0 comments on commit 72fea8e

Please sign in to comment.