bouncycastle

X.509 Certificate validation with Java and Bouncycastle

試著忘記壹切 提交于 2019-12-29 03:10:52
问题 through the bouncycastle wiki page I was able to understand how to create a X.509 root certificate and a certification request, but I do not quite understand how to proceed concept- and programming wise after that. Lets assume party A does a cert request and gets his client certificate from the CA. How can some party B validate A's certificate? What kind of certificate does A need? A root certificate? A 'normal' client certificate? And how does the validation work on programming level, if we

Translating Elliptic Curve parameters (BC to MS)

限于喜欢 提交于 2019-12-29 01:28:31
问题 I'm trying to generate ECDSA self-signed certificate as described in generate certificate using ECDSA. Putting all pieces from bartonjs's answer together and using Net.Framework 4.7 (or Net.Core 2.0 ) following code seems to be working although there are some ambiguities (at least one) left: I'm not sure how to properly convert private key ('D' parameter) from BC-BigInteger to MS-byte[] . Using BigInteger.ToByteArray() throws exception: CryptographicException : The specified key parameters

Cannot export generated certificate with a private key to byte array in .NET 4.0/4.5

可紊 提交于 2019-12-28 06:47:08
问题 I need to export and import generated certificates with private keys to and from byte arrays, and I don't have any problems unless I use .NET framework 4.0 and 4.5. I'm generating self-signed certificates with BouncyCastle library and then converting them to .NET format (X509Certificate2 object). Unfortunately with the upgrade to a newest framework I cannot export private keys. Here is the code: using System; using System.Diagnostics; using System.Security.Cryptography; using System.Security

Android to server communication using SSL with Bouncy Castle

◇◆丶佛笑我妖孽 提交于 2019-12-28 06:26:50
问题 I understand this is something which is not so difficult but very unfortunately I am stuck here and fighting it since yesterday, I have followed this Mutual Authentication in Android tutorial, to place a keystore in resources and trying to connect to my server over SSL, but getting the following exception java.lang.RuntimeException: org.spongycastle.jcajce.provider.asymmetric.x509.CertificateFactory$ExCertificateException I have placed my sslapptruststore.pfx file under res/raw

bouncycastle + JBoss AS7: JCE cannot authenticate the provider BC

戏子无情 提交于 2019-12-28 03:43:09
问题 I use BouncyCastle for encryption in my application. When I run it standalone, everything works fine. However, if I put it in the webapp and deploy on JBoss server, I get a following error: javax.servlet.ServletException: error constructing MAC: java.security.NoSuchProviderException: JCE cannot authenticate the provider BC (...) root cause java.lang.Exception: error constructing MAC: java.security.NoSuchProviderException: JCE cannot authenticate the provider BC (...) root cause java.io

Is it possible to programmatically generate an X509 certificate using only C#?

社会主义新天地 提交于 2019-12-27 16:59:06
问题 We're trying to generate an X509 certificate (including the private key) programmatically using C# and the BouncyCastle library. We've tried using some of the code from this sample by Felix Kollmann but the private key part of the certificate returns null. Code and unit test are as below: using System; using System.Collections; using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Crypto.Generators; using Org.BouncyCastle.Crypto

BouncyCastle BlowFish Crypto issue

倾然丶 夕夏残阳落幕 提交于 2019-12-26 03:46:57
问题 here is my BlowFishCrypto Class using System; using System.Collections.Generic; using System.Linq; using System.Text; using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Crypto.Modes; using Org.BouncyCastle.Crypto.Engines; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Math; namespace Common.Encryption { public class BlowfishCryptographer { private bool forEncryption; private IBufferedCipher cipher; public BlowfishCryptographer(bool forEncryption) { this.forEncryption =

Error “Malformed content.” in Signature Verification

爷,独闯天下 提交于 2019-12-25 18:26:21
问题 I want to verify my signature . my signature is a byte array. I use spongy castle I get error "org.spongycastle.cms.CMSException: Malformed content." this is my code: String base64 = Base64.toBase64String(signedchallenge); CMSSignedData cms = new CMSSignedData(Base64.decode(base64)); Store store = cms.getCertificates(); SignerInformationStore signers = cms.getSignerInfos(); Collection c = signers.getSigners(); I get error in line " CMSSignedData cms = new CMSSignedData(Base64.decode(base64));

Maven assembly jar: JCE cannot authenticate the provider BC

走远了吗. 提交于 2019-12-25 18:02:18
问题 I'm developing an app that takes a XML file, sends it to a server, and receives some data in response. I need to package it into an .exe(legacy reasons), and for that I need a jar. I intend to use assembly plugin to package the app into a jar with all the dependencies. The app works fine when run from the IDE with mvn clean package exec:java -Dexec.mainClass="cz.tomasdvorak.eetdemo.Main" -Dexec.args="C:\\eetTesting\\testtrzba.xml" but as soon as I build the standalone .jar with mvn clean

Convert der to pem through bouncy castle library

烂漫一生 提交于 2019-12-25 14:44:23
问题 I found many answers towards convert from pem to der . However, I cannot find ways to convert der to pem . for example, the following codes generates der encoded file pkcs10.cer public static void main(String[] args) throws Exception { X509Certificate[] chain = buildChain(); PEMWriter pemWrt = new PEMWriter(new OutputStreamWriter(System.out)); pemWrt.writeObject(chain[0]); FileWriter fwO = new FileWriter("pkcs10.cer"); fwO.write((chain[0]).toString()); fwO.close(); pemWrt.close(); } Like, [0]