certificate provider

Summary: _typescript_

Reviewed By: passy

Differential Revision: D17096517

fbshipit-source-id: a6e69e8b9a82fe76bb1de51a3a93182f35f40b3f
This commit is contained in:
Daniel Büchele
2019-08-28 20:33:23 -07:00
committed by Facebook Github Bot
parent 9970c50daf
commit 5868946818
25 changed files with 81 additions and 38 deletions

View File

@@ -5,16 +5,17 @@
* @format
*/
import {exec as opensslWithCallback} from 'openssl-wrapper';
import {exec as opensslWithCallback, Action} from 'openssl-wrapper';
import child_process from 'child_process';
export function openssl(action: string, options: {}): Promise<string> {
export function openssl(action: Action, options: {}): Promise<string> {
return new Promise((resolve, reject) => {
opensslWithCallback(action, options, (err, buffer) => {
if (err) {
reject(err);
} else if (buffer) {
resolve(buffer.toString());
}
resolve(buffer.toString());
});
});
}