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.SecretKeyCarrier 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 voiddestroy()booleanequals(java.lang.Object o)java.lang.StringgetAlgorithm()Return the algorithm for the agreed secret key.byte[]getEncoded()Return the encoding of the agreed secret key.java.lang.StringgetFormat()Return the format for the agreed secret key.ZeroizableSecretKeygetMacKey()Return a key for the MAC associated with the KTS process (if available).inthashCode()booleanisDestroyed()
-
-
-
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:
getAlgorithmin interfacejava.security.Key- Returns:
- the secret key value.
-
getFormat
public java.lang.String getFormat()
Return the format for the agreed secret key.- Specified by:
getFormatin interfacejava.security.Key- Returns:
- the secret key format.
-
getEncoded
public byte[] getEncoded()
Return the encoding of the agreed secret key.- Specified by:
getEncodedin interfacejava.security.Key- Returns:
- the secret key encoding.
-
destroy
public void destroy()
- Specified by:
destroyin interfacejavax.security.auth.Destroyable
-
isDestroyed
public boolean isDestroyed()
- Specified by:
isDestroyedin interfacejavax.security.auth.Destroyable
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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).
-
-