Package org.jmrtd
Class PACESecretKeySpec
- java.lang.Object
-
- javax.crypto.spec.SecretKeySpec
-
- org.jmrtd.PACESecretKeySpec
-
- All Implemented Interfaces:
Serializable
,Key
,KeySpec
,SecretKey
,Destroyable
,AccessKeySpec
public class PACESecretKeySpec extends 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, String algorithm, byte paceKeyReference)
Constructs a secret key from the given byte array, using the firstlen
bytes ofkey
, starting atoffset
inclusive.PACESecretKeySpec(byte[] key, 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(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 interface org.jmrtd.AccessKeySpec
getAlgorithm
-
Methods inherited from interface javax.security.auth.Destroyable
destroy, isDestroyed
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from class javax.crypto.spec.SecretKeySpec
getAlgorithm, getEncoded, getFormat
-
-
-
-
Constructor Detail
-
PACESecretKeySpec
public PACESecretKeySpec(byte[] key, int offset, int len, 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, 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 classSecretKeySpec
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classSecretKeySpec
-
getKey
public byte[] getKey()
Returns the encoded key (key seed) used in key derivation.- Specified by:
getKey
in interfaceAccessKeySpec
- Returns:
- the encoded key
-
-