private-key

How to recover lost private key of instance of aws server?

那年仲夏 提交于 2019-12-04 14:11:50
I have lost private key of my AWS instance.I searched the option in console panel. I'm afraid you might be out of luck: When you launch an instance, you should specify the name of the key pair you plan to use to connect to the instance. If you don't specify the name of an existing key pair when you launch an instance, you won't be able to connect to the instance. When you connect to the instance, you must specify the private key that corresponds to the key pair you specified when you launched the instance. Amazon EC2 doesn't keep a copy of your private key; therefore, if you lose a private key

Location of container for public and private keys in Windows?

…衆ロ難τιáo~ 提交于 2019-12-04 11:13:46
问题 I am trying to store my public and private keys in a container using following code: CspParameters cp = new CspParameters(); cp.KeyContainerName = "Test"; RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(cp); What I'd like to know is the location of the container. Is the location of the container in the file system? 回答1: You'll find the key files in the following directory (*): Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), @"Microsoft

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

孤者浪人 提交于 2019-12-04 11:09:20
问题 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 about, is the size of the modulus ("n") in RSA keys. The size is typically 1024 or 2048 bits. But I'm glad to see that this sparked a discussion, and all this is feeding my interest in cryptography. 回答1: No. The public key in a key pair always matches

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

空扰寡人 提交于 2019-12-04 05:26:07
问题 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) { crypto.subtle.importKey( 'pkcs8', PEM2Binary(key), { name: 'RSA-PSS', hash: { name: 'SHA-256' }, }, false, ['sign'] ).then(function(privKey){ crypto.subtle.sign( 'RSA-PSS', privKey, new TextEncoder().encode(token) ).then(function(signedToken){ msg =

Android studio git using private key

二次信任 提交于 2019-12-04 02:31:48
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 my private key in .ssh folder (Users/user). 2. In Android studio I run: File - Settings - Version Control - Git and put the path to Git executable. 3. Then VCS - Checkout from vesrion control - Git. I put repository address there. If I continue here, there is: But I don't have username and password, only key. If I try: got the following: And how

Only RSAPrivate (Crt) KeySpec and PKCS8EncodedKeySpec supported for RSA private keys

假装没事ソ 提交于 2019-12-03 16:28:53
I following the steps from the link : How to read .pem file to get private and public key . I executed the following three commands: 1. $openssl genrsa -out mykey.pem 2048 2. $openssl pkcs8 -topk8 -inform PEM -outform PEM -in mykey.pem -out private_key.pem -nocrypt 3. $ openssl rsa -in mykey.pem -pubout -outform DER -out public_key.der This created three files, but when I was trying to read those through Java code I started facing below error: PUBLIC KEY EXPO : 65537 Only RSAPrivate(Crt)KeySpec and PKCS8EncodedKeySpec supported for RSA private keys My code for reference: public class

Load Java KeyStore for one alias?

谁说胖子不能爱 提交于 2019-12-03 15:50:09
Does anyone know if it is possible to load a KeyStore so that it only prompts for the password for the given alias? Example: In my key store i have two private keys: Alice's Encryption Certificate and Bob's Encryption Certificate. When i load my key store: keyStore = KeyStore.getInstance("Windows-MY", "SunMSCAPI"); keyStore.load(null); I am prompted for both Alice's and Bob's key store password. Once they are entered i can use getKey("Alice's Encryption Certificate", null); to retrieve Alice's private key. My keys are protected by Entrust's Security Provider, it is who prompts me for the

Code signing with signtool fails due to private key filter

流过昼夜 提交于 2019-12-03 15:41:38
问题 While trying to sign some installer created by the company I am working for I encountered an error, which I have not been able to solve. I am using the same certificate which has been used on another machine (Win7) successfully in the same way for signing quasi the same installer. Anyway, on our Windows Server 2008 which is running CruiseControl.net I tried to sign an installer with signtool.exe and it fails with the following error: The following certificates were considered: Issued to: <our

ssh2_auth_pubkey_file authentication always fails

て烟熏妆下的殇ゞ 提交于 2019-12-03 11:24:50
I'm trying to connect to another machine using PHP's ssh2 functions. I know the ssh keys have been created with no passwords and are distributed correctly, I can ssh user@host in the terminal on my machine to the server. The PHP function tries to connect to a ip address using an ssh key file:- function minnerConnect($miner_serial) { $port = '7822'; $miner_ip = $this->getMinerIp($miner_serial); $methods = array( 'kex' => 'diffie-hellman-group1-sha1', 'hostkey' => 'ssh-dss', 'client_to_server' => array( 'crypt' => '3des-cbc', 'mac' => 'hmac-md5', 'comp' => 'none'), 'server_to_client' => array(

How to extract private key from pfx file using openssl?

倖福魔咒の 提交于 2019-12-03 10:45:02
问题 I was looking for this private key to add ssl certificate in Softlayer's "Add Certificate" wizard and to use it further with Local Load Balancer. I googled and tried following openssl command: openssl pkcs12 -in filename.pfx -nocerts -out key.pem But I ended up with invalid "RSA PRIVATE KEY". Please help. 回答1: Your command is correct, and gives you the encrypted private key in PKCS#8 format. If you need the unencrypted private key, just add the -nodes option: openssl pkcs12 -in filename.pfx