migrate to "export default"

also, set no-use-before-define in linter
This commit is contained in:
Girish Ramakrishnan
2026-02-14 15:43:24 +01:00
parent ddb46646fa
commit 36aa641cb9
231 changed files with 2846 additions and 2728 deletions

View File

@@ -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
};