Class McElieceCCA2KeyFactorySpi

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String OID
      The OID of the algorithm.
    • Field Detail

      • OID

        public static final java.lang.String OID
        The OID of the algorithm.
        See Also:
        Constant Field Values
    • Constructor Detail

      • McElieceCCA2KeyFactorySpi

        public McElieceCCA2KeyFactorySpi()
    • Method Detail

      • engineGeneratePublic

        protected java.security.PublicKey engineGeneratePublic​(java.security.spec.KeySpec keySpec)
                                                        throws java.security.spec.InvalidKeySpecException
        Converts, if possible, a key specification into a BCMcElieceCCA2PublicKey. Currently, the following key specifications are supported: X509EncodedKeySpec.
        Specified by:
        engineGeneratePublic in class java.security.KeyFactorySpi
        Parameters:
        keySpec - the key specification
        Returns:
        the McEliece CCA2 public key
        Throws:
        java.security.spec.InvalidKeySpecException - if the key specification is not supported.
      • engineGeneratePrivate

        protected java.security.PrivateKey engineGeneratePrivate​(java.security.spec.KeySpec keySpec)
                                                          throws java.security.spec.InvalidKeySpecException
        Converts, if possible, a key specification into a BCMcElieceCCA2PrivateKey. Currently, the following key specifications are supported: PKCS8EncodedKeySpec.
        Specified by:
        engineGeneratePrivate in class java.security.KeyFactorySpi
        Parameters:
        keySpec - the key specification
        Returns:
        the McEliece CCA2 private key
        Throws:
        java.security.spec.InvalidKeySpecException - if the KeySpec is not supported.
      • getKeySpec

        public java.security.spec.KeySpec getKeySpec​(java.security.Key key,
                                                     java.lang.Class keySpec)
                                              throws java.security.spec.InvalidKeySpecException
        Converts, if possible, a given key into a key specification. Currently, the following key specifications are supported:
        Parameters:
        key - the key
        keySpec - the key specification
        Returns:
        the specification of the McEliece CCA2 key
        Throws:
        java.security.spec.InvalidKeySpecException - if the key type or the key specification is not supported.
        See Also:
        BCMcElieceCCA2PrivateKey, BCMcElieceCCA2PublicKey
      • translateKey

        public java.security.Key translateKey​(java.security.Key key)
                                       throws java.security.InvalidKeyException
        Translates a key into a form known by the FlexiProvider. Currently, only the following "source" keys are supported: BCMcElieceCCA2PrivateKey, BCMcElieceCCA2PublicKey.
        Parameters:
        key - the key
        Returns:
        a key of a known key type
        Throws:
        java.security.InvalidKeyException - if the key type is not supported.
      • engineGetKeySpec

        protected java.security.spec.KeySpec engineGetKeySpec​(java.security.Key key,
                                                              java.lang.Class tClass)
                                                       throws java.security.spec.InvalidKeySpecException
        Specified by:
        engineGetKeySpec in class java.security.KeyFactorySpi
        Throws:
        java.security.spec.InvalidKeySpecException
      • engineTranslateKey

        protected java.security.Key engineTranslateKey​(java.security.Key key)
                                                throws java.security.InvalidKeyException
        Specified by:
        engineTranslateKey in class java.security.KeyFactorySpi
        Throws:
        java.security.InvalidKeyException