Package org.bouncycastle.jcajce
Class KTSKeyWithEncapsulation
java.lang.Object
org.bouncycastle.jcajce.KTSKeyWithEncapsulation
- All Implemented Interfaces:
Serializable,Key,SecretKey,Destroyable
Carrier class for a KTS secret key plus its encapsulation, as well as details about the MAC key if provided.
- See Also:
-
Field Summary
Fields inherited from interface javax.crypto.SecretKey
serialVersionUID -
Constructor Summary
ConstructorsConstructorDescriptionKTSKeyWithEncapsulation(SecretKey secretKey, byte[] encapsulation) Basic constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturn the algorithm for the agreed secret key.byte[]Return the encapsulation that carried the key material used in creating the agreed secret key.byte[]Return the encoding of the agreed secret key.Return the format for the agreed secret key.Return the mac key if there is one present.inthashCode()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.security.auth.Destroyable
destroy, isDestroyed
-
Constructor Details
-
KTSKeyWithEncapsulation
Basic constructor.- Parameters:
secretKey- the secret key that was arrived at.encapsulation- the encapsulation the key data was carried in.
-
-
Method Details
-
getAlgorithm
Return the algorithm for the agreed secret key.- Specified by:
getAlgorithmin 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:
getEncodedin interfaceKey- Returns:
- the secret key encoding.
-
getEncapsulation
public byte[] getEncapsulation()Return the encapsulation that carried the key material used in creating the agreed secret key.- Returns:
- the encrypted encapsulation of the agreed secret key.
-
getMacKey
Return the mac key if there is one present.- Returns:
- the associated MAC key for this KTS key (null if there isn't one).
-
equals
-
hashCode
public int hashCode()
-