public class

PKCS12Example

extends Object
java.lang.Object
   ↳ org.bouncycastle.jce.examples.PKCS12Example

Class Overview

Example of how to set up a certificiate chain and a PKCS 12 store for a private individual - obviously you'll need to generate your own keys, and you may need to add a NetscapeCertType extension or add a key usage extension depending on your application, but you should get the idea! As always this is just an example...

Summary

Public Constructors
PKCS12Example()
Public Methods
static Certificate createCert(PublicKey pubKey, PrivateKey caPrivKey, PublicKey caPubKey)
we generate a certificate signed by our CA's intermediate certficate
static Certificate createIntermediateCert(PublicKey pubKey, PrivateKey caPrivKey, X509Certificate caCert)
we generate an intermediate certificate signed by our CA
static Certificate createMasterCert(PublicKey pubKey, PrivateKey privKey)
we generate the CA's certificate
static void main(String[] args)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public PKCS12Example ()

Public Methods

public static Certificate createCert (PublicKey pubKey, PrivateKey caPrivKey, PublicKey caPubKey)

we generate a certificate signed by our CA's intermediate certficate

Throws
Exception

public static Certificate createIntermediateCert (PublicKey pubKey, PrivateKey caPrivKey, X509Certificate caCert)

we generate an intermediate certificate signed by our CA

Throws
Exception

public static Certificate createMasterCert (PublicKey pubKey, PrivateKey privKey)

we generate the CA's certificate

Throws
Exception

public static void main (String[] args)

Throws
Exception