Class ECParameterGenerator


  • public final class ECParameterGenerator
    extends java.security.AlgorithmParameterGeneratorSpi
    This class can be used to generate a set of Elliptic Curve parameters to be used with the Elliptic Curve algorithm. In cases where this class has not been explicitly initialized, parameters for the default NIST curve named secp256r1 will be generated.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.security.AlgorithmParameters engineGenerateParameters()
      Generates Elliptic Curve parameters.
      protected void engineInit​(int size, java.security.SecureRandom random)
      Initializes this parameter generator for a certain key size and source of randomness.
      protected void engineInit​(java.security.spec.AlgorithmParameterSpec genParamSpec, java.security.SecureRandom random)
      Initializes this parameter generator with a set of algorithm-specific parameter generation values and a source of randomness.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ECParameterGenerator

        public ECParameterGenerator()
        Constructor
    • Method Detail

      • engineInit

        protected void engineInit​(int size,
                                  java.security.SecureRandom random)
        Initializes this parameter generator for a certain key size and source of randomness. The source of randomness will be ignored because only standard Elliptic Curve parameters will be generated for the supplied key size.
        Specified by:
        engineInit in class java.security.AlgorithmParameterGeneratorSpi
        Parameters:
        size - the key size in number of bits
        random - the source of randomness, which is ignored
        Throws:
        java.security.InvalidParameterException - if the key size is not supported
      • engineInit

        protected void engineInit​(java.security.spec.AlgorithmParameterSpec genParamSpec,
                                  java.security.SecureRandom random)
                           throws java.security.InvalidAlgorithmParameterException
        Initializes this parameter generator with a set of algorithm-specific parameter generation values and a source of randomness. The source of randomness will be ignored because only standard Elliptic Curve parameters will be generated.
        Specified by:
        engineInit in class java.security.AlgorithmParameterGeneratorSpi
        Parameters:
        genParamSpec - the set of algorithm-specific parameter generation values
        random - the source of randomness, which will be ignored
        Throws:
        java.lang.NullPointerException - if genParamSpec is null
        java.security.InvalidAlgorithmParameterException - if the given parameter generation values are inappropriate for this parameter generator
      • engineGenerateParameters

        protected java.security.AlgorithmParameters engineGenerateParameters()
        Generates Elliptic Curve parameters. If this class has not been explicitly initialized, parameters for the default NIST curve named secp256r1 will be generated.
        Specified by:
        engineGenerateParameters in class java.security.AlgorithmParameterGeneratorSpi
        Returns:
        the generated Elliptic Curve parameters