Questions tagged [pem]

PEM, (from Privacy Enhanced Mail standard) is a base64 container format for encoding keys and certificates.

PEM (Privacy Enhanced Mail standard) is a base64 container format that encodes keys and certificates surrounded by header lines, and is used extensively by . It is defined in RFC standards 1421-1424

1003 questions
79
votes
13 answers

Node.js https pem error: routines:PEM_read_bio:no start line

I am messing with login form right now with node.js, I tried creating a pem key and csr using openssl req -newkey rsa:2048 -new -nodes -keyout key.pem -out csr.pem However I been getting errors for running node server.js Here is my server.js var…
xbd
  • 965
  • 1
  • 9
  • 14
64
votes
12 answers

Write x509 certificate into PEM formatted string in java?

Is there some high level way to write an X509Certificate into a PEM formatted string? Currently I'm doing x509cert.encode() to write it into a DER formatted string, then base 64 encoding it and appending the header and footer to create a PEM string,…
pizzathehut
  • 665
  • 1
  • 6
  • 5
60
votes
4 answers

Create a PEM from a PPK file

So there are plenty of tutorials on how to convert a PEM to a PPK using puttyGen. However my issue is that my windows machine had the only PEM copy and I converted it into a PPK and deleted it. Now I need to figure out how to convert a PPK into a…
CMOS
  • 2,727
  • 8
  • 47
  • 83
59
votes
1 answer

PEM_read_bio_PrivateKey() returns NULL in ECB mode only

PEM_read_bio_PrivateKey() returns NULL if a private key is encrypted by DES EDE in ECB mode. The issue happens in EVP_DecryptFinal_ex(): 4128:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:330: If the same private…
Alex
  • 2,361
  • 1
  • 20
  • 27
57
votes
6 answers

C# Export Private/Public RSA key from RSACryptoServiceProvider to PEM string

I have an instance of System.Security.Cryptography.RSACryptoServiceProvider, i need to export it's key to a PEM string - like this: -----BEGIN RSA PRIVATE…
nidzo732
  • 721
  • 1
  • 8
  • 10
49
votes
3 answers

Enter PEM pass phrase when converting PKCS#12 certificate into PEM

I am using OpenSSL to convert my "me.p12" to PEM. When I generate "me.p12", I set a password for it. The "me.p12" contains a private key and a certificate. When I convert it to PEM, I run command: openssl pkcs12 -in me.p12 -out me.pem Then, it…
Leem.fin
  • 40,781
  • 83
  • 202
  • 354
48
votes
2 answers

PuTTYgen doesn't give me the option for SSH-2 RSA

I've been accessing my AWS EC2 instance from Ubuntu for years with no issues. I'd like to also connect to it from a Windows machine. The procedure seems straight forward... copy my *.pem file to the Windows machine and convert to *.ppk using…
Skinner
  • 1,461
  • 4
  • 17
  • 27
44
votes
2 answers

How to extract the RSA public key from a .cer and store it in a .pem using OpenSSL?

I have the requirement to extract the public key (RSA) from a *.cer file. I wish to extract the key and store it in a .pem file so I can use its value to encrypt values using jsencrypt. The following command converts a .cer to .pem: openssl x509…
Steven Anderson
  • 8,398
  • 4
  • 27
  • 32
44
votes
9 answers

How can I decode a SSL certificate using python?

How can I decode a pem-encoded (base64) certificate with Python? For example this here from github.com: -----BEGIN…
puwei219
  • 547
  • 1
  • 4
  • 8
43
votes
3 answers

ssl : Unable to load certificate

I have 2 files - CSR.csr and newkey.key, both seem to be in PEM format as follows - -----BEGIN CERTIFICATE REQUEST----- MIID.... -----END CERTIFICATE REQUEST----- -----BEGIN RSA PRIVATE KEY----- MI... -----END RSA PRIVATE KEY----- When I'm…
Kat.S
  • 587
  • 2
  • 7
  • 13
39
votes
7 answers

how to get private key from PEM file?

i have a .PEM file that includes public key and a private key for SSL data transfer like this: -----BEGIN RSA PRIVATE KEY----- private key data -----END RSA PRIVATE KEY----- -----BEGIN CERTIFICATE----- public key data -----END…
losingsleeep
  • 1,849
  • 7
  • 29
  • 46
39
votes
1 answer

Comments in a pem file

Is there a way to put comments in a pem certificate such that openssl will ignore the comments while parsing the certificate?
Ravi Nankani
  • 539
  • 1
  • 7
  • 15
30
votes
2 answers

How to convert .p12 file to .pem file using Terminal?

I already have an development certificate in apple developer portal. Am developing an iPhone app,i want to integrate Apple Push Notification in this app. I have created a new App ID with used the existing certificate and enabled the Push…
Gopinath
  • 5,392
  • 21
  • 64
  • 97
28
votes
6 answers

SSH hangs when connecting to Amazon EC2 instance

I could connect to ec2 instance with the following command, but today I couldn't connect using it. ssh -i abcKey.pem ubuntu@ec2-x-x-x-x.ap-southeast-1.compute.amazonaws.com -v Following is the verbose. I have opened SSH port in EC2 ( I could…
Isuru Gunawardana
  • 2,847
  • 6
  • 28
  • 60
28
votes
2 answers

Openssl convert .PEM containing only RSA Private Key to .PKCS12

Currently I have a .PEM file containing only a private key. I need to convert this file into a .PKCS12 file. Currently I'm trying to use openssl to achieve this and I'm running into some problems. The .PEM file I'm using is of the form: -----BEGIN…
1
2
3
66 67