|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--demo.keystore.SetupKeyStore
Creates a default KeyStore in the current working directory.
These keys are used by many demos included in IAIK-JCE.
The aliases and the password for accessing the keys and
certificates can be found in KeyStoreConstants
.
KeyStoreConstants
Fields inherited from interface demo.keystore.KeyStoreConstants |
CA_DSA, CA_RSA, DH_1024, DH_2048, DH_512, DSA_1024, DSA_2048, DSA_512, KS_FILENAME, KS_PASSWORD, RSA_1024, RSA_2048, RSA_512 |
Constructor Summary | |
SetupKeyStore()
|
Method Summary | |
void |
addToKeyStore(KeyPair keyPair,
X509Certificate[] chain,
String alias)
Add the private key and the certificate chain to the key store. |
static X509Certificate |
createCertificate(Name subject,
PublicKey publicKey,
Name issuer,
X509Certificate issuerCert,
PrivateKey privateKey,
AlgorithmID algorithm,
V3Extension[] extensions)
Creates a certificate from the given values. |
void |
generateCertificates()
|
static KeyPair |
generateKeyPair(String algorithm,
int bits)
Generate a KeyPair using the specified algorithm with the given size. |
static void |
main(String[] arg)
Creates the server and client certificates. |
static void |
start()
|
static void |
start(boolean useCurrentDir)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SetupKeyStore()
Method Detail |
public static KeyPair generateKeyPair(String algorithm, int bits) throws NoSuchAlgorithmException
algorithm
- the algorithm to usebits
- the length of the key (modulus) in bitspublic static X509Certificate createCertificate(Name subject, PublicKey publicKey, Name issuer, X509Certificate issuerCert, PrivateKey privateKey, AlgorithmID algorithm, V3Extension[] extensions)
subject
- the subject of the certificatepublicKey
- the public key to includeissuer
- the issuer of the certificateprivateKey
- the private key for signing the certificatealgorithm
- the signature algorithm to usepublic void addToKeyStore(KeyPair keyPair, X509Certificate[] chain, String alias) throws KeyStoreException
public void generateCertificates()
public static void start(boolean useCurrentDir)
public static void start()
public static void main(String[] arg) throws IOException
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |