Skip to content

Commit 824c4cb

Browse files
committed
tests: removed commented out utility
1 parent e7a1039 commit 824c4cb

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

tests/utils.ts

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -471,58 +471,6 @@ async function generateCertificate({
471471
return await x509.X509CertificateGenerator.create(certConfig);
472472
}
473473

474-
// Async function createTLSConfigWithChain(
475-
// keyPairs: Array<{
476-
// publicKey: JsonWebKey;
477-
// privateKey: JsonWebKey;
478-
// }>,
479-
// generateCertId?: () => string,
480-
// ): Promise<{
481-
// certChainPem: string;
482-
// privKeyPem: string;
483-
// caPem: string;
484-
// }> {
485-
// if (keyPairs.length === 0) throw Error('Must have at least 1 keypair');
486-
// let num = -1;
487-
// const defaultNumGen = () => {
488-
// num += 1;
489-
// return `${num}`;
490-
// };
491-
// generateCertId = generateCertId ?? defaultNumGen;
492-
// let previousCert: X509Certificate | null = null;
493-
// let previousKeyPair: {
494-
// publicKey: JsonWebKey;
495-
// privateKey: JsonWebKey;
496-
// } | null = null;
497-
// const certChain: Array<X509Certificate> = [];
498-
// for (const keyPair of keyPairs) {
499-
// const certId = generateCertId();
500-
// const newCert = await generateCertificate({
501-
// certId,
502-
// duration: 31536000,
503-
// issuerPrivateKey: previousKeyPair?.privateKey ?? keyPair.privateKey,
504-
// subjectKeyPair: keyPair,
505-
// issuerAttrsExtra: previousCert?.subjectName.toJSON(),
506-
// });
507-
// certChain.unshift(newCert);
508-
// previousCert = newCert;
509-
// previousKeyPair = keyPair;
510-
// }
511-
// let certChainPEM = '';
512-
// let caPem: string | null = null;
513-
// for (const certificate of certChain) {
514-
// const pem = certToPEM(certificate);
515-
// caPem = pem;
516-
// certChainPEM += pem;
517-
// }
518-
//
519-
// return {
520-
// privKeyPem: privateKeyToPEM(previousKeyPair!.privateKey),
521-
// certChainPem: certChainPEM,
522-
// caPem: caPem!,
523-
// };
524-
// }
525-
526474
function certToPEM(cert: X509Certificate): string {
527475
return cert.toString('pem') + '\n';
528476
}

0 commit comments

Comments
 (0)