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
18
votes
1 answer
Unable to import .p12 keystore
I created a .p12 keystore using openssl from a pkcs8 keystore. Now I'm trying to import the private key using java Keytool into a new JKS keystore. I tried the command:
keytool -importkeystore -srckeystore newKS.p12 -srcstoretype pkcs12
…

Amir_Af
- 576
- 6
- 22
17
votes
4 answers
How to create a private key for iPhone Distribution Certificate?
In iPhone Developer Program Portal, there's a video to demonstrate how to create a development certificate and assign a private key
Now I have finished the development process and starting to distribute
I have created a "Distribution Certificate",…

Unreality
- 4,111
- 11
- 48
- 67
17
votes
3 answers
Using "OPENSSH" private key file in string with SSH.NET in C# fails with "invalid private key file"
I'm not experienced with SFTP or OpenSSH. I am trying to connect to a client's SFTP to upload a file.
I am using the SSH.NET library – https://github.com/sshnet/SSH.NET
Within my C# code I have the private key in a string variable:
var key =…

andrewb
- 2,995
- 7
- 54
- 95
17
votes
3 answers
convert .pem to .ppk on macos
There are lots of SO posts on this topic but most of them are for Windows and use the GUI. All others posts seem to use the CLI.
Is there a GUI version of puttygen on MacOS/Linux and if so instructions on how to install/use? The CLI seems to give…

codingknob
- 11,108
- 25
- 89
- 126
16
votes
2 answers
Convert OpenSSH ED25519 Private Key Format to PEM format
I have generated a an ED25519 SSH key pair using
ssh-keygen -t ed25519
The output of the id_ed25519 file is in OpenSSH format:
-----BEGIN OPENSSH PRIVATE KEY-----
...
-----END OPENSSH PRIVATE KEY-----
I would like to convert it to a PEM file…

Ferit
- 558
- 1
- 5
- 19
16
votes
3 answers
SSH.NET Authenticate via private key only (public key authentication)
Attempting to authenticate via username and privatekey only using the current SSH.NET library. I cannot get the password from the user so this is out of the question.
here is what i am doing now.
Renci.SshNet.ConnectionInfo conn =
new…

petey m
- 305
- 1
- 4
- 14
16
votes
2 answers
How to read a password encrypted key with java?
I have private key stored in file in PKCS8 DER format and protected by password. What is the easiest way to read it?
Here is the code I use to load unencrypted one:
InputStream in = new FileInputStream(privateKeyFilename);
byte[] privateKeydata =…

Denis
- 1,130
- 3
- 17
- 32
15
votes
5 answers
iPhone developer doesn't match any valid certificate (Xcode)
Hi I've kind of been cornered by apple here, I submitted a technical support query, one of the free ones thats comes free when you pay into the developer program only to be told that they won't be in the office until after Thanksgiving, a problem I…

Cian Heffernan
- 151
- 1
- 1
- 3
15
votes
5 answers
Android studio git using private key
A have an address of git repository.
Also I have a private key in open-ssh format.
Is it possible for git in Android Studio to use it?
I tried to search some info, but no luck at this time.
Thanks for any useful information!
Edit. My steps:
1. I put…

Goltsev Eugene
- 3,325
- 6
- 25
- 48
15
votes
1 answer
PSCP file from Windows to Linux using private/public keys
I can transfer file using PSCP:
C:\>pscp -pw -r -p user@Server:
But not using the public/private key.
Steps followed:
Generate public and private keys using PuTTYgen.
Copy the public key to…

user3131119
- 237
- 3
- 4
- 10
15
votes
3 answers
Get Private Key from BouncyCastle X509 Certificate? C#
Normally when I grab an X509Certificate2 out of my keystore I can call .PrivateKey to retrieve the cert's private key as an AsymmetricAlgorithm. However I have decided to use Bouncy Castle and its instance of X509Certificate only has a…

Petey B
- 11,439
- 25
- 81
- 101
14
votes
1 answer
Create PrivateKey and PublicKey from a String base64 encoding with DER format
I have my Private and Public keys in a String in base64 which where encoded using ANS1 DER. I tried creating the instance of a java PrivateKey and PublicKey:
byte [] llave2 = DatatypeConverter.parseBase64Binary(key);
PKCS8Key pkcs8 = new PKCS8Key(…

user1084509
- 1,832
- 10
- 33
- 48
14
votes
3 answers
How to implement OpenSSL functionality in Python?
I would like to encrypt a secret text by public-key and decrypt it by private-key in Python.
I can achieve that with the openssl command:
echo "secrettext/2011/09/14 22:57:23" | openssl rsautl -encrypt -pubin -inkey public.pem | base64 …

user966151
- 235
- 1
- 5
- 10
14
votes
1 answer
SSH stuck to client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
I am trying to connect to a vagrant machine on my mac (I'm using Mac OS High Sierra).
I'm using a private key to connect to it but I get stuck on this line:
client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
I use the following…

net_programmer
- 360
- 1
- 2
- 11
14
votes
1 answer
How to generate a RSA keyPair with a Privatekey encrypted with password?
I want to generate a privatekey PKCS8 format encrypted with password, and I try with this code:
String password = "123456";
KeyPairGenerator gen = KeyPairGenerator.getInstance("RSA");
gen.initialize(2048);
KeyPair key =…

Ricardo Cunha
- 2,013
- 6
- 24
- 42