Export Node functions for creating decipher correctly

* createDecipher() and createDecipheriv() are functions
   in the crypto module, not methods of the Cipher interface.

 * Add pbkdf2Sync() decl
This commit is contained in:
Robert Knight
2014-04-18 21:18:09 +01:00
parent 93b01da4f3
commit 1c5ed81577
+3 -2
View File
@@ -1031,9 +1031,9 @@ declare module "crypto" {
update(data: any, input_encoding?: string, output_encoding?: string): string;
final(output_encoding?: string): string;
setAutoPadding(auto_padding: boolean): void;
createDecipher(algorithm: string, password: any): Decipher;
createDecipheriv(algorithm: string, key: any, iv: any): Decipher;
}
export function createDecipher(algorithm: string, password: any): Decipher;
export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher;
interface Decipher {
update(data: any, input_encoding?: string, output_encoding?: string): void;
final(output_encoding?: string): string;
@@ -1063,6 +1063,7 @@ declare module "crypto" {
}
export function getDiffieHellman(group_name: string): DiffieHellman;
export function pbkdf2(password: string, salt: string, iterations: number, keylen: number, callback: (err: Error, derivedKey: string) => any): void;
export function pbkdf2Sync(password: string, salt: string, iterations: number, keylen: number) : NodeBuffer;
export function randomBytes(size: number): NodeBuffer;
export function randomBytes(size: number, callback: (err: Error, buf: NodeBuffer) =>void ): void;
export function pseudoRandomBytes(size: number): NodeBuffer;