Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'Read edited cert data from CSR': (test: any) => {
const certInfo = {
issuer : {},
country: 'EE',
state: 'Harjumaa',
locality: 'Tallinn',
organization: 'Node.ee',
organizationUnit: 'test',
commonName: 'www.node.ee',
emailAddress: 'andris@node.ee'
};
pem.createCSR(Object.create(certInfo), (error: any, data: any) => {
const csr = (data && data.csr || '').toString();
test.ifError(error);
// test.ok(fs.readdirSync('./tmp').length === 0);
pem.readCertificateInfo(csr, (error: any, data: any) => {
test.ifError(error);
test.deepEqual(data, certInfo);
// test.ok(fs.readdirSync('./tmp').length === 0);
test.done();
});
});
},
'Read edited cert data from CSR': (test: any) => {
var certInfo = {
issuer : {},
country: 'EE',
state: 'Harjumaa',
locality: 'Tallinn',
organization: 'Node.ee',
organizationUnit: 'test',
commonName: 'www.node.ee',
emailAddress: 'andris@node.ee'
};
pem.createCSR(Object.create(certInfo), (error: any, data: any) => {
var csr = (data && data.csr || '').toString();
test.ifError(error);
// test.ok(fs.readdirSync('./tmp').length === 0);
pem.readCertificateInfo(csr, (error: any, data: any) => {
test.ifError(error);
test.deepEqual(data, certInfo);
// test.ok(fs.readdirSync('./tmp').length === 0);
test.done();
});
});
},
tasks.push(function(cb){
pem.createCSR(csrOptions, function(err, csr){
cb(err, csr);
});
});