Package org.jmrtd
Class PACESecretKeySpec
- java.lang.Object
-
- javax.crypto.spec.SecretKeySpec
-
- org.jmrtd.PACESecretKeySpec
-
- All Implemented Interfaces:
java.io.Serializable
,java.security.Key
,java.security.spec.KeySpec
,javax.crypto.SecretKey
,javax.security.auth.Destroyable
,AccessKeySpec
public class PACESecretKeySpec extends javax.crypto.spec.SecretKeySpec implements AccessKeySpec
A secret key for PACE.- Version:
- $Revision: 1786 $ (Contributions by g.giorkhelidze.)
- Author:
- The JMRTD team ([email protected])
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PACESecretKeySpec(byte[] key, int offset, int len, java.lang.String algorithm, byte paceKeyReference)
Constructs a secret key from the given byte array, using the firstlen
bytes ofkey
, starting atoffset
inclusive.PACESecretKeySpec(byte[] key, java.lang.String algorithm, byte paceKeyReference)
Constructs a secret key from the given byte array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
byte[]
getKey()
Returns the encoded key (key seed) used in key derivation.byte
getKeyReference()
Returns reference specifying the type of key from BSI TR-03110 (Appendix B).int
hashCode()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jmrtd.AccessKeySpec
getAlgorithm
-
-
-
-
Constructor Detail
-
PACESecretKeySpec
public PACESecretKeySpec(byte[] key, int offset, int len, java.lang.String algorithm, byte paceKeyReference)
Constructs a secret key from the given byte array, using the firstlen
bytes ofkey
, starting atoffset
inclusive.- Parameters:
key
- the key bytesoffset
- the offset withkey
len
- the length of the key withinkey
algorithm
- the name of the secret-key algorithm to be associated with the given key materialpaceKeyReference
- a reference specifying the type of key from BSI TR-03110 (Appendix B)
-
PACESecretKeySpec
public PACESecretKeySpec(byte[] key, java.lang.String algorithm, byte paceKeyReference)
Constructs a secret key from the given byte array.- Parameters:
key
- the key bytesalgorithm
- the name of the secret-key algorithm to be associated with the given key materialpaceKeyReference
- a reference specifying the type of key from BSI TR-03110 (Appendix B)
-
-
Method Detail
-
getKeyReference
public byte getKeyReference()
Returns reference specifying the type of key from BSI TR-03110 (Appendix B).- Returns:
- a key reference
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjavax.crypto.spec.SecretKeySpec
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjavax.crypto.spec.SecretKeySpec
-
getKey
public byte[] getKey()
Returns the encoded key (key seed) used in key derivation.- Specified by:
getKey
in interfaceAccessKeySpec
- Returns:
- the encoded key
-
-