Package org.bouncycastle.jcajce
Class AgreedKeyWithMacKey
- java.lang.Object
-
- org.bouncycastle.jcajce.AgreedKeyWithMacKey
-
- All Implemented Interfaces:
java.io.Serializable
,java.security.Key
,javax.crypto.SecretKey
,javax.security.auth.Destroyable
public final class AgreedKeyWithMacKey extends java.lang.Object implements javax.crypto.SecretKey
Carrier class for an agreement secret key, as well as details about the MAC key if confirmation is provided.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AgreedKeyWithMacKey(javax.crypto.SecretKey secretKey)
Basic constructor, no MAC.AgreedKeyWithMacKey(javax.crypto.SecretKey secretKey, java.lang.String macAlgorithm, byte[] macKey)
Constructor containing MAC details
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
boolean
equals(java.lang.Object o)
java.lang.String
getAlgorithm()
Return the algorithm for the agreed secret key.byte[]
getEncoded()
Return the encoding of the agreed secret key.java.lang.String
getFormat()
Return the format for the agreed secret key.ZeroizableSecretKey
getMacKey()
Return a key for the MAC associated with the KTS process (if available).int
hashCode()
boolean
isDestroyed()
-
-
-
Constructor Detail
-
AgreedKeyWithMacKey
public AgreedKeyWithMacKey(javax.crypto.SecretKey secretKey)
Basic constructor, no MAC.- Parameters:
secretKey
- the secret key that was arrived at.
-
AgreedKeyWithMacKey
public AgreedKeyWithMacKey(javax.crypto.SecretKey secretKey, java.lang.String macAlgorithm, byte[] macKey)
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 Detail
-
getAlgorithm
public java.lang.String getAlgorithm()
Return the algorithm for the agreed secret key.- Specified by:
getAlgorithm
in interfacejava.security.Key
- Returns:
- the secret key value.
-
getFormat
public java.lang.String getFormat()
Return the format for the agreed secret key.- Specified by:
getFormat
in interfacejava.security.Key
- Returns:
- the secret key format.
-
getEncoded
public byte[] getEncoded()
Return the encoding of the agreed secret key.- Specified by:
getEncoded
in interfacejava.security.Key
- Returns:
- the secret key encoding.
-
destroy
public void destroy()
- Specified by:
destroy
in interfacejavax.security.auth.Destroyable
-
isDestroyed
public boolean isDestroyed()
- Specified by:
isDestroyed
in interfacejavax.security.auth.Destroyable
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getMacKey
public ZeroizableSecretKey getMacKey()
Return a key for the MAC associated with the KTS process (if available).- Returns:
- the MAC secret key (null otherwise).
-
-