public-key

Using AsymmetricAlgorithm Private and Public key with RSA C#

馋奶兔 提交于 2019-11-29 23:20:36
问题 I have two AsymmetricAlgorithm objects that contain an RSA Private and RSA Public key. The private key was retrieved out of the Windows-MY keystore and the Public key from a user's certificate. How can I use these keys along with RSACryptoServiceProvider to encrypt data using the RSA algorithm in C#? In other words, how can I specify that I want to use keys that I already have? 回答1: #region "RSA Encrypt/Decrypt" public string RSAEncrypt(string str, string publicKey) { //---Creates a new

What is the public URL for the Github public keys

百般思念 提交于 2019-11-29 21:30:44
I heard that there was a public URL for all users on github where you can access their public keys or they can supply that URL of all their public keys. Is this true? If so what is that URL. Does it exist for bitbucket as well? You can get with: curl https://github.com/<username>.keys Replace <username> with the actual username of the GitHub user. This is useful when you set login permission to other servers. Just save its output into ~/.ssh/authorized_keys . To append it to the end from the command line: curl https://github.com/<username>.keys | tee -a ~/.ssh/authorized_keys It can also be

Heroku 'Permission denied (publickey) fatal: Could not read from remote repository' woes

南楼画角 提交于 2019-11-29 19:01:49
I've searched around for many hours on end looking to a solution to my seemingly easy-to-fix problem. It's not that my search turned up nothing, it's that my search turned up so many different solutions -none of which have worked. Anyways, I am simply unable to push, pull, or fetch from my Heroku repository from my Mac. Every attempt gives me (as if it's mocking me) the following error: 'Permission denied (publickey). fatal: Could not read from remote repository.' I've tried (and re-tried) to fix it in many different ways. As I've said, I've spent a good chunk of the last two days searching

Using scp to copy a file to Amazon EC2 instance?

我的未来我决定 提交于 2019-11-29 18:35:09
I am trying to use my Mac Terminal to scp a file from Downloads (phpMyAdmin I downloaded online) to my Amazon EC2 instance. The command I used was: scp -i myAmazonKey.pem phpMyAdmin-3.4.5-all-languages.tar.gz hk22@mec2-50-17-16-67.compute-1.amazonaws.com:~/. The error I got: Warning: Identity file myAmazonKey.pem not accessible: No such file or directory. Permission denied (publickey). lost connection Both my myAmazonkey.pem and phpMyAdmin-3.4.5-all-languages.tar.gz are in Downloads, so then I tried scp -i /Users/Hello_Kitty22/Downloads/myAmazonKey.pem /Users/Hello_Kitty22/Downloads/phpMyAdmin

c# RSA extract public key from private key

╄→гoц情女王★ 提交于 2019-11-29 15:20:32
Is there a way to extract public key from private key in c#? Becouse if i do ToXMLString() then i can set if i want public key information saved with the private key. So now im thinking that is there a way to extract public key from private? The normal private key format for RSA includes the public key (the "public exponent" is useful for implementation of private key operations in a way which resists timing attacks). Therefore, it is possible to extract the public key from the private key. (It is theoretically possible to have a "pure RSA private key" which does NOT include the public

Generate ECPublicKey from ECPrivateKey

五迷三道 提交于 2019-11-29 12:43:36
I'm trying to generate a public key given a private key and known curve. Below is my code: // Generate Keys ECGenParameterSpec ecGenSpec = new ECGenParameterSpec("secp256r1"); KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("ECDSA", "BC"); keyPairGenerator.initialize(ecGenSpec, new SecureRandom()); java.security.KeyPair pair = keyPairGenerator.generateKeyPair(); ECPrivateKey privateKey = (ECPrivateKey) pair.getPrivate(); ECPublicKey publicKeyExpected = (ECPublicKey) pair.getPublic(); // Expected public key System.out.print("Expected Public Key: " + BaseEncoding.base64Url()

configuring SSLContext using existing SSL key/certificate pair in java (JSSE API)

被刻印的时光 ゝ 提交于 2019-11-29 09:01:05
I am working on a java-project where I should implement the SSL-protokol on the server-side. Well, this is the first time I will use SSL in my application, so I read a lot about ssl/tls and now I want to implement something in java. I will implement this process using JSSE API: 1) client will connect to me 2) I will make authentification with my pubic key certificate. I means that I will send the client a public key and its corresponding certificate 3) the client encrypt the secret-key using my public key and RSA-algorithm and send it to me I have already the private key and certificate saved

how does public key cryptography work [duplicate]

偶尔善良 提交于 2019-11-29 08:46:54
问题 This question already has answers here : Whose key is used to encrypt a HTTPS response? (3 answers) Closed last year . What I understand about RSA is that Alice can create a public and a private key combination, and then send the public key over to Bob. And then afterward Bob can encrypt something using the public key and Alice will use the public and private key combo to decrypt it. However, how can Alice encrypt something to be sent over to Bob? How would Bob decrypt it? I ask because I'm

Use and utility of .p12 certificate/file

爱⌒轻易说出口 提交于 2019-11-29 06:31:37
问题 What is the utility of .p12 file/certificate? I am not getting any correct definition when searching the internet: In one site I got "it stores server side certificates along with intermediate certificates and private key in one file. Its mostly used in Windows Machine" In another site i got "it binds a organizations public key with its name. My question is whether its public key or private key which is included in the .p12 certificate. 回答1: The .p12 contains both the private and the public

Verifying a signature with a public key

孤街醉人 提交于 2019-11-29 02:15:44
I have an external service which call me back after some defined event, and sign his request with its private key. I have stored the public key which look like : -----BEGIN PUBLIC KEY----- ........................................ -----END PUBLIC KEY----- So my work is to check if request's content has not been alterned by verifying signature. Here is my algorithm : // 1 - reading public key : Scanner scanner = new Scanner( new File( keyPath ) ); // encodedPublicKey.toString( ); StringBuilder sb = new StringBuilder( ); while ( scanner.hasNextLine( ) ) { sb.append( scanner.nextLine( ) ); sb