Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

devcert

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

devcert - npm Package Compare versions

Comparing version 1.0.0-beta.10 to 1.0.0-beta.11

9

dist/certificate-authority.js

@@ -91,2 +91,3 @@ "use strict";

return new Promise((resolve, reject) => {
prompt.message = 'password';
prompt.start();

@@ -96,3 +97,3 @@ prompt.get({

password: {
message: 'password:',
message: '',
hidden: true

@@ -108,8 +109,8 @@ }

let cipher = crypto.createCipher('aes256', key);
return cipher.update(new Buffer(text)) + cipher.final('hex');
return cipher.update(text, 'utf8', 'hex') + cipher.final('hex');
}
function decrypt(encrypted, key) {
let decipher = crypto.createDecipher('aes256', key);
return decipher.update(encrypted, 'hex') + decipher.final('utf8');
return decipher.update(encrypted, 'hex', 'utf8') + decipher.final('utf8');
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2VydGlmaWNhdGUtYXV0aG9yaXR5LmpzIiwic291cmNlUm9vdCI6Ii9Vc2Vycy9kYXcvb3NzL2RldmNlcnQvIiwic291cmNlcyI6WyJjZXJ0aWZpY2F0ZS1hdXRob3JpdHkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsaUNBQWlDO0FBQ2pDLDJCQUEwRTtBQUMxRSxxQ0FBcUM7QUFDckMsMkJBQTJCO0FBQzNCLDZCQUFzQztBQUN0QyxpQ0FBaUM7QUFFakMsMkNBUXFCO0FBQ3JCLDZDQUFvRDtBQUNwRCw2Q0FBc0Q7QUFDdEQsaURBQTBEO0FBQzFELG1DQUFrQztBQUNsQyxpREFBNkM7QUFHN0MsTUFBTSxLQUFLLEdBQUcsV0FBVyxDQUFDLCtCQUErQixDQUFDLENBQUM7QUFFM0Q7OztHQUdHO0FBQ0gscUNBQTBELFVBQW1CLEVBQUU7O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dvcmRGcm9tVXNlcigpOiBQcm9taXNlPHN0cmluZz4ge1xuICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuICAgIHByb21wdC5zdGFydCgpO1xuICAgIHByb21wdC5nZXQoe1xuICAgICAgcHJvcGVydGllczoge1xuICAgICAgICBwYXNzd29yZDoge1xuICAgICAgICAgIG1lc3NhZ2U6ICdwYXNzd29yZDonLFxuICAgICAgICAgIGhpZGRlbjogdHJ1ZVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfSwgKGVycjogRXJyb3IsIHsgcGFzc3dvcmQgfTogeyBwYXNzd29yZDogc3RyaW5nIH0pID0+IHtcbiAgICAgIGVyciA/IHJlamVjdChlcnIpIDogcmVzb2x2ZShwYXNzd29yZCk7XG4gICAgfSk7XG4gIH0pO1xufVxuXG5mdW5jdGlvbiBlbmNyeXB0KHRleHQ6IHN0cmluZywga2V5OiBzdHJpbmcpIHtcbiAgbGV0IGNpcGhlciA9IGNyeXB0by5jcmVhdGVDaXBoZXIoJ2FlczI1NicsIGtleSk7XG4gIHJldHVybiBjaXBoZXIudXBkYXRlKG5ldyBCdWZmZXIodGV4dCkpICsgY2lwaGVyLmZpbmFsKCdoZXgnKTtcbn1cblxuZnVuY3Rpb24gZGVjcnlwdChlbmNyeXB0ZWQ6IHN0cmluZywga2V5OiBzdHJpbmcpIHtcbiAgbGV0IGRlY2lwaGVyID0gY3J5cHRvLmNyZWF0ZURlY2lwaGVyKCdhZXMyNTYnLCBrZXkpO1xuICByZXR1cm4gZGVjaXBoZXIudXBkYXRlKGVuY3J5cHRlZCwgJ2hleCcpICsgZGVjaXBoZXIuZmluYWwoJ3V0ZjgnKTtcbn0iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2VydGlmaWNhdGUtYXV0aG9yaXR5LmpzIiwic291cmNlUm9vdCI6Ii9Vc2Vycy9kYXcvb3NzL2RldmNlcnQvIiwic291cm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ZUNpcGhlcignYWVzMjU2Jywga2V5KTtcbiAgcmV0dXJuIGNpcGhlci51cGRhdGUodGV4dCwgJ3V0ZjgnLCAnaGV4JykgKyBjaXBoZXIuZmluYWwoJ2hleCcpO1xufVxuXG5mdW5jdGlvbiBkZWNyeXB0KGVuY3J5cHRlZDogc3RyaW5nLCBrZXk6IHN0cmluZykge1xuICBsZXQgZGVjaXBoZXIgPSBjcnlwdG8uY3JlYXRlRGVjaXBoZXIoJ2FlczI1NicsIGtleSk7XG4gIHJldHVybiBkZWNpcGhlci51cGRhdGUoZW5jcnlwdGVkLCAnaGV4JywgJ3V0ZjgnKSArIGRlY2lwaGVyLmZpbmFsKCd1dGY4Jyk7XG59Il19

@@ -26,6 +26,6 @@ "use strict";

debug(`Generating certificate signing request for ${domain}`);
let csrFile = constants_1.pathForDomain(domain, `${domain}.csr`);
let csrFile = constants_1.pathForDomain(domain, `certificate-signing-request.csr`);
utils_1.openssl(`req -config ${constants_1.opensslConfPath} -subj "/CN=${domain}" -key ${keyPath} -out ${csrFile} -new`);
debug(`Generating certificate for ${domain} from signing request and signing with root CA`);
let certPath = constants_1.pathForDomain(`${domain}.crt`);
let certPath = constants_1.pathForDomain(domain, `certificate.crt`);
let { decryptedCAKeyPath, decryptedCACertPath } = yield certificate_authority_1.fetchCertificateAuthorityCredentials();

@@ -45,2 +45,2 @@ utils_1.openssl(`ca -config ${constants_1.opensslConfPath} -in ${csrFile} -out ${path.basename(certPath)} -outdir ${path.dirname(certPath)} -keyfile ${decryptedCAKeyPath} -cert ${decryptedCACertPath} -notext -md sha256 -days 7000 -batch -extensions server_cert`);

exports.generateKey = generateKey;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2VydGlmaWNhdGVzLmpzIiwic291cmNlUm9vdCI6Ii9Vc2Vycy9kYXcvb3NzL2RldmNlcnQvIiwic291cmNlcyI6WyJjZXJ0aWZpY2F0ZXMudHMiXSwibmFtZXMiOltdLCJtYXB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J0UGF0aCB9IC1ub3RleHQgLW1kIHNoYTI1NiAtZGF5cyA3MDAwIC1iYXRjaCAtZXh0ZW5zaW9ucyBzZXJ2ZXJfY2VydGApXG5cbiAgcm0oZGVjcnlwdGVkQ0FLZXlQYXRoKTtcbiAgcm0oZGVjcnlwdGVkQ0FDZXJ0UGF0aCk7XG59XG5cbi8vIEdlbmVyYXRlIGEgY3J5cHRvZ3JhcGhpYyBrZXksIHVzZWQgdG8gc2lnbiBjZXJ0aWZpY2F0ZXMgb3IgY2VydGlmaWNhdGUgc2lnbmluZyByZXF1ZXN0cy5cbmV4cG9ydCBmdW5jdGlvbiBnZW5lcmF0ZUtleShmaWxlbmFtZTogc3RyaW5nKTogdm9pZCB7XG4gIGRlYnVnKGBnZW5lcmF0ZUtleTogJHsgZmlsZW5hbWUgfWApO1xuICBvcGVuc3NsKGBnZW5yc2EgLW91dCAkeyBmaWxlbmFtZSB9IDIwNDhgKTtcbiAgY2htb2QoZmlsZW5hbWUsIDQwMCk7XG59Il19
{
"name": "devcert",
"version": "1.0.0-beta.10",
"version": "1.0.0-beta.11",
"description": "Generate trusted local SSL/TLS certificates for local SSL development",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -84,4 +84,4 @@ import * as crypto from 'crypto';

let encryptionKey = await getPasswordFromUser();
writeFile(decryptedCAKeyPath , decrypt(encryptedCAKey, encryptionKey));
writeFile(decryptedCACertPath , decrypt(encryptedCACert, encryptionKey));
writeFile(decryptedCAKeyPath, decrypt(encryptedCAKey, encryptionKey));
writeFile(decryptedCACertPath, decrypt(encryptedCACert, encryptionKey));
return { decryptedCAKeyPath , decryptedCACertPath };

@@ -101,2 +101,3 @@ }

return new Promise((resolve, reject) => {
prompt.message = 'password';
prompt.start();

@@ -106,3 +107,3 @@ prompt.get({

password: {
message: 'password:',
message: '',
hidden: true

@@ -119,3 +120,3 @@ }

let cipher = crypto.createCipher('aes256', key);
return cipher.update(new Buffer(text)) + cipher.final('hex');
return cipher.update(text, 'utf8', 'hex') + cipher.final('hex');
}

@@ -125,3 +126,3 @@

let decipher = crypto.createDecipher('aes256', key);
return decipher.update(encrypted, 'hex') + decipher.final('utf8');
return decipher.update(encrypted, 'hex', 'utf8') + decipher.final('utf8');
}

@@ -26,7 +26,7 @@ import * as path from 'path';

debug(`Generating certificate signing request for ${ domain }`);
let csrFile = pathForDomain(domain, `${ domain }.csr`);
let csrFile = pathForDomain(domain, `certificate-signing-request.csr`);
openssl(`req -config ${ opensslConfPath } -subj "/CN=${ domain }" -key ${ keyPath } -out ${ csrFile } -new`);
debug(`Generating certificate for ${ domain } from signing request and signing with root CA`);
let certPath = pathForDomain(`${ domain }.crt`);
let certPath = pathForDomain(domain, `certificate.crt`);
let { decryptedCAKeyPath, decryptedCACertPath } = await fetchCertificateAuthorityCredentials();

@@ -33,0 +33,0 @@ openssl(`ca -config ${ opensslConfPath } -in ${ csrFile } -out ${ path.basename(certPath) } -outdir ${ path.dirname(certPath) } -keyfile ${ decryptedCAKeyPath } -cert ${ decryptedCACertPath } -notext -md sha256 -days 7000 -batch -extensions server_cert`)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc