Questions tagged [private-key]

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].

1626 questions
11
votes
4 answers

Export private key from X509Certificate object

We use C# code we build X509Certificate2 with .p12 file, in the constructor we insert the path to certificate, certificate's password. We also marked it as Exportable as shown below: X509Certificate2 x509Certificate2 = new…
RRR
  • 3,937
  • 13
  • 51
  • 75
11
votes
1 answer

Why can't openssl read an ssh private key created by openssh on OSX

Here is a test script I am using to help debug an issue with openssl &/or ssh on OSX Mojave 10.14.5 with brew installed versions of openssl and openssh > brew info openssh | head -1 stable 8.0p1 (bottled) > brew info openssl | head -1 stable 1.0.2r…
jonseymour
  • 1,006
  • 1
  • 12
  • 22
11
votes
6 answers

CngKey.Import on azure

var rawData = Convert.FromBase64String(_signingKey); var cng = CngKey.Import(rawData, CngKeyBlobFormat.Pkcs8PrivateBlob); I use this code to extract key, from embedded base64 string. It works fine when I test it locally but when I publish on azure…
Vladimir Sakic
  • 111
  • 1
  • 5
11
votes
1 answer

Difference between X.509 and pem

In cryptography, what is the difference between X.509 and pem? Can X.509 format contain a private key? Can private key be in pem format?
Ville Miekk-oja
  • 18,749
  • 32
  • 70
  • 106
11
votes
2 answers

How to connect to SFTP through Paramiko with SSH key and Pageant

I am trying to connect to an SFTP through Paramiko with a passphrase protected SSH key. I have loaded the key into Pageant (which I understand is supported by Paramiko) but I can't get it to decrypt my private key. I have found this example here…
Tim S_
  • 445
  • 2
  • 6
  • 14
11
votes
2 answers

Can I modify a private key validity?

I'm a newbie in computer security and I have a basic question whose answer I've not been able to find out. I have a private key whose validity period has expired. Using that key I'd previously generated a .csr and sent it to a CA and they'd given me…
user1031431
  • 1,475
  • 6
  • 17
  • 24
11
votes
2 answers

What is a private key in Android?

I read this article about signing your Android applications. I used Eclipse to export my Android application, had to create a keystore (which succeeded) and a private key with an alias (which also succeeded). So I know that I have to sign the…
MC Emperor
  • 22,334
  • 15
  • 80
  • 130
11
votes
5 answers

how to encrypt a file using private key in gpg

I'm producing an update for some systems and I want to encrypt the updates for keeping confidentiality, integrity and validity of my signature. I want to encrypt the file with my private key and send them to my client so that they can decrypt it…
11
votes
1 answer

Private key of certificate in certificate-store not readable

I think I've got the same issue like this guy, but I wasn't as lucky as him/her since the solution provided doesn't work for me. The solution provided looks for files on the C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys (not in sub directories)…
GameScripting
  • 16,092
  • 13
  • 59
  • 98
10
votes
3 answers

Generating a JWT using an existing private key and RS256 algorithm

have the below RSA Private key with me and I have to generate a JWT token using RS256 algorithm. Here is my sample Private Key: -----BEGIN RSA PRIVATE KEY-----…
Vihaan
  • 101
  • 1
  • 1
  • 5
10
votes
1 answer

JSch to add private key from a string

I have the contents of the key pair file for SFTP as a string. I need to use JSch to add the contents, but addIdentity only accepts a file path. Is there anyway I can do this? I see that the KeyPair class has a method - KeyPair load(JSch jsch,…
eechpeech
  • 255
  • 1
  • 4
  • 17
10
votes
5 answers

Can a public key have a different length (encryption) than the private key?

I have a 1024 bits private key, and use it to generate a public key. Does that automatically mean that my public key also has 1024 encryption? Or can it be of a lesser encryption size? (512, 256...) PS: What i'm mostly interested in, and talking…
Rolf
  • 5,550
  • 5
  • 41
  • 61
10
votes
4 answers

ssh cannot use the IdentityFile config in file ~/.ssh/config

client:Mac 10.8,server:Ubuntu 10.04 LTS 64bit I use 'ssh-keygen -t rsa' generate public/private keys. First, I input: ssh -i /Users/phenix/.ssh/poponet_rsa root@popo.net, I can login to the server with the private key 'poponet_rsa' Next, I create a…
zgia
  • 111
  • 1
  • 1
  • 3
10
votes
5 answers

Encrypting with RSA private key in Java

I'm trying to encrypt some content with an RSA private key. I'm following this example: http://www.junkheap.net/content/public_key_encryption_java but converting it to use private keys rather than public. Following that example, I think what I…
wadesworld
  • 13,535
  • 14
  • 60
  • 93
10
votes
5 answers

Whats wrong with being your own Certificate Authority and self-signing for your email encryption?

Is there any real reason to use a 3rd party Certificate Authority for your own email security? ( meaning using S/MIME ) I found I am able to become my own CAuthority and create my own self-signed root certificates...and they work just fine installed…