Package org.bouncycastle.jcajce
Class AgreedKeyWithMacKey
java.lang.Object
org.bouncycastle.jcajce.AgreedKeyWithMacKey
- All Implemented Interfaces:
Serializable
,Key
,SecretKey
,Destroyable
Carrier class for an agreement secret key, as well as details about the MAC key if confirmation is provided.
- See Also:
-
Field Summary
Fields inherited from interface javax.crypto.SecretKey
serialVersionUID
-
Constructor Summary
ConstructorsConstructorDescriptionAgreedKeyWithMacKey
(SecretKey secretKey) Basic constructor, no MAC.AgreedKeyWithMacKey
(SecretKey secretKey, String macAlgorithm, byte[] macKey) Constructor containing MAC details -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
boolean
Return the algorithm for the agreed secret key.byte[]
Return the encoding of the agreed secret key.Return the format for the agreed secret key.Return a key for the MAC associated with the KTS process (if available).int
hashCode()
boolean
-
Constructor Details
-
AgreedKeyWithMacKey
Basic constructor, no MAC.- Parameters:
secretKey
- the secret key that was arrived at.
-
AgreedKeyWithMacKey
Constructor containing MAC details- Parameters:
secretKey
- the secret key that was arrived at.macAlgorithm
- the MAC algorithm to use.macKey
- the bytes representing the agreed MAC key.
-
-
Method Details
-
getAlgorithm
Return the algorithm for the agreed secret key.- Specified by:
getAlgorithm
in interfaceKey
- Returns:
- the secret key value.
-
getFormat
Return the format for the agreed secret key. -
getEncoded
public byte[] getEncoded()Return the encoding of the agreed secret key.- Specified by:
getEncoded
in interfaceKey
- Returns:
- the secret key encoding.
-
destroy
public void destroy()- Specified by:
destroy
in interfaceDestroyable
-
isDestroyed
public boolean isDestroyed()- Specified by:
isDestroyed
in interfaceDestroyable
-
equals
-
hashCode
public int hashCode() -
getMacKey
Return a key for the MAC associated with the KTS process (if available).- Returns:
- the MAC secret key (null otherwise).
-