Private key that occurs in asymmetric cryptography algorithms such as RSA and Diffie-Hellman as the counterpart to a public key. The private key must never be divulged while the public key can be made available to everyone. If your question is not pertaining specifically to the private key (usage/encoding/etc.), you should use more appropriate tags such as [public-key-encryption], [digital-signature], [diffie-hellman] or even [cryptography].
Questions tagged [private-key]
1626 questions
591
votes
7 answers
Convert .pem to .crt and .key
Can anyone tell me the correct way/command to extract/convert the certificate .crt and private key .key files from a .pem file? I just read they are interchangable, but not how.

Lanbo
- 15,118
- 16
- 70
- 147
328
votes
10 answers
How does a public key verify a signature?
I am trying to get a better grapple on how public/private keys work. I understand that a sender may add a digital signature to a document using his/her private key to essentially obtain a hash of the document, but what I do not understand is how the…

jcampos8782
- 3,956
- 4
- 22
- 23
257
votes
2 answers
Differences between "BEGIN RSA PRIVATE KEY" and "BEGIN PRIVATE KEY"
Hi I was writing a program that imports private keys from a .pem file and create a private key object to use it later..
the problem I have faced is that some pem files header begin with
-----BEGIN PRIVATE KEY-----
while others begin…

monim
- 3,427
- 3
- 23
- 36
172
votes
32 answers
Vagrant ssh authentication failure
The problem with ssh authentication:
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter…

ic3b3rg
- 14,629
- 4
- 30
- 53
138
votes
15 answers
Unable to load Private Key. (PEM routines:PEM_read_bio:no start line:pem_lib.c:648:Expecting: ANY PRIVATE KEY)
I have a .key file which is PEM formatted private key file. I didn't make this file but I got this from somewhere.
I wanted to see its MD5 hash with openssl tool like below command.
openssl rsa -in server.key -modulus -noout
But this generates…

tkpl
- 2,279
- 2
- 16
- 8
109
votes
2 answers
How do I get the public key of a pem file?
I have a .pem file containing my private key. However, a BitBucket deployment key has this format:
ssh-rsa…

sdgfsdh
- 33,689
- 26
- 132
- 245
106
votes
7 answers
How to Export Private / Secret ASC Key to Decrypt GPG Files
Background: My boss has tried exporting an ASC key to me with public and private parts but whenever I get the file the private part never loads up and it won't decrypt any files.
We have tried Exporting the ASC Key using:
Windows Application…

Brian McCarthy
- 4,658
- 16
- 49
- 66
101
votes
6 answers
How to Export a Multi-line Environment Variable in Bash/Terminal e.g: RSA Private Key
One of our Apps github-backup requires the use of an RSA Private Key as an Environment Variable.
Simply attempting to export the key it in the terminal e.g:
text
export PRIVATE_KEY=-----BEGIN RSA PRIVATE…

nelsonic
- 31,111
- 21
- 89
- 120
77
votes
5 answers
Pageant does not load SSH-2 key generated with GitBash
The implementation of key handling with (Tortoise)Git for Windows confuses me. As far as I understood, you can implement with either ssh.exe (gits own ssh program), where you can then choose an ssh key per host in your ssh_config in the 'faked' home…

atripes
- 1,683
- 4
- 20
- 23
70
votes
2 answers
What are code signing identities in Xcode about?
What are "code signing identities" in Xcode?
Are they the certificates?
Are they the private keys?
Are they the app ids?
Are they the provisioning profiles?
If I go to the target build settings, it asks for the code signing identity, so I need to…

user4951
- 32,206
- 53
- 172
- 282
63
votes
2 answers
How do I setup Public-Key Authentication?
How do I setup Public-Key Authentication for SSH?

Eldila
- 15,426
- 23
- 58
- 62
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
3 answers
Are exported private keys in GPG still encrypted?
Are the exported private keys gotten by executing gpg --export-secret-keys still encrypted and protected by their passphrase? This seems to be the case but I can't find anywhere that explicitly confirms this.
If the exported keys are still encrypted…

Matuku
- 919
- 2
- 7
- 8
56
votes
2 answers
Chain is null when retrieving private key
I'm encrypting data in my app using a RSA keypair that I am storing in the Android keystore.
I've been seeing NullPointerExceptions in the Play Store, but I have not been able to reproduce them:
java.lang.NullPointerException: chain == null
at…

AesSedai101
- 1,502
- 2
- 23
- 37
47
votes
3 answers
X.509: Private / Public Key
We're trying to implement some functionality of a Web-Service from one of our partners. Now, the content which is beeing transmitted, should be encrypted with a public key, which we have to provide.
The security-specification says that the…

Ahatius
- 4,777
- 11
- 49
- 79