public-key

How to create a X509 certificate using Java?

為{幸葍}努か 提交于 2019-11-29 01:52:10
I want to create a X509 certificate using Java language and then extract public key from it. I have searched the internet and found many code examples, but all of them have errors (unknown variable or unknown type) or have many warnings that say something like : "the method ... from type ... is deprecated " etc. For example, why the following code doesn't work: PublicKey pk; CertificateFactory cf = CertificateFactory.getInstance("X.509"); String PKstr = pk.toString(); InputStream PKstream = new ByteArrayInputStream(PKstr.getBytes()); X509Certificate pkcert = (X509Certificate)cf

X.509: Private / Public Key

家住魔仙堡 提交于 2019-11-28 17:15:32
We're trying to implement some functionality of a Web-Service from one of our partners. Now, the content which is beeing transmitted, should be encrypted with a public key, which we have to provide. The security-specification says that the public-certificate has to be X.509 standard. Doesn't X.509 rely on the private / public key method? Because I only get one .pem file, containing a private key, and a certificate, but no public key, using the following command: openssl req -new -x509 -days 365 -nodes -out ./cert.pem -keyout ./cert.pem Do I have to modify the command in order to create a

iPhone: How to create a SecKeyRef from a public key file (PEM)

橙三吉。 提交于 2019-11-28 16:54:58
In order to send and receive encrypted messages from/to the iPhone I need to read a public key (server's public key) PEM file and create a SecKeyRef (later I could even store it on the keychain in order not to create it again). This is my current workflow: On the server: Create a P12 file with the user's certificate and private key. Store the user's public key on the server's keychain. On the iPhone: Retrieve the P12 file from the server, use the password to open it and store the private key on the keychain. On the iPhone: Retrieve a PEM file with the server's public key from the server.

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

时光总嘲笑我的痴心妄想 提交于 2019-11-28 13:13:33
问题 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

Whose key is used to encrypt a HTTPS response?

99封情书 提交于 2019-11-28 11:33:07
I have a web server built up relying on HTTPS. So, my server maintains its private key and publish a public key that any clients can use to encrypt their request. Since my server is the only one who has the private key to decrypt any message encryped using server's public key, any request sent this way can be considered secure. However my question is at the response part. When the server sends the response back to the client, whose public key will the server use to encrypt the response message? I assume the server will use client's public key to encrypt the response (by default? or upon

how do I remove my public key from github?

馋奶兔 提交于 2019-11-28 09:16:24
问题 I've got a public linked to my profile on github. I put it up a long time ago. Since the time I put it up, I've lost the private key of the pair. I have generated a new key pair and put it on my github profile. But I still can't push to github. git gives me errors related to my keys. I'd like to remove the old public key, but I can't seem to find the option to do so in githubs admin dashboards. I can't find any instructions for how to remove keys. I've emailed them for help, but haven't

For RSA, how do i calculate the secret exponent?

半世苍凉 提交于 2019-11-28 09:09:17
For RSA, how do i calculate the secret exponent? Given p and q the two primes, and phi=(p-1)(q-1), and the public exponent (0x10001), how do i get the secret exponent 'd' ? I've read that i have to do: d = e -1 mod phi using modular inversion and the euclidean equation but i cannot understand how the above formula maps to either the a -1 ≡ x mod m formula on the modular inversion wiki page, or how it maps to the euclidean GCD equation. Can someone help please, cheers You can use the extended Euclidean algorithm to solve for d in the congruence de = 1 mod phi(m) For RSA encryption, e is the

RSA Encryption Javascript

独自空忆成欢 提交于 2019-11-28 08:24:05
can anyone please help me with this, i have been instructed to write an application that takes some DATA then Encrypts it with a RSA Public Key and apparently needs to be RSA Encryption(i have never heard or seen this before)? Which encryption cipher is RSA meant to use as standard? var key = "TUlHZE1BMEdDU3FHU0liM0RRRUJBUVVBQTRHTEFEQ0Jod0tCZ1FDbVFiTWc3SWRpeHVmYWEwcDd2ODVLVytmUnVlZ216UUhibnNoWjhmbXlTQW9MMXRFVzAyNEZKVFlSTFZxN0VsV2p1R0U4aHQ3RmJjN1NURWpxZVViWU5xdnRiVWN6UFZYSE5FdStYRUVndGszazlFNXVQWG0wVzRIc3RtK0FhRXcyMmxxb2lFNGlrT1QzZzdPRXNHSVFCMVNlSlRtVTE1eFBBZ3M3SXRjTVFRSUJFUT09"; var data =

C# How to simply encrypt a text file with a PGP Public Key?

天涯浪子 提交于 2019-11-28 05:55:55
I've researched a bit about how to achieve what I said in the question and found several APIs but most of them look very complicated and since I'm just a noobie in this area I just want a simple method like: public String Encrypt(String message, PublicKey publicKey) Don't know if this can be done? If not then please someone enlighten me another way to achieve this :) Thank you. UPDATE: So far I have only seen that all of the library for OpenPGP encryption require both the public key and private key to do the encrypt while I only want to encrypt with the public key (because I don't have the