| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.objectweb.proactive.ext.security.KeyTools
public class KeyTools
Tools to handle common key and keystore operations.
| Method Summary | |
|---|---|
static java.security.KeyStore | 
createJKS(java.lang.String alias,
          java.security.PrivateKey privKey,
          java.lang.String password,
          java.security.cert.X509Certificate cert,
          java.security.cert.Certificate[] cachain)
Creates JKS-file that can be used with JDK.  | 
static java.security.KeyStore | 
createP12(java.lang.String alias,
          java.security.PrivateKey privKey,
          java.security.cert.X509Certificate cert,
          java.security.cert.Certificate[] cachain)
Creates PKCS12-file that can be imported in IE or Netscape.  | 
static java.security.KeyStore | 
createP12(java.lang.String alias,
          java.security.PrivateKey privKey,
          java.security.cert.X509Certificate cert,
          java.util.Collection<java.security.cert.Certificate> cacerts)
Creates PKCS12-file that can be imported in IE or Netscape.  | 
static java.security.KeyStore | 
createP12(java.lang.String alias,
          java.security.PrivateKey privKey,
          java.security.cert.X509Certificate cert,
          java.security.cert.X509Certificate cacert)
Creates PKCS12-file that can be imported in IE or Netscape.  | 
static org.bouncycastle.asn1.x509.SubjectKeyIdentifier | 
createSubjectKeyId(java.security.PublicKey pubKey)
create the subject key identifier.  | 
static java.security.KeyPair | 
genKeys(int keysize)
Generates a keypair  | 
static java.security.cert.Certificate[] | 
getCertChain(java.security.KeyStore keyStore,
             java.lang.String privateKeyAlias)
Retrieves the certificate chain from a keystore.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Method Detail | 
|---|
public static java.security.KeyPair genKeys(int keysize)
                                     throws java.security.NoSuchAlgorithmException,
                                            java.security.NoSuchProviderException
keysize - size of keys to generate, typical value is 1024 for RSA keys
java.security.NoSuchAlgorithmException
java.security.NoSuchProviderException
public static java.security.KeyStore createP12(java.lang.String alias,
                                               java.security.PrivateKey privKey,
                                               java.security.cert.X509Certificate cert,
                                               java.security.cert.X509Certificate cacert)
                                        throws java.lang.Exception
alias - the alias used for the key entryprivKey - RSA private keycert - user certificatecacert - CA-certificate or null if only one cert in chain, in that case use 'cert'.
java.lang.Exception - if input parameters are not OK or certificate generation fails
public static java.security.KeyStore createP12(java.lang.String alias,
                                               java.security.PrivateKey privKey,
                                               java.security.cert.X509Certificate cert,
                                               java.util.Collection<java.security.cert.Certificate> cacerts)
                                        throws java.lang.Exception
alias - the alias used for the key entryprivKey - RSA private keycert - user certificatecacerts - Collection of X509Certificate, or null if only one cert in chain, in that case use 'cert'.
java.lang.Exception - if input parameters are not OK or certificate generation fails
public static java.security.KeyStore createP12(java.lang.String alias,
                                               java.security.PrivateKey privKey,
                                               java.security.cert.X509Certificate cert,
                                               java.security.cert.Certificate[] cachain)
                                        throws java.lang.Exception
alias - the alias used for the key entryprivKey - RSA private keycert - user certificatecachain - CA-certificate chain or null if only one cert in chain, in that case use 'cert'.
java.lang.Exception - if input parameters are not OK or certificate generation fails
public static java.security.KeyStore createJKS(java.lang.String alias,
                                               java.security.PrivateKey privKey,
                                               java.lang.String password,
                                               java.security.cert.X509Certificate cert,
                                               java.security.cert.Certificate[] cachain)
                                        throws java.lang.Exception
alias - the alias used for the key entryprivKey - RSA private keypassword - user's passwordcert - user certificatecachain - CA-certificate chain or null if only one cert in chain, in that case use
        'cert'.
java.lang.Exception - if input parameters are not OK or certificate generation fails
public static java.security.cert.Certificate[] getCertChain(java.security.KeyStore keyStore,
                                                            java.lang.String privateKeyAlias)
                                                     throws java.security.KeyStoreException
keyStore - the keystore, which has been loaded and opened.privateKeyAlias - the alias of the privatekey for which the certchain belongs.
java.security.KeyStoreExceptionpublic static org.bouncycastle.asn1.x509.SubjectKeyIdentifier createSubjectKeyId(java.security.PublicKey pubKey)
pubKey - the public key
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||