Package org.jmrtd

Class PACEKeySpec

    • Constructor Detail

      • PACEKeySpec

        public PACEKeySpec​(String key,
                           byte keyReference)
        Constructs a PACE key from a string value.
        Parameters:
        key - the string value containing CAN, PIN or PUK
        keyReference - indicates the type of key, valid values are MRZ_PACE_KEY_REFERENCE, CAN_PACE_KEY_REFERENCE, PIN_PACE_KEY_REFERENCE, PUK_PACE_KEY_REFERENCE
      • PACEKeySpec

        public PACEKeySpec​(byte[] key,
                           byte keyReference)
        Constructs a key.
        Parameters:
        key - CAN, MRZ, PIN, PUK password bytes
        keyReference - indicates the type of key, valid values are MRZ_PACE_KEY_REFERENCE, CAN_PACE_KEY_REFERENCE, PIN_PACE_KEY_REFERENCE, PUK_PACE_KEY_REFERENCE
    • Method Detail

      • createCANKey

        public static PACEKeySpec createCANKey​(String can)
        Creates a PACE key from a Card Access Number.
        Parameters:
        can - the Card Access Number
        Returns:
        the PACE key
      • createPINKey

        public static PACEKeySpec createPINKey​(String pin)
        Creates a PACE key from a PIN.
        Parameters:
        pin - the PIN
        Returns:
        the PACE key
      • createPUKKey

        public static PACEKeySpec createPUKKey​(String puk)
        Creates a PACE key from a PUK.
        Parameters:
        puk - the PUK
        Returns:
        the PACE key
      • getKeyReference

        public byte getKeyReference()
        Returns the type of key, valid values are MRZ_PACE_KEY_REFERENCE, CAN_PACE_KEY_REFERENCE, PIN_PACE_KEY_REFERENCE, PUK_PACE_KEY_REFERENCE.
        Returns:
        the type of key
      • getKey

        public byte[] getKey()
        Returns the key bytes.
        Specified by:
        getKey in interface AccessKeySpec
        Returns:
        the key bytes