org.bouncycastle.jce.examples
Class PKCS12Example
java.lang.Object
|
+--org.bouncycastle.jce.examples.PKCS12Example
- public class PKCS12Example
- extends java.lang.Object
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 modify the 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...
Method Summary |
static AuthorityKeyIdentifier |
createAuthorityKeyId(java.security.PublicKey pubKey)
|
static AuthorityKeyIdentifier |
createAuthorityKeyId(java.security.PublicKey pubKey,
X509Name name,
int sNumber)
|
static java.security.cert.Certificate |
createCert(java.security.PublicKey pubKey,
java.security.PrivateKey caPrivKey,
java.security.PublicKey caPubKey)
we generate a certificate signed by our CA's intermediate certficate |
static java.security.cert.Certificate |
createIntermediateCert(java.security.PublicKey pubKey,
java.security.PrivateKey caPrivKey,
java.security.PublicKey caPubKey)
we generate an intermediate certificate signed by our CA |
static java.security.cert.Certificate |
createMasterCert(java.security.PublicKey pubKey,
java.security.PrivateKey privKey)
we generate the CA's certificate |
static SubjectKeyIdentifier |
createSubjectKeyId(java.security.PublicKey pubKey)
|
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PKCS12Example
public PKCS12Example()
createSubjectKeyId
public static SubjectKeyIdentifier createSubjectKeyId(java.security.PublicKey pubKey)
createAuthorityKeyId
public static AuthorityKeyIdentifier createAuthorityKeyId(java.security.PublicKey pubKey,
X509Name name,
int sNumber)
createAuthorityKeyId
public static AuthorityKeyIdentifier createAuthorityKeyId(java.security.PublicKey pubKey)
createMasterCert
public static java.security.cert.Certificate createMasterCert(java.security.PublicKey pubKey,
java.security.PrivateKey privKey)
throws java.lang.Exception
- we generate the CA's certificate
createIntermediateCert
public static java.security.cert.Certificate createIntermediateCert(java.security.PublicKey pubKey,
java.security.PrivateKey caPrivKey,
java.security.PublicKey caPubKey)
throws java.lang.Exception
- we generate an intermediate certificate signed by our CA
createCert
public static java.security.cert.Certificate createCert(java.security.PublicKey pubKey,
java.security.PrivateKey caPrivKey,
java.security.PublicKey caPubKey)
throws java.lang.Exception
- we generate a certificate signed by our CA's intermediate certficate
main
public static void main(java.lang.String[] args)
throws java.lang.Exception