bouncycastle

Import RSA key from bouncycastle sometimes throws “Bad Data”

岁酱吖の 提交于 2019-12-10 15:16:53
问题 Sometimes, (frequently enough to be a serious problem between .NET and bouncy castle), a key generated by bouncycastle won't import into the dotnet RSA crypto provider. It only throws "Données Incorrectes" ; no more details. ("Bad data"). I cannot debug the problem since the guilty function implementation seems to be hidden in the CLR (Utils._ImportKey() ; reference source RSACryptoServiceProvider.cs:297). I tried changing the "provider" but without success. There is the same problem here..

KeyStore with BouncyCastleProvider: KeyStore integrity check failed

只谈情不闲聊 提交于 2019-12-10 12:41:46
问题 I want to use a self-signed signature for ssl connections. I'm following this post. My problem: After creating the Keystore my integrity-check fails. Keytool-Error: java.io.IOException: KeyStore integrity check failed. I'm still searching but maybe someone can save me some time. 回答1: Make sure you are using the right password to open the keystore. I was having this error and turns out I was still using the password from the example code in trusted.load() 回答2: I had the same problem where I

SignerID cast to X509CertSelector in BouncyCastle library

南笙酒味 提交于 2019-12-10 11:47:48
问题 I'm trying to verify if an specific message is signed with a valid signature from an entity certificate recognized by my own trust anchor. I'm doing this: public static boolean isValid(CMSSignedData signedData, X509Certificate rootCert) throws Exception { CertStore certsAndCRLs = signedData.getCertificatesAndCRLs("Collection", "BC"); SignerInformationStore signers = signedData.getSignerInfos(); Iterator it = signers.getSigners().iterator(); if (it.hasNext()){ SignerInformation signer =

keytool error when creating BKS keystore: providerpath is not a legal command

╄→гoц情女王★ 提交于 2019-12-10 11:42:39
问题 I am trying to create a "bks" keystore using keytool (using terminal app on Mac OS X). I am following the instructions in: keytool error: java.security.KeyStoreException: BKS not found This is my usage: keytool -genkeypair -v -alias androiddebugkey -keyalg RSA -keysize 2048 -validity 10000 -keypass android -keystore /Users/djames/dropbox/bc146keystore/debug.keystore -storepass android -storetype BKS -providerclass org.bouncycastle.jce.provider.BouncyCastleProvider –providerpath /Users/djames

Bouncy Castle not working on linux machine

谁说我不能喝 提交于 2019-12-10 11:10:24
问题 I implemented boucnyCastle for fips complaint signature generation and verification, this worked fine on a windows environment but on a linux environment the code is stuck on keypair generation. Following is the code that i have written: public static KeyPair generateKeyPair() throws GeneralSecurityException { KeyPairGenerator keyPair = KeyPairGenerator.getInstance("RSA", "BCFIPS"); keyPair.initialize(new RSAKeyGenParameterSpec(3072, RSAKeyGenParameterSpec.F4)); return keyPair.generateKeyPair

TLS 1.2 + C# + BouncyCastle

廉价感情. 提交于 2019-12-10 10:42:26
问题 To support TLS 1.1 and above on WinCE we are using BouncyCastle library, but when making a connection it throws error "Internal TLS error, this could be an attack". Can someone advice on this. TcpClient client = new TcpClient(); client.Connect(resolvedIpAddr, PORT_TLS_11); Org.BouncyCastle.Security.SecureRandom sr = new Org.BouncyCastle.Security.SecureRandom(); TlsProtocolHandler handler = new TlsProtocolHandler(client.GetStream(), sr); handler.Connect(new MyTlsClient()); 来源: https:/

Bouncy Castle Decode CSR c#

和自甴很熟 提交于 2019-12-10 06:38:34
问题 I'm attempting to learn how to decode a csr with the bouncy castle as I intend to use it to learn other crypto things. I'm also not finding any documentation for c# just java. Here's how I'm calling DecodeCSR(string str) : static void Main(string[] args) { string csr = "-----BEGIN NEW CERTIFICATE REQUEST-----..."; DecodeCSR(csr); Console.ReadLine(); } Here's my method where I'm getting an IO Exception(Included below), my main problem is I don't know what to give Pkcs10CertificationRequest .

Encrypt in JavaScript will not decrypt in C#

断了今生、忘了曾经 提交于 2019-12-10 06:06:27
问题 I am trying to use RSA encryption in JavaScript and then decrypt it in C#. In JavaScript I am using the library jsencrypt. In C# I using the API "bouncy castle". When I do the encryption/decryption within the same language everything works. I get back the correct text when I decrypt it. When I try to decrypt in C# what was encrypted in JavaScript I get nothing close. I am sure the keys are the same between the two. An example of the code is below. Any help on how to solve this would be

How can I do that in bouncyCastle (get installed certificates)?

℡╲_俬逩灬. 提交于 2019-12-10 04:54:46
问题 Ok, I am quite new to the crypto world of bouncyCastle, and perhaps is a mental block, I can't seem to find(/google for) the equivalent to: X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser); store.Open(OpenFlags.ReadOnly); I think it might be the easiest and dumbest thing, but how can I access the windows installed certificates, using bouncy castle? Or if I can't, how can i convert my System.Security.Cryptography.X509Certificates.X509Certificate2 to Org.BouncyCastle

How do bcprov and bcprov-ext differ?

心已入冬 提交于 2019-12-10 03:14:26
问题 I noticed that there are two bouncycastle provider libraries for Java; bcprov and bcprov-ext . How do they differ? How do I choose which to use? 回答1: bcprov is typically the library you want. bcprov-ext includes some obscure crypto algorithms that haven't been part of the main release since v1.4.0. This is briefly explained on the latest releases page: From release 1.40 some implementations of encryption algorithms were removed from the regular jar files at the request of a number of users.