|
IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectdemo.cms.ecc.keystore.SetupCMSEccKeyStore
public class SetupCMSEccKeyStore
Creates a test KeyStore ("cmsecc.keystore") in the current working directory.
These keys are used by the ECC demos included in IAIK-CMS.
The aliases and the password for accessing the keys and
certificates can be found in CMSEccKeyStoreConstants.
CMSEccKeyStoreConstants,
CMSEccKeyStore| Field Summary |
|---|
| Constructor Summary | |
|---|---|
SetupCMSEccKeyStore()
Default Constructor. |
|
| Method Summary | |
|---|---|
void |
addToKeyStore(java.security.KeyPair keyPair,
iaik.x509.X509Certificate[] chain,
java.lang.String alias)
Adds the private key and the certificate chain to the key store. |
static iaik.x509.X509Certificate |
createCertificate(iaik.asn1.structures.Name subject,
java.security.PublicKey publicKey,
iaik.asn1.structures.Name issuer,
java.security.PrivateKey privateKey,
iaik.asn1.structures.AlgorithmID algorithm,
byte[] keyID,
boolean forSigning)
Creates a certificate from the given values. |
void |
generateCertificates()
Generates the certificates. |
static java.security.KeyPair |
generateEccKeyPair(java.lang.String algorithm,
java.lang.String curveName)
Generates an ECC key pair for a curve with a certain name |
java.security.KeyPair |
generateKeyPair(java.lang.String algorithm,
int bitLength)
Generates a key pair for a curve with a certain name |
static void |
main(java.lang.String[] arg)
Creates the test certificates. |
static void |
start()
Starts the keystore setup. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SetupCMSEccKeyStore()
| Method Detail |
|---|
public java.security.KeyPair generateKeyPair(java.lang.String algorithm,
int bitLength)
throws java.security.NoSuchAlgorithmException,
java.security.NoSuchProviderException
algorithm - the key algorithmbitLength - the length of the key (in bits).
java.security.NoSuchAlgorithmException - if ECDSA KeyPairGenerator is not available
java.security.NoSuchProviderException - if provider IAIK_ECC is not installed
public static java.security.KeyPair generateEccKeyPair(java.lang.String algorithm,
java.lang.String curveName)
throws java.lang.Exception
algorithm - the key algorithmcurveName - the name of the curve to be used.
java.lang.Exception - if the KeyPair cannot be generated
public static iaik.x509.X509Certificate createCertificate(iaik.asn1.structures.Name subject,
java.security.PublicKey publicKey,
iaik.asn1.structures.Name issuer,
java.security.PrivateKey privateKey,
iaik.asn1.structures.AlgorithmID algorithm,
byte[] keyID,
boolean forSigning)
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 usekeyID - the key id for the AuthotityKeyIdentifier extensionforSigning - if the certificate to be created shall be used for signing or encryption
public void addToKeyStore(java.security.KeyPair keyPair,
iaik.x509.X509Certificate[] chain,
java.lang.String alias)
throws java.security.KeyStoreException
keyPair - the key pair with the private key to be addedchain - the certificate chain to be addedalias - the alias for the keystore entry
java.security.KeyStoreException - if an error occurs when trying to add the keypublic void generateCertificates()
public static void start()
public static void main(java.lang.String[] arg)
throws java.io.IOException
java.io.IOException
|
IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
|
v6.1 (c) 2002 IAIK, (c) 2003 - 2025 SIC |
|