Class BaseAgreementSpi

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract byte[] doCalcSecret()  
      protected abstract void doInitFromKey​(java.security.Key key, java.security.spec.AlgorithmParameterSpec parameterSpec, java.security.SecureRandom random)  
      protected byte[] engineGenerateSecret()  
      protected int engineGenerateSecret​(byte[] sharedSecret, int offset)  
      protected javax.crypto.SecretKey engineGenerateSecret​(java.lang.String algorithm)  
      protected void engineInit​(java.security.Key key, java.security.SecureRandom random)  
      protected void engineInit​(java.security.Key key, java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)  
      protected static java.lang.String getAlgorithm​(java.lang.String algDetails)  
      protected static int getKeySize​(java.lang.String algDetails)  
      protected static byte[] trimZeroes​(byte[] secret)  
      • Methods inherited from class javax.crypto.KeyAgreementSpi

        engineDoPhase
      • Methods inherited from class java.lang.Object

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

      • kaAlgorithm

        protected final java.lang.String kaAlgorithm
      • ukmParameters

        protected byte[] ukmParameters
    • Constructor Detail

      • BaseAgreementSpi

        public BaseAgreementSpi​(java.lang.String kaAlgorithm,
                                DerivationFunction kdf)
    • Method Detail

      • getAlgorithm

        protected static java.lang.String getAlgorithm​(java.lang.String algDetails)
      • getKeySize

        protected static int getKeySize​(java.lang.String algDetails)
      • trimZeroes

        protected static byte[] trimZeroes​(byte[] secret)
      • engineInit

        protected void engineInit​(java.security.Key key,
                                  java.security.SecureRandom random)
                           throws java.security.InvalidKeyException
        Specified by:
        engineInit in class javax.crypto.KeyAgreementSpi
        Throws:
        java.security.InvalidKeyException
      • engineInit

        protected void engineInit​(java.security.Key key,
                                  java.security.spec.AlgorithmParameterSpec params,
                                  java.security.SecureRandom random)
                           throws java.security.InvalidKeyException,
                                  java.security.InvalidAlgorithmParameterException
        Specified by:
        engineInit in class javax.crypto.KeyAgreementSpi
        Throws:
        java.security.InvalidKeyException
        java.security.InvalidAlgorithmParameterException
      • engineGenerateSecret

        protected byte[] engineGenerateSecret()
                                       throws java.lang.IllegalStateException
        Specified by:
        engineGenerateSecret in class javax.crypto.KeyAgreementSpi
        Throws:
        java.lang.IllegalStateException
      • engineGenerateSecret

        protected int engineGenerateSecret​(byte[] sharedSecret,
                                           int offset)
                                    throws java.lang.IllegalStateException,
                                           javax.crypto.ShortBufferException
        Specified by:
        engineGenerateSecret in class javax.crypto.KeyAgreementSpi
        Throws:
        java.lang.IllegalStateException
        javax.crypto.ShortBufferException
      • engineGenerateSecret

        protected javax.crypto.SecretKey engineGenerateSecret​(java.lang.String algorithm)
                                                       throws java.security.NoSuchAlgorithmException
        Specified by:
        engineGenerateSecret in class javax.crypto.KeyAgreementSpi
        Throws:
        java.security.NoSuchAlgorithmException
      • doCalcSecret

        protected abstract byte[] doCalcSecret()
      • doInitFromKey

        protected abstract void doInitFromKey​(java.security.Key key,
                                              java.security.spec.AlgorithmParameterSpec parameterSpec,
                                              java.security.SecureRandom random)
                                       throws java.security.InvalidKeyException,
                                              java.security.InvalidAlgorithmParameterException
        Throws:
        java.security.InvalidKeyException
        java.security.InvalidAlgorithmParameterException