Class KyberKeyPairGenerator


  • public class KyberKeyPairGenerator
    extends java.security.KeyPairGeneratorSpi
    This class generates CRSTALS-Kyber public/private key pairs via hardware. An application can specify the size, the key label, the storage type and usage type of the key pair to be generated via an instance of the KyberKeyParameterSpec class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.security.KeyPair generateKeyPair()
      Generates a CRYSTALS-Kyber key pair via hardware.
      void initialize​(int keysize, java.security.SecureRandom random)
      CRYSTALS-Kyber does not support key size specifications.
      void initialize​(java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)
      Initializes this KeyPairGenerator for given parameters and secure random source.
      • Methods inherited from class java.lang.Object

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

      • KyberKeyPairGenerator

        public KyberKeyPairGenerator()
    • Method Detail

      • initialize

        public void initialize​(int keysize,
                               java.security.SecureRandom random)
        CRYSTALS-Kyber does not support key size specifications.
        Specified by:
        initialize in class java.security.KeyPairGeneratorSpi
      • initialize

        public void initialize​(java.security.spec.AlgorithmParameterSpec params,
                               java.security.SecureRandom random)
                        throws java.security.InvalidAlgorithmParameterException
        Initializes this KeyPairGenerator for given parameters and secure random source.
        Overrides:
        initialize in class java.security.KeyPairGeneratorSpi
        Parameters:
        params - the AlgorithmParameterSpec for this object.
        random - the SecureRandom object for generating random numbers.
        Throws:
        java.security.InvalidAlgorithmParameterException - thrown when parameter set is not recognized.
      • generateKeyPair

        public java.security.KeyPair generateKeyPair()
        Generates a CRYSTALS-Kyber key pair via hardware.
        Specified by:
        generateKeyPair in class java.security.KeyPairGeneratorSpi
        Returns:
        a KeyPair contains a pair of generated CRYSTALS-Kyber keys
        Throws:
        java.lang.IllegalArgumentException - in the key label formal is not valid