4

I am able to sign the certificates using bouncy castle with RSA private Keys and "SHA256withRSA " algorithm. I have used below link for reference to achieve this. Sign CSR using Bouncy Castle

Now I have my CAs with Elliptic Curve keys signed with ECDSA. Hence I want to sign the certificates with EC key and "SHA256withECDSA" algorithm by these CAs. However I am stuck at below snippet specific to RSA key, I want to use EC key.

ContentSigner sigGen = new BcRSAContentSignerBuilder(sigAlgId, digAlgId).build(privateKeyParam);

Please help me how we can achieve Certificate signing with ECDSA and EC keys

Community
  • 1
  • 1
Dnyanesh
  • 101
  • 1
  • 8
  • Check if this helps http://stackoverflow.com/questions/22287795/java-bouncycastle-ecc-keys-and-self-signed-certificates – Vinodborole Apr 29 '15 at 12:55

1 Answers1

4

Below code used to sign the certificates with EC private keys

ContentSigner sigGen = new JcaContentSignerBuilder("SHA256withECDSA").build(new JcaPEMKeyConverter().getPrivateKey(PrivateKeyInfo));
Dnyanesh
  • 101
  • 1
  • 8