• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Carey Brown
  • Frits Walraven


Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing a project at an institution in san angelo, I need some help to build a PKI. Can you all give me some help please? Firstly, I want to use bouncycastle libraries since they would prove useful. I would need to generate a keystore,public/private key and generate certificates programatically for each peer. Next I would need to listen on a port or send out a request for a connection, does it need to be SSL? Next comes the verification and authentication process, I am assuming that both parties trust each other already so we do not need a CA to be directly invovled which sorts of not complicate things.
After client verification and authentication, I would need to encrypt and decrypt any data between the two parties.I would like very much to build a CRL. Any ideas on how to begin? If anyone has advice or any code to help me, please do.
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sounds like one of those class assignments from school.
J Krem
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup it is.. I am using the bouncycastle package and this is my code, well i am generating a keystore now :

import org.bouncycastle.jce.X509V3CertificateGenerator;
import org.bouncycastle.jce.X509Principal;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import java.security.*;
import java.security.cert.Certificate;
import java.security.cert.*;
import java.security.spec.*;
import javax.net.ssl.*;
import java.io.*;
import java.util.*;
import java.math.*;

//must create a certificate
public class keyys {

X509V3CertificateGenerator v3CertGen = new X509V3CertificateGenerator();
MessageDigest digester;
String keyPairStore = "keyKS";
String trustedStore = "trustKS";
KeyStore keyKS= KeyStore.getInstance("jks");
when i compile this code, i get an error saying

unreported exception java.security.KeyStoreException; must be caught or declared to be thrown
KeyStore keyKS= KeyStore.getInstance("jks");

Also the line in comments give me an error that package v3certGen not found...i am a bit confused..can you help me?
Oh the stink of it! Smell my tiny ad!
Two software engineers solve most of the world's problems in one K&R sized book
    Bookmark Topic Watch Topic
  • New Topic