1
0
Fork 0
forked from svrjs/svrjs
This repository has been archived on 2024-11-10. You can view files and clone it, but cannot push or open issues or pull requests.
svrjs/node_modules/ocsp/test/fixtures/gen-certs.js
2023-07-29 20:33:28 +02:00

33 lines
806 B
JavaScript
Executable file

#!/usr/bin/env node
var fs = require('fs');
var fixtures = require('../fixtures');
var options = {
serial: 42,
commonName: 'mega.ca',
size: 2048
};
fixtures.getOCSPCert(options, function(cert, key) {
fs.writeFileSync(__dirname + '/issuer-cert.pem', cert);
fs.writeFileSync(__dirname + '/issuer-key.pem', key);
var options = {
issuer: cert,
issuerKey: key,
serial: 43,
size: 2048
};
fixtures.getOCSPCert(options, function(cert, key) {
fs.writeFileSync(__dirname + '/good-cert.pem', cert);
fs.writeFileSync(__dirname + '/good-key.pem', key);
options.serial++;
fixtures.getOCSPCert(options, function(cert, key) {
fs.writeFileSync(__dirname + '/revoked-cert.pem', cert);
fs.writeFileSync(__dirname + '/revoked-key.pem', key);
});
});
});