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
6
votes
1 answer

ganache-cli how to read private key from account json file

I am running ganache-cli through a node application: const ganache = require('ganache-core'); const ethers = require('ethers'); const provider = new ethers.providers.Web3Provider( ganache.provider({ total_accounts: 5, account_keys_path:…
hkjhadj1
  • 848
  • 3
  • 13
  • 32
6
votes
2 answers

Store and retrieve private key from Mac keychain programmatically

In a Mac application, I have a requirement to store the private key sent from the server for logged in user in a secure way and retrieve it back whenever needed programmatically. I know that keychain is the best place to store the private key. Is…
Subhash
  • 544
  • 1
  • 5
  • 13
6
votes
2 answers

How can we copy an EVP_PKEY which includes RSA key?

I found the function EVP_PKEY_copy_parameters, which can copy EVP_PKEY. But some documentations about this function says it can only be used for DSA/ECC algorithms. The official documentation (from openssl.org) does not mention whether the function…
uping
  • 61
  • 1
  • 5
6
votes
1 answer

Python PYSFTP - pass private-key as string/text instead of passing file path

I would like to pass my actual private-key value as argument instead of providing the file path. I have used below code as of now: import pysftp import os cnopts = pysftp.CnOpts() if str(host_keys).lower() =='none': cnopts.hostkeys =…
6
votes
4 answers

Securely Handling Private Keys from Windows Key Store

I'm working on an application that encrypts configuration file settings for an ASP.Net web server. The encryption method I'm implementing is enveloping data using AES and RSA. I'm generating an AES Key, using that AES key to encrypt my data, then…
Petey B
  • 11,439
  • 25
  • 81
  • 101
6
votes
2 answers

C#, .Net Core Private key authentication httpClient

We are having a problem with a friend with loading a private certificate to httpHandler. We are using .net core and need to host all aplication in the cloud. Main goal is to get message from SQS and perform some specified API shots after with…
Kacper Werema
  • 448
  • 2
  • 5
  • 18
6
votes
1 answer

How can I import an RSA private key in PEM format for use with WebCrypto?

I'm trying to use WebCrypto to sign a token with RSA-PSS, but I keep getting the error: DataError: Data provided to an operation does not meet requirements at crypto.subtle.importKey. This is my JavaScript code: function signToken(token, key) { …
Benjy Wiener
  • 1,085
  • 2
  • 9
  • 27
6
votes
1 answer

How do I load an OpenSSL ECDSA key into C#?

I need to load an OpenSSL private key into a C# based application. The commands I used to generate the key are: $ openssl ecparam -name prime256v1 -genkey -noout -out eckey.pem $ openssl ec -in eckey.pem read EC key writing EC key -----BEGIN EC…
makerofthings7
  • 60,103
  • 53
  • 215
  • 448
6
votes
1 answer

In Android, how to ensure that Private Key is stored inside secure hardware

KeyInfo's isInsideSecureHardware-method's return value seems to depend on device model, os version, and some other random factors. For example when using Sony xperia z5 compact with older os version isInsideSecureHardware() could return true for…
KaPa
  • 61
  • 1
  • 4
6
votes
2 answers

Using X509Certificate2 to get PrivateKey causes CryptographicException "Invalid provider type specified"

everyone, I am developing a web application that uses X509Certificate2 to get a private key from a certification file. Code snippet looks like following: public static RSACryptoServiceProvider GetSignProviderFromPfx() { var…
Alan Zhao
  • 61
  • 1
  • 3
6
votes
2 answers

How to decrypt a pkcs8 encrypted private key using bouncy castle?

i am trying to decrypt a pkcs8 encrypted private key using bouncy castle library. I parsed the file containing the private key using PEMParser provided by bouncy castle. I got PKCS8EncryptedPrivateKeyInfo object. I am unable to get the…
krk92
  • 69
  • 1
  • 4
6
votes
2 answers

unable to load certificate 6300:error:0906D06C:PEM routines:PEM_read_bio:no start line

When I run the command below to check my private-key PEM file, an error pops up unable to load certificate 6300:error:0906D06C:PEM routines:PEM_read_bio:no start line:.\crypto\pem\pem_lib.c:703:Expecting: TRUSTED CERTIFICATE command : C:\>openssl…
Stephen Raj
  • 61
  • 1
  • 1
  • 3
6
votes
1 answer

Extending expiration date of trustedCertEntry within a keystore

Using keytool, I am trying to extend the expiration date of a trustedCertEntry within a keystore that I have. The keystore has the contents below $ keytool -list -keystore certs/authTruststore.jks Enter keystore password: Keystore type:…
McLovin
  • 1,455
  • 3
  • 19
  • 37
6
votes
2 answers

how does big companies like google, amazon, manage their private key infrastructure?

one of my company's employees private key was compromised and it had the disastrous consequences to the company. now the company is planning to have the public/ private key management. Im wondering how the big companies like google, amazon do the…
user3392188
  • 81
  • 1
  • 2
6
votes
4 answers

Saving a crypted private key in a cookie

I am currently working on a project with a lot of security and I am having a bit of a problem choosing a technical solution to satisfy my customer need. First things first, let me explain you the customer need. For my customer's website, at some…
Ahmed
  • 61
  • 3