bouncycastle

How can I create a PKCS12 p12 file with selfsigned certificate for DSA keypair in C#?

五迷三道 提交于 2019-12-19 10:22:26
问题 I need to generate my own DSA keypair and store it as a bundle of private key and certificate in .p12 file using C#. This question How do I create a PKCS12 .p12 file in C#? seems to be very similar, but it does not help me, unfortunately, because there are some significant differences (RSA vs DSA, etc.) I am trying to generate the keypair using System.Security.Cryptography.DSACryptoServiceProvider and then to generate a X509 certificate using Bouncy Castle: using (DSACryptoServiceProvider csp

X509 certificate signed with bouncy castle is not valid

时间秒杀一切 提交于 2019-12-19 09:26:15
问题 I went quite a long way to make java sign a CSR and at last I was able to do this, but openssl tells that it's not valid. The same CSR signed with openssl passes verification step. All is the same x509 version (1), no extensions, Subject, Issuer are the same. I suspect the problem is with subject DN (email especially) or dates. Verification: openssl verify -verbose -CAfile src/test/resources/ca.cer.pem o.cer.pem o.cer.pem: OK openssl verify -verbose -CAfile src/test/resources/ca.cer.pem

Verify javacard signature ALG_ECDSA_SHA on bouncy castle

跟風遠走 提交于 2019-12-19 04:05:50
问题 My problem looks like this: im generating a signature on javaCard (jcdk 2.2.2) and when when i want to verify it on the terminal using BouncyCastle the signature isnt always verified- 1 in 3,66 (average in 100 tries) signatures are verified, the rest in returning false. when i verify the signature on the card it always returns true, but on the terminal it usually returns false, but sometimes true. because the terminal sometimes gives a positive answer i think that the code is ok and the

BouncyCastle PrivateKey To X509Certificate2 PrivateKey

≡放荡痞女 提交于 2019-12-18 19:08:14
问题 I create a certificate using BouncyCastle var keypairgen = new RsaKeyPairGenerator(); keypairgen.Init(new KeyGenerationParameters(new SecureRandom(new CryptoApiRandomGenerator()), 1024)); var keypair = keypairgen.GenerateKeyPair(); var gen = new X509V3CertificateGenerator(); var CN = new X509Name("CN=" + certName); var SN = BigInteger.ProbablePrime(120, new Random()); gen.SetSerialNumber(SN); gen.SetSubjectDN(CN); gen.SetIssuerDN(CN); gen.SetNotAfter(DateTime.Now.AddYears(1)); gen

how to add timestamp without Digital Signature

自作多情 提交于 2019-12-18 18:31:16
问题 I want to add Time Stamp to my PDF document (without Digital Signature). How can I do this? I can do it with Digital signature using Itext ( I have here TSAClient): MakeSignature.signDetached(appearance, digest, signature, chain, null, null, tsa, 0, subfilter); but how to do similar thing without digital signature? using Bouncy Castle or Itext or Pdfbox... or with another library.. 回答1: In iText you are looking for LtvTimestamp.timestamp(appearance, tsa, signatureName); Also cf. the JavaDoc

Digital signature with timestamp in Java

被刻印的时光 ゝ 提交于 2019-12-18 18:15:08
问题 I have an issue creating a valid CMS signature with Bouncy Castle using a trusted timestamp. The signature creation works well (I want to include the signature to a PDF file), the signature is valid. But after I include a trusted timestamp to the signature's unsigned attribute table, the signature still stays valid, but the Reader reports that The signature includes an embedded timestamp but it is invalid . This leads me to believe, that the hash I timestamp is not the correct one, but I

BouncyCastle 1.51 loading in war on Wildfly 8.0

旧街凉风 提交于 2019-12-18 15:17:40
问题 Background I am trying to use bouncy castle library to decrypt private keys in my war. Now I tested the code first in a standalone app and it worked fine. Now when I am testing it as a webapp in Wildfly8.0 am facing some issues with Bouncy castle. The Wildfly 8.0 am using has bouncy castle provider module installed. The BC version being used in v1.46. The code that I have developed uses v1.51. I have followed the steps mentioned here: https://developer.jboss.org/thread/175395 bouncycastle +

BouncyCastle on Android

自闭症网瘾萝莉.ら 提交于 2019-12-18 13:21:17
问题 I am using PBEWITHSHA256AND256BITAES-CBC-BC to encrypt binary data which contains sensitive user data I just want to confirm if BouncyCastle is part of every Android SDK after (2.1) as I read a on a few sites that BouncyCastle is not part of every Android SDK. Would like a definitive answer 回答1: You can also try the SpongyCastle library which is a precompiled build of BouncyCastle but tested with Android. https://github.com/rtyley/spongycastle 回答2: BouncyCastle is not a part of Android SDK.

Need example for BouncyCastle PGP File encryption in C#

久未见 提交于 2019-12-18 12:01:34
问题 I'm trying to encrypt files using my private key (in ascii format) and any other public key (also in ascii format). The BouncyCastle library looks like the correct thing to use, but I cannot find documentation for C#. Could anyone please assist me with an example. Thank you. 回答1: Here's some code from the BouncyCastle example. You should grab the source code and look in the unit tests, they contain examples. I've found that Java resources are also useful. The example can be found in the

Need example for BouncyCastle PGP File encryption in C#

元气小坏坏 提交于 2019-12-18 12:01:08
问题 I'm trying to encrypt files using my private key (in ascii format) and any other public key (also in ascii format). The BouncyCastle library looks like the correct thing to use, but I cannot find documentation for C#. Could anyone please assist me with an example. Thank you. 回答1: Here's some code from the BouncyCastle example. You should grab the source code and look in the unit tests, they contain examples. I've found that Java resources are also useful. The example can be found in the