rsa

import RSA keyPair to KeyStore

允我心安 提交于 2021-01-28 12:09:28
问题 For my specific situation, I have to generate a RSA key pair (in my Android application) using the following codes :- KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA/ECB/PKCS1Padding"); generator.initialize(1024,new SecureRandom()); KeyPair keyPair = generator.generateKeyPair); How can I import the keyPair into the Android keyStore ? I have been searching on the Internet for sometimes and did not get how can I create the self-signed certificate for the RSA public key for import

Generate x5c certificate chain from JWK

守給你的承諾、 提交于 2021-01-28 10:52:42
问题 I am using nimbus-jose-jwt 5.14 and I generated RSA key pair with the following code KeyPairGenerator gen = KeyPairGenerator.getInstance("RSA"); gen.initialize(2048); KeyPair keyPair = gen.generateKeyPair(); JWK jwk = new RSAKey.Builder((RSAPublicKey)keyPair.getPublic()) .privateKey((RSAPrivateKey)keyPair.getPrivate()) .keyUse(KeyUse.SIGNATURE) .keyID(UUID.randomUUID().toString()) .build(); Now I need to expone some "metadata" about the public key: e kid kty n use x5c How can I obtain x5c ?

What's the detail in “SHA1withRSA”?

*爱你&永不变心* 提交于 2021-01-28 07:02:45
问题 Innocently, I thought "SHA1withRSA algorithm" was simply operating the plainText with "SHA1", and use RSA/pkcs1padding to encrypt the result of "SHA1"。However, I found I was wrong until I wrote some java code to test what I thought. I use RSA publickey to decrypt the signature which I use the corresponding privatekey to sign with "SHA1withRSA algorithm" . But I found the result is not equal to "SHA1(plainText)", below is my java code: String plaintext= "123456"; Signature signature=Signature

How to store server_key_rsa in docker-compose.yml?

╄→гoц情女王★ 提交于 2021-01-28 03:12:38
问题 I need to store the server_key_rsa of my sftpServer in a docker-compose.yml but I don't know how to store it It's look like that for now : -----BEGIN RSA PRIVATE KEY----- ***********************My Key bla bla bla....... ********************************************** ********************************************** ********************************************** ********************************************** -----END RSA PRIVATE KEY----- And I would like to store it like that: server_key_rsa =

import .net public xml key to javascript in RSA

拟墨画扇 提交于 2021-01-28 02:25:48
问题 I have public key in XML that created in C# the format is: <Modulus>rYDd94biRAJ1P6j68xjARl......and so on</Modulus> <Exponent>A**B</Exponent> I want to create this key in Javascript, and encrypt string with it, how can I do it? Thanks, 回答1: After so many hours researching, testing, giving up, researching again, etc., for a solution on RSA interoperability for .NET and Javascript, I have found this library: http://www.jocys.com/Common/JsClasses/Documents/ Their classes have the same working

How to create RSA PrivateKey from string with RSAPrivateKeySpec class in Java?

≯℡__Kan透↙ 提交于 2021-01-27 22:07:07
问题 I have the below information and want to generate a public and private key in RSA (Java). String pubKey = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJXFRUWMDJZ+moC/VbcAXoY5dDxOruwI2B+B+YZRHSRRTKPyd9v0HTqdLeVgufLu/cSxlZAKtZDp9mfgyNdbY9ECAwEAAQ=="; String privKey = "MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAlcVFRYwMln6agL9VtwBehjl0PE6u7AjYH4H5hlEdJFFMo/J32/QdOp0t5WC58u79xLGVkAq1kOn2Z+DI11tj0QIDAQABAkBC1Bp71OkNAgL47edWWADVja9y9X0R70RYkst/hpQlTrjN4QxzN4k4gCqqdFkno2LfacRO7igMQuVEmYujfkbNAiEA

Is there any way to generate PSS padded signatures in PHP?

元气小坏坏 提交于 2021-01-27 20:40:43
问题 In PHP, I want to sign some documents with a padding of PSS, and a digest of SHA512. According to the docs, at http://www.php.net/manual/en/function.openssl-sign.php, I can set the digest however I need, by using a string, such as openssl_sign($text-to-sign,$binary_signature,$privkey,"sha512"); I don't see any way to set the padding, however. Can anyone please help me understand how I can sign text, using the RSA-PSS padding style, as seen in version 2.1 of PKCS #1? 回答1: In order not to be

Difference Between RSA-OAEP and RSA-PKCS1.5 [closed]

风流意气都作罢 提交于 2021-01-27 04:37:51
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . Improve this question What is the different between RSA-OAEP and RSA-PKCS1.5? My understanding is they are both RSA encryption, but using different padding schemes. What is the advantage of one over the other? If I generate a RSA 2048 pirate and public key pair, can I use the same

Difference Between RSA-OAEP and RSA-PKCS1.5 [closed]

痞子三分冷 提交于 2021-01-27 04:37:10
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . Improve this question What is the different between RSA-OAEP and RSA-PKCS1.5? My understanding is they are both RSA encryption, but using different padding schemes. What is the advantage of one over the other? If I generate a RSA 2048 pirate and public key pair, can I use the same

OAEP Padding Error When Decrypting Data in C# That Was Encrypted in JavaScript with RSA-OAEP

大憨熊 提交于 2021-01-03 08:39:51
问题 Before I get too much into the details, the high level thing I'm trying to accomplish is encrypting some data in JavaScript, sending that to a web server, then decrypting that encrypted data in C#. The part I'm having trouble with is decrypting the data in C#. I'm encrypting some data in JavaScript like this (I removed the extraneous code): // https://github.com/diafygi/webcrypto-examples#rsa-oaep---encrypt window.crypto.subtle.encrypt( { name: "RSA-OAEP" }, publicKey, data ) .then(function