Package org.jmrtd

Class 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 first len bytes of key, starting at offset 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 javax.crypto.spec.SecretKeySpec

        getAlgorithm, getEncoded, getFormat
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.security.auth.Destroyable

        destroy, isDestroyed
    • 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 first len bytes of key, starting at offset inclusive.
        Parameters:
        key - the key bytes
        offset - the offset with key
        len - the length of the key within key
        algorithm - the name of the secret-key algorithm to be associated with the given key material
        paceKeyReference - 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 bytes
        algorithm - the name of the secret-key algorithm to be associated with the given key material
        paceKeyReference - 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 class javax.crypto.spec.SecretKeySpec
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class javax.crypto.spec.SecretKeySpec
      • getKey

        public byte[] getKey()
        Returns the encoded key (key seed) used in key derivation.
        Specified by:
        getKey in interface AccessKeySpec
        Returns:
        the encoded key