bouncycastle

Spongycastle is missing many algorithms when loaded on android

耗尽温柔 提交于 2019-12-08 02:05:50
问题 In this stackoverflow answer you can see a code to print all available providers and corresponding algorithms: How to find out what algorithm [ encryption ] are supported by my JVM? I am using latest version of spongycastle and when I ask to get the algorithms of Spongycastle ("SC") on android I get only a handful of algorithm. In fact I get this very limited list : provider: SC algorithm: PBEWITHMD5ANDDES algorithm: PBEWITHSHA256AND192BITAES-CBC-BC algorithm: OLDHMACSHA384 algorithm:

Unable to cast object of type 'Org.BouncyCastle.Asn1.DerSequence' to type 'Org.BouncyCastle.Asn1.DerInteger'

前提是你 提交于 2019-12-07 21:26:18
问题 in my c # project, I put this piece of code : initially, I recovered from the certificate that I created with bouncy castle, the key pair, then I extract the private key, my goal is that , it is in a format. pem, AsymmetricKeyParameter private_RSA = keyPair2.Private; PrivateKeyInfo k_RSA = PrivateKeyInfoFactory.CreatePrivateKeyInfo(private_RSA); byte[] serializedKey_priv_RSA = k_RSA.ToAsn1Object().GetDerEncoded(); // byte[] clé = Org.BouncyCastle.Utilities.Encoders.Hex.Decode(serializedKey);

BouncyCastle Library in ColdFusion 10

依然范特西╮ 提交于 2019-12-07 18:51:54
问题 I've been trying to get RSA Private Key Encryption working in ColdFusion 10 and installed the BouncyCastle library since it supports the encryption mode that my application requires. Trying to load the library with JavaLoader resulted in errors ("Class is on the bootclasspath" and "JCE cannot authenticate the provider BC") so I had to install it statically... Copy the jar to %CF_ROOT%/jre/lib/ext/ and add the following to %CF_ROOT%/jre/lib/security/java.security : security.provider.<N>=org

Encrypt Data with C# AesCryptoServiceProvider crypted with BouncyCastle AesFastEngine

落花浮王杯 提交于 2019-12-07 16:05:38
问题 I need to decrypt Data with Standard C# AesCryptoServiceProvider which was encrypted with Bouncy Castle AesFastEngine on the Java side. (To decrypt the Data using the c# implementation of Bounca Castle is no problem) Is there a way to do this? I don't find the IV used in the Bouncy Castle implementation... Is there any? Any help would be really fine! Markus EDIT: The following code is used to initialize the AesFastEngine: BlockCipher coder = new AESFastEngine(); CFBBlockCipher cfbCipher = new

RSA Public exponent defaults to 65537. What should this value be? What are the impacts of my choices?

a 夏天 提交于 2019-12-07 15:04:02
问题 I'm creating unit tests for software that may encounter different exponent sizes. (see section 3.3.1 of this RFC) How can I use Bouncy Castle, or any other C# library to generate a RSA key pair that doesn't have a key size of 65537. If the answer is that I can directly modify this, as long as I update the private key as well, what specific changes (or re-computation) should I make for the public and private key? Here is the sample code that I'm using to create the key with the exponent of

Generating a ECDSA Private key in bouncy castle returns a PUBLIC key

纵饮孤独 提交于 2019-12-07 15:03:48
问题 I am attempting to use bouncy castle to generate ECDSA keys. The code seems to work fine from the Java perspective; but, when I dump the file and try to validate the data, OpenSSL does not like the format of the data. After some research, I figured that bouncy castle is encoding the private key as public key. Here is my Java code: public class Test { public static void main(String[] args) { Security.addProvider(new BouncyCastleProvider()); System.out.println("Starting..."); String name =

Generating X.509 Certificate using Bouncy Castle Java API

一个人想着一个人 提交于 2019-12-07 14:47:49
问题 I am trying to generate a X.509 Certificate using Bouncy Castle Java API. I found sample code at: http://www.bouncycastle.org/wiki/display/JA1/X.509+Public+Key+Certificate+and+Certification+Request+Generation However, after compile the below codes, JVM shows an error message as shown below Could not find the main class: org.bouncycastle.util.AllTests. Program will exit. Note that org.bouncycastle.util.AllTests is inserted into the Java build path. How can I fix my code to work properly?

Replicating 'openssl smime' in Java with Bouncy Castle?

点点圈 提交于 2019-12-07 11:46:31
问题 I have a problem in hand. My colleague who doesn't know Java is using OpenSSL commands to sign a file as follows: openssl smime -binary -sign -certfile WWDR.pem -signer passcertificate.pem \ -inkey passkey.pem -in manifest.json -out signature -outform DER \ -passin pass:12345 As you can see there are three files here that are given to the openssl command to generate the signature. Now we want to replicate the same functionality using Java because the content that we are suppose to be signed

Generate GOST 34.10-2001 keypair and save it to some keystore

淺唱寂寞╮ 提交于 2019-12-07 11:36:29
问题 Currently I need to generate a keypair for GOST 34.10-2001 signature algorithm. It was pleasant to discover that bouncy castle provider has supported this algorithm, but I can not generate a keypair and save it to any keystore of any type. Currently I tried this command (this command works great if keyalg is DSA and sigalg is SHA1withDSA ): keytool -genkey -alias test1 -keyalg ECGOST3410 -keysize 512 -sigalg GOST3411withECGOST3410 \ -keypass test_1 -validity 1000 -storetype JKS -keystore

Use Bouncy Castle library with .NET Compact Framework

試著忘記壹切 提交于 2019-12-07 11:30:26
问题 I’m trying to use Bouncy Castle v1.7 on a Windows Mobile 6.5 device. I’m trying to execute the following code: ISigner signer = SignerUtilities.GetSigner("SHA256withRSA"); Using the Bouncy Castle binaries On the Windows Mobile device, the code results in the following exception being thrown: "The version of the assembly System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=B77A5C561934E089 cannot be loaded by this version of the Microsoft .NET Compact Framework." On a classic desktop