migrate to "export default"
also, set no-use-before-define in linter
This commit is contained in:
@@ -11,23 +11,6 @@ import shellModule from './shell.js';
|
||||
const debug = debugModule('box:openssl');
|
||||
const shell = shellModule('openssl');
|
||||
|
||||
export {
|
||||
createCsr,
|
||||
generateKey,
|
||||
getModulus,
|
||||
pemToDer,
|
||||
getCertificateDates,
|
||||
getSubjectAndIssuer,
|
||||
generateCertificate,
|
||||
hasExpired,
|
||||
getPublicKey,
|
||||
checkHost,
|
||||
generateDkimKey,
|
||||
generateDhparam,
|
||||
validateCertificate,
|
||||
getSerial,
|
||||
getAuthorityKeyId
|
||||
};
|
||||
|
||||
async function generateKey(type) {
|
||||
debug(`generateKey: generating new key for${type}`);
|
||||
@@ -241,3 +224,21 @@ async function getAuthorityKeyId(pem) {
|
||||
if (!akiMatch) throw new BoxError(BoxError.OPENSSL_ERROR, 'AKI not found');
|
||||
return Buffer.from(akiMatch[1].replace(/:/g, ''), 'hex');
|
||||
}
|
||||
|
||||
export default {
|
||||
createCsr,
|
||||
generateKey,
|
||||
getModulus,
|
||||
pemToDer,
|
||||
getCertificateDates,
|
||||
getSubjectAndIssuer,
|
||||
generateCertificate,
|
||||
hasExpired,
|
||||
getPublicKey,
|
||||
checkHost,
|
||||
generateDkimKey,
|
||||
generateDhparam,
|
||||
validateCertificate,
|
||||
getSerial,
|
||||
getAuthorityKeyId
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user