private-key

How to parse(Convert to RSAParameters) X.509 private key in C#?

独自空忆成欢 提交于 2020-01-28 02:52:06
问题 I'm working on an encryption channel to encrypt the communication between two devices. So I'm creating a helper class to do the encryption and decryption. I've googled a lot and found a piece of code that can parse RSA Public Key Into RSACryptoServiceProvider . This is the code: public static RSACryptoServiceProvider DecodeX509PublicKey(byte[] x509key) { byte[] SeqOID = { 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00 }; byte[] seq = new byte[15];

Sign data using private key on client-side (javascript)

做~自己de王妃 提交于 2020-01-22 09:54:28
问题 I know, it looks strange, but I need to sign some data on client-side using javascript only, no ajax backdoor to server-side openssl available. Could someone suggest some client-side solution to sign data using private key? Is it possible? Thanks. 回答1: Found great signing tool. It implements RSA-SHA1 (works perfectly) and RSA-SHA256 (works strange), and allow both to generate signature using private key and to verify signature using certificate. 回答2: I've gone down the same road as you, you

Converting a string private key to PrivateKey type

被刻印的时光 ゝ 提交于 2020-01-21 14:07:29
问题 I am having below RSA private key in string format. String privatekey = -----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEAqAKCCMKqboM8ywSuNvmf2zuT0e2elxntdEe5msv22jzT89Xa 1Q/V4CeQdZruIw8eTAMa67Dej+3cPdSrjdDnfxcb9L14U9oFPgOyvxVwb+/S8jqm F9o7Gvm85X972C8izh+K4ndpPtztxkZ0g7cu7RqrCCBzw5SUfi3pgIpprdiKlVDP 4lF7CTwzRH+oi+BxwOABEiuKOJtjOXX1WJhV6ukEy8K6Fq/QOyt/7vgxkm8I8HMo SMq2UZNswn5/9SqMWuaTBaQbjZ2f77zaq5X/jOiCThTxFNPjPnzhKhG8ekaqIUpB y9VuICFgdtVQimnlDykrdJWyeOFWPjYl5vehkwIDAQABAoIBAQCN2Ig2ozvHUA/s

RSA decrypt with Java

别等时光非礼了梦想. 提交于 2020-01-15 10:18:06
问题 I am trying to decrypt a string with RSA. It was encrypted in C# on the iPhone and I have the private key. This seems like a silly problem, but all of the examples I have seen show generating the private key. I have the private key (it is a byte[] of hex). It using PKCS#1 padding. The part I cannot figure out how to do is create a java.security.Key object with the private key I already have. Do I need to have them give me the private key in 2 parts...modulus and exponent? Thanks in advance.

Generate RSA private key from n, e, d, p, q values in bash with OpenSSL [duplicate]

两盒软妹~` 提交于 2020-01-13 11:24:09
问题 This question already has answers here : How to Generate rsa keys using specific input numbers in openssl? (2 answers) Closed 3 years ago . I have calculated n, e, d, p, q values of an RSA key. Now, how can I generate a private key file (pem or der) with openssl command line tools? I was thinking about openssl asn1parse -genconf asn1.cnf -noout -out asn1.der but I cannot understand how to build the conf file. 回答1: The OpenSSL manpage for asn_generate_nconf comes with an example cnf for

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

橙三吉。 提交于 2020-01-12 08:38: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

Amazon EC2 lost private key, how to get access to the server? [closed]

China☆狼群 提交于 2020-01-12 06:40:09
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . My computer was stolen the day before yesterday, and I put one of my servers private key in that, the key is password protected, so it should be OK. But the problem is that now I can not access the server. The server is Ubuntu, Amazon EC2, Root Device: Instance Store. I've been searching this for a whole day,

Private key of certificate in certificate-store not readable

微笑、不失礼 提交于 2020-01-10 10:21:22
问题 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) and C:\Users\[Username]\AppData\Roaming\Microsoft\Crypto\RSA (and subdirectories) However since I want the setup to install the application to all users, the custom action is running under the SYSTEM -User, which leads the files beeing actually

Private key of certificate in certificate-store not readable

旧街凉风 提交于 2020-01-10 10:20:13
问题 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) and C:\Users\[Username]\AppData\Roaming\Microsoft\Crypto\RSA (and subdirectories) However since I want the setup to install the application to all users, the custom action is running under the SYSTEM -User, which leads the files beeing actually

convert PEM encoded RSA private key to AsymmetricKeyParameter

╄→гoц情女王★ 提交于 2020-01-05 02:46:12
问题 I am trying (but failing) to create a method that constructs an AsymmetricKeyParameter from a PEM encoded private key. How can I complete this method? It seems that an older version of BouncyCastle had a pemReader.ReadObject() method whose results could be casted, but that no longer exists. I have tried various combinations of using PrivateKeyFactory , PrivateKeyInfo , Asn1Object and perhaps 10 other types, but all are throwing an exception at some point. static AsymmetricKeyParameter