-
Notifications
You must be signed in to change notification settings - Fork 779
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
How to get a PEM certificate from a certificate signing request ? #154
Comments
Hi @gh0st76,
Thanks!
Yes, you can do this with forge. We need to add some better examples of this to the README, but the comment below should give you some details to get you started: You should really only need to do the second half of the code there (starting with the comment "verify certification request"). Namely, verify the CSR and then use its subject and public key in a certificate that you generate and sign with your CA private key. When you're done you can export to PEM (you likely don't need the PKCS#12 stuff from the example) by just calling |
Thank you for your reply, When I try the following code:
I get this certificate:
As you can see there is no Subject or Issuer in it. is there an error in my code ? |
Sorry, @gh0st76, there was an error in that comment that was later corrected in this comment: I edited the first comment to apply the fix there so others following the link won't run into the same issue. All you need to do is access the // subject from CSR
cert.setSubject(csr.subject.attributes);
// issuer from CA
cert.setIssuer(caCert.subject.attributes); |
Thanks a lot for your help. |
Sure! If you got it working, you may go ahead and close this issue. |
Hi,
First, I want to thank you for your implementation of TLS, it's very useful.
i was wondering if it is possible to transform a
*.csr
to a signed certificate with my CA, like openssl:I use the function:
csr.sign(keys.privateKey)
and i get (it still a certificate signing request):it is possible to do it with forge ?
The text was updated successfully, but these errors were encountered: