Class BaseAgreementSpi
- java.lang.Object
-
- javax.crypto.KeyAgreementSpi
-
- org.bouncycastle.jcajce.provider.asymmetric.util.BaseAgreementSpi
-
- Direct Known Subclasses:
KeyAgreementSpi
,KeyAgreementSpi
,KeyAgreementSpi
,KeyAgreementSpi
,KeyAgreementSpi
,KeyAgreementSpi
public abstract class BaseAgreementSpi extends KeyAgreementSpi
-
-
Field Summary
Fields Modifier and Type Field Description protected String
kaAlgorithm
protected DerivationFunction
kdf
protected byte[]
ukmParameters
-
Constructor Summary
Constructors Constructor Description BaseAgreementSpi(String kaAlgorithm, DerivationFunction kdf)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract byte[]
calcSecret()
protected byte[]
engineGenerateSecret()
protected int
engineGenerateSecret(byte[] sharedSecret, int offset)
protected SecretKey
engineGenerateSecret(String algorithm)
protected static String
getAlgorithm(String algDetails)
protected static int
getKeySize(String algDetails)
protected static byte[]
trimZeroes(byte[] secret)
-
Methods inherited from class javax.crypto.KeyAgreementSpi
engineDoPhase, engineInit, engineInit
-
-
-
-
Field Detail
-
kaAlgorithm
protected final String kaAlgorithm
-
kdf
protected final DerivationFunction kdf
-
ukmParameters
protected byte[] ukmParameters
-
-
Constructor Detail
-
BaseAgreementSpi
public BaseAgreementSpi(String kaAlgorithm, DerivationFunction kdf)
-
-
Method Detail
-
getKeySize
protected static int getKeySize(String algDetails)
-
trimZeroes
protected static byte[] trimZeroes(byte[] secret)
-
engineGenerateSecret
protected byte[] engineGenerateSecret() throws IllegalStateException
- Specified by:
engineGenerateSecret
in classKeyAgreementSpi
- Throws:
IllegalStateException
-
engineGenerateSecret
protected int engineGenerateSecret(byte[] sharedSecret, int offset) throws IllegalStateException, ShortBufferException
- Specified by:
engineGenerateSecret
in classKeyAgreementSpi
- Throws:
IllegalStateException
ShortBufferException
-
engineGenerateSecret
protected SecretKey engineGenerateSecret(String algorithm) throws NoSuchAlgorithmException
- Specified by:
engineGenerateSecret
in classKeyAgreementSpi
- Throws:
NoSuchAlgorithmException
-
calcSecret
protected abstract byte[] calcSecret()
-
-