IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

demo.cms.ecc
Class ECCDemoUtil

java.lang.Object
  extended by demo.cms.ecc.ECCDemoUtil

public class ECCDemoUtil
extends java.lang.Object

Some utilities for the ECC demos.


Constructor Summary
ECCDemoUtil()
           
 
Method Summary
static java.security.spec.AlgorithmParameterSpec createParamSpec(java.lang.String curveName)
          Creates an EC AlgorithmParameterSpec for the given curve name.
static double getECCelerateVersion()
          Gets the version of the IAIK ECCelerate provider (if used).
static java.lang.String getJDKVersion()
          Gets the version number of the current JDK.
static iaik.cms.IaikProvider installIaikEccelerateProvider()
          Installs the IAIK ECCelerate SecurityProvider.
static iaik.cms.IaikProvider installIaikEccProvider()
          Installs an ECC supporting IAIK SecurityProvider.
static void signCertificate(iaik.x509.X509Certificate cert, iaik.asn1.structures.AlgorithmID algorithm, java.security.PrivateKey issuerPK)
          Signs the given certificate with deterministic generation of parameter k (if supported).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ECCDemoUtil

public ECCDemoUtil()
Method Detail

installIaikEccProvider

public static iaik.cms.IaikProvider installIaikEccProvider()
                                                    throws java.lang.Exception
Installs an ECC supporting IAIK SecurityProvider. Depending on its presence in the classpath, either the new (ECCelerate) or old (IAIK-ECC) library is used.

Returns:
the ECC supporting IAIK SecurityProvider
Throws:
java.lang.Exception - if the IAIK ECC Provider cannot be installed

installIaikEccelerateProvider

public static iaik.cms.IaikProvider installIaikEccelerateProvider()
                                                           throws java.lang.Exception
Installs the IAIK ECCelerate SecurityProvider.

Returns:
the IAIK ECCelerate SecurityProvider
Throws:
java.lang.Exception - if the provider cannot be installed

getECCelerateVersion

public static double getECCelerateVersion()
Gets the version of the IAIK ECCelerate provider (if used).

Returns:
the version of the IAIK ECCelerate provider or -1 if IAIK ECCelerate is not used

createParamSpec

public static java.security.spec.AlgorithmParameterSpec createParamSpec(java.lang.String curveName)
                                                                 throws java.security.spec.InvalidParameterSpecException
Creates an EC AlgorithmParameterSpec for the given curve name.

Parameters:
curveName - the name of the curve
Returns:
the AlgorithmParameterSpec
Throws:
java.security.spec.InvalidParameterSpecException - if no AlgorithmParameterSpec for the given curve name is available or cannot be created

signCertificate

public static void signCertificate(iaik.x509.X509Certificate cert,
                                   iaik.asn1.structures.AlgorithmID algorithm,
                                   java.security.PrivateKey issuerPK)
                            throws java.security.InvalidKeyException,
                                   java.security.cert.CertificateException,
                                   java.security.NoSuchAlgorithmException
Signs the given certificate with deterministic generation of parameter k (if supported).

Parameters:
cert - the certificate to be signed
algorithm - the signature algorithm
issuerPK - the issuer private key
Throws:
java.security.NoSuchAlgorithmException
java.security.cert.CertificateException
java.security.InvalidKeyException

getJDKVersion

public static java.lang.String getJDKVersion()
Gets the version number of the current JDK.

Returns:
the JDK version number

IAIK CMS/SMIME Toolkit Demo API Documentation
Version 6.1

v6.1
(c) 2002 IAIK, (c) 2003 - 2025 SIC