Skip to content

Add serviceKeyPassword option for createCertificate #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kousha-icracked opened this issue Apr 10, 2015 · 2 comments
Closed

Add serviceKeyPassword option for createCertificate #54

kousha-icracked opened this issue Apr 10, 2015 · 2 comments

Comments

@kousha-icracked
Copy link

Similar to createCSR where you can pass clientKeyPassword as an option to automatically use the password without prompting for it, it would be amazing to have the capability for pem.createCertificate and that we could pass the serviceKeyPassword and prevent the prompt from the terminal.

@petersunquest
Copy link

I just plus some code to pem.js. Then I can use a password private key to create createCertificate.

183 'commonName = Common Name',
184 'commonName_max = 64',
185 ].join('\n'));
186 }
+

  • var passwordFilePath = null;
  • if (options.clientKeyPassword) {
  •    passwordFilePath = pathlib.join(tempDir, crypto.randomBytes(20).toString('hex'));
    
  •    fs.writeFileSync(passwordFilePath, options.clientKeyPassword);
    
  •    params.push('-passin');
    
  •    params.push('file:' + passwordFilePath);
    
  • }

188 execOpenSSL(params, 'CERTIFICATE REQUEST', tmpfiles, function(error, data) {
189 if (passwordFilePath) {
190 fs.unlink(passwordFilePath);
191 }

@Dexus
Copy link
Owner

Dexus commented Aug 26, 2015

an option is added.

@Dexus Dexus closed this as completed Aug 26, 2015
Dexus pushed a commit that referenced this issue Aug 26, 2015
push version to 1.8.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants