bouncycastle

BouncyCastle .NET custom TlsClient for anon CipherSuite working on Android, but not Windows

杀马特。学长 韩版系。学妹 提交于 2020-01-24 14:33:32
问题 I've got access to a java application, which uses the CipherSuite TLS_ECDH_anon_WITH_AES_256_CBC_SHA for communication (No possibility to use another one). Some time ago I had to write a Xamarin App in C#, which connected to it successfully using Bouncy Castle PCL. I had to use Bouncy Castle, since Android (>=6.0) does not allow to use the previously mentioned cipher suite by default. Now, I have to write a .NET application on Windows, which shall connect to the exact same Java application,

Bouncy castle no such method error

余生长醉 提交于 2020-01-24 13:05:33
问题 I'm trying to decrypt a file using Bouncy Castle v1.53 PGP and Using PGPUtil class. The program works fine in my Eclipse, but given following error when integrated inside a war file and deployed onto a weblogic server.I'm using following dependencies: 1)bcpg-jdk15on 2)bcprov-jdk15on Error java.lang.NoSuchMethodError: org.bouncycastle.util.Strings.newList()Lorg/bouncycastle/util/StringList; at org.bouncycastle.bcpg.ArmoredInputStream.<init>(Unknown Source) at org.bouncycastle.bcpg

Issue with using bouncycastle libraries to enable TLSv1.2 for JDK1.6 running on Tomcat7

烈酒焚心 提交于 2020-01-22 02:27:52
问题 I am trying to make api calls from my apache tomcat7 server running jdk1.6 (on an aws ec2) to aws api gateway private endpoints inside my vpc. Such private endpoints only allow TLSv1.2. I am using jdk1.6.45 (which does not have TLSv1.2 support OOTB) and there is no possibility of upgrading due to other constraints. I am attempting to use bouncy castle jce and jsse providers so that I can create https connections to the api gateway using HttpsUrlConnection object. I am having issues with the

Verifying ECDSA signature with Bouncy Castle in C#

倾然丶 夕夏残阳落幕 提交于 2020-01-21 08:52:11
问题 I have a problem when I try to verify the ECDSA signature in Bouncy Castle in C#. The code is adopted from Java example that I have, so I am 100% sure that the public key and signature are correct. But the C# implementation always returns that the signature is not valid. I checked the curve parameters and they are correct. I tried with DER and "raw" signature and again it did not work. Can anybody spot what I am doing wrong: namespace TestECDSA { class Program { static void Main(string[] args

An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll

試著忘記壹切 提交于 2020-01-17 05:05:17
问题 using Org.BouncyCastle.Math; string p = "E7A69EBDF105F2A6BBDEAD7E798F76A209AD73FB466431E2E7352ED262F8C558F10BEFEA977DE9E21DCEE9B04D245F300ECCBBA03E72630556D011023F9E857F"; BigInteger P= new BigInteger(p); throwing Exception System.FormatException: Input string was not in a correct format. at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffe r& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style,

CMSSignedDataStreamGenerator hash does not match

点点圈 提交于 2020-01-17 01:25:09
问题 I'm writing an application that signs and envelopes data using BouncyCastle . I need to sign large files so instead of using the CMSSignedDataGenerator (which works just fine for small files) I chose to use CMSSignedDataStreamGenerator . The signed files are being generated but the SHA1 hash does not match with the original file. Could you help me? Here`s the code: try { int buff = 16384; byte[] buffer = new byte[buff]; int unitsize = 0; long read = 0; long offset = file.length();

What is the .NET System.Numerics.BigInteger Equivalent of Org.BouncyCastle.Math.BigInteger.ToByteArrayUnsigned?

本秂侑毒 提交于 2020-01-16 08:13:11
问题 I am currently working with the .NET port of BouncyCastle and I am having some trouble converting a big integer into a System.Guid using the native .NET BigInteger . For some context, I am using BouncyCastle in one ("source") application to convert a System.Guid to a Org.BouncyCastle.Math.BigInteger . This value is then saved as a string in the format 3A2B847A960F0E4A8D49BD62DDB6EB38 . Then, in another ("destination") application, I am taking this saved string value of a BigInteger and am

Signature not verified though the correct public key and signature file are being used

孤人 提交于 2020-01-16 04:14:06
问题 result variable in the below class is always returning false though I am using the correct signature file and the public key. public class VeriGen { static FileInputStream fin; public static void main(String args[]) throws Exception { Security.addProvider(new BouncyCastleProvider()); KeyStore msCertStore = KeyStore.getInstance("Windows-MY", "SunMSCAPI"); msCertStore.load(null, null); X509Certificate c = ((X509Certificate) msCertStore.getCertificate("Software View Certificate Authority"));

SpongyCastle: Error while finalizing cipher

删除回忆录丶 提交于 2020-01-15 09:40:14
问题 in an Android project I need to authenticate my app for an https connection. Using the following method I'm trying to decrypt my private key, provided by the server developers in a .pem file. I use SpongyCastle , and at the top of the same class where the methods are I already changed the security provider like this: static { Security.insertProviderAt(new org.spongycastle.jce.provider.BouncyCastleProvider(), 1); } In this case my object is an instance of PKCS8EncryptedPrivateKeyInfo . This is

SpongyCastle: Error while finalizing cipher

元气小坏坏 提交于 2020-01-15 09:40:05
问题 in an Android project I need to authenticate my app for an https connection. Using the following method I'm trying to decrypt my private key, provided by the server developers in a .pem file. I use SpongyCastle , and at the top of the same class where the methods are I already changed the security provider like this: static { Security.insertProviderAt(new org.spongycastle.jce.provider.BouncyCastleProvider(), 1); } In this case my object is an instance of PKCS8EncryptedPrivateKeyInfo . This is