bouncycastle

BouncyCastleProvider fails to load at Tomcat 7's startup on a Mac OSX

血红的双手。 提交于 2019-12-11 09:49:19
问题 I am trying to set-up a Tomcat Application development environment on my brand new MacBook Pro. I need to set-up an SSL connector implementing org.bouncycastle.jce.provider.BouncyCastleProvider . Tomcat 7 starts but the SSL connector fails to be mounted and i read this stack in Tomcat Out : Grave: Failed to initialize connector [Connector[HTTP/1.1-9443]] org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-9443]] at org.apache.catalina.util.LifecycleBase

Adding a new Extension to my generated certificate

冷暖自知 提交于 2019-12-11 06:28:02
问题 I need to add a new Extension of OID 1.3.6.1.5.5.7.1.26 in my certificate. I got this OID extension in my certificate but with the following error: Certificate Extensions: 10 [1]: ObjectId: 1.3.6.1.5.5.7.1.26 Criticality=false Extension unknown: DER encoded OCTET string = 0000: 04 0C 30 0A 13 08 33 39 20 64 63 20 32 62 ..0... 39 dc 2b I want this OID to be recognized similar to other extensions like AuthorityInfoAccess , etc. Do I need to edit the jar of Bouncy Castle X509 class? Im using

convert CertStore into X509Certificate[ ] array JAVA

六眼飞鱼酱① 提交于 2019-12-11 06:26:58
问题 I made a cert store and want to add another certificate from another function in this class. Make chain in class 1 with caCert and intermediateCert : List<X509Certificate> certList = new ArrayList<X509Certificate>(); certList.add(0, interCert); certList.add(1, caCert); Store<X509Certificate> certs = new JcaCertStore(certList); certStore = new JcaCertStoreBuilder().addCertificates(certs).build(); I want to add a new build user certificate in class 2: certStore = new JcaCertStoreBuilder()

EC private key to CngKey in C#

浪尽此生 提交于 2019-12-11 06:05:51
问题 I need to convert a EC private key generated by BouncyCastle to a CngKey in C#. Ultimately, I'm trying to create a PKCS12 that can be imported into the Windows Key Store and am following the information and code example found here. The EC key pair is generated as follows: var ecKeyPairGenerator = new ECKeyPairGenerator("ECDSA"); ECKeyGenerationParameters ecKeyGenParams = new ECKeyGenerationParameters(SecObjectIdentifiers.SecP384r1, new SecureRandom()); AsymmetricCipherKeyPair pair =

Adding Certificates to CMS Signed Data

ぃ、小莉子 提交于 2019-12-11 05:24:21
问题 I am currently using the java Bouncy Castle libraries in order to create CMS signed data (or PKCS7 signed data). I seem however to be stuck with adding certificates (even though the certificate signer is properly added). I checked out this question about properly signing data, but it didn't respond the needs of my SCEP server. The code I used was from EJBCA but doesn't seem to add certificates to the PKCS7 signed data. When I parse the signed data with the openssl cms tool, I see that the

Dependencies of Bouncy Castle OpenPGP library on the Bouncy Castle provider

痴心易碎 提交于 2019-12-11 04:58:43
问题 The Bouncy Castle library has an OpenPGP Maven listing which specifies that it relies during compile time on the Bouncy Castle Provider, which is a separate module / artifact / library / .jar file. However, the OpenPGP library has been build on top of the Java Cryptography Architecture (JCA) per its own specifications (using e.g. Cipher with a CipherSpi implementation for instance, provided by a Java security provider). How does the OpenPGP library depend on the Bouncy Castle provider? Does

X509 RSA bouncy castle sign and verify plain text in Java

五迷三道 提交于 2019-12-11 04:45:26
问题 I am currently writing a Java program using BouncyCastle that generates an X509 SSL certificate with an RSA key pair. I have been able to successfully create the SSL cert but I also want the ability to then sign arbitrary plain text and with that signature verify ownership of the keys by verifying the signature against the plain text. The methods should look something like this: protected String SignData(String privateKey, String text) { //return a signature } and protected boolean

PhpSeclib <-> BouncyCastle RSA

我是研究僧i 提交于 2019-12-11 04:27:30
问题 I generated on server side a pair public/private keys using phpseclib like include 'Crypt/RSA.php'; $rsa = new Crypt_RSA(); $rsa->setPrivateKeyFormat(CRYPT_RSA_PRIVATE_FORMAT_PKCS1); $rsa->setPublicKeyFormat(CRYPT_RSA_PUBLIC_FORMAT_PKCS1); extract($rsa->createKey()); echo $privatekey; echo "\n\n\n"; echo $publickey; Now I want import on client side Public key using Java Bouncy Castle engine. Here my Public key -----BEGIN PUBLIC KEY----- MIGJAoGBAJEGAmaQejDgJaCg/B5+g68arqpMpl6jZ9+p8TBzNRIq+Ygt

How do you convert a JCE algorithm name into an AlgorithmIdentifier object?

烈酒焚心 提交于 2019-12-11 04:23:23
问题 I'm using BouncyCastle 1.54. I have a JCE algorithm string - like "ECDSAwithSHA256" (for example). I need an org.bouncycastle.asn1.x509.AlgorithmIdentifier object. Alternatively, I could create an AlgorithmIdentifier object from an OID, but that begs the question of how to translate an algorithm string into an OID instead. I could create a giant if/else, but there's got to be a standard way to do this. 回答1: You can use the algorithm finders of BouncyCastle (see javadoc) import org

Using CmsEnvelopedData with CmsSignedData to verify signed data

徘徊边缘 提交于 2019-12-11 04:03:06
问题 I'm are receiving signed and encrypted content from a third party. I'm informed that the message structure is PKCS7 (1.2.840.113549.1.7.4 - SignedAndEnvelopedData). I have successfully decrypted the message content using the following code: var message = File.ReadAllBytes(@"C:\PKI\receivedMessage"); var cmsEnvelopedData = new CmsEnvelopedData(message); var recipients = cmsEnvelopedData.GetRecipientInfos(); var cert = GetPfxFileCertFromDisk(); var privateKeyInfo = PrivateKeyInfoFactory