Class EACTAAPDUSender

  • All Implemented Interfaces:
    APDULevelEACTACapable

    public class EACTAAPDUSender
    extends Object
    implements APDULevelEACTACapable
    A low-level APDU sender to support the (EAC) Terminal Authentication protocol.
    Since:
    0.7.0
    Version:
    $Revision: 1799 $
    Author:
    The JMRTD team
    • Constructor Summary

      Constructors 
      Constructor Description
      EACTAAPDUSender​(net.sf.scuba.smartcards.CardService service)
      Creates an APDU sender.
    • Constructor Detail

      • EACTAAPDUSender

        public EACTAAPDUSender​(net.sf.scuba.smartcards.CardService service)
        Creates an APDU sender.
        Parameters:
        service - the card service for tranceiving APDUs
    • Method Detail

      • sendMSESetDST

        public void sendMSESetDST​(net.sf.scuba.smartcards.APDUWrapper wrapper,
                                  byte[] data)
                           throws net.sf.scuba.smartcards.CardServiceException
        The MSE DST APDU, see EAC 1.11 spec, Section B.2. This means that a case 3 APDU is sent, to which no response is expected.
        Specified by:
        sendMSESetDST in interface APDULevelEACTACapable
        Parameters:
        wrapper - secure messaging wrapper
        data - public key reference data object (tag 0x83)
        Throws:
        net.sf.scuba.smartcards.CardServiceException - on error
      • sendPSOExtendedLengthMode

        public void sendPSOExtendedLengthMode​(net.sf.scuba.smartcards.APDUWrapper wrapper,
                                              byte[] certBodyData,
                                              byte[] certSignatureData)
                                       throws net.sf.scuba.smartcards.CardServiceException
        Sends a perform security operation command in extended length mode.
        Specified by:
        sendPSOExtendedLengthMode in interface APDULevelEACTACapable
        Parameters:
        wrapper - secure messaging wrapper
        certBodyData - the certificate body
        certSignatureData - signature data
        Throws:
        net.sf.scuba.smartcards.CardServiceException - on error communicating over the service
      • sendMSESetATExtAuth

        public void sendMSESetATExtAuth​(net.sf.scuba.smartcards.APDUWrapper wrapper,
                                        byte[] data)
                                 throws net.sf.scuba.smartcards.CardServiceException
        The MSE Set AT APDU for TA, see EAC 1.11 spec, Section B.2. MANAGE SECURITY ENVIRONMENT command with SET Authentication Template function. Note that caller is responsible for prefixing the byte[] params with specified tags.
        Specified by:
        sendMSESetATExtAuth in interface APDULevelEACTACapable
        Parameters:
        wrapper - secure messaging wrapper
        data - public key reference data object (should already be prefixed with tag 0x83)
        Throws:
        net.sf.scuba.smartcards.CardServiceException - on error
      • sendGetChallenge

        public byte[] sendGetChallenge​(net.sf.scuba.smartcards.APDUWrapper wrapper)
                                throws net.sf.scuba.smartcards.CardServiceException
        Sends a GET CHALLENGE command to the passport.
        Specified by:
        sendGetChallenge in interface APDULevelEACTACapable
        Parameters:
        wrapper - secure messaging wrapper
        Returns:
        a byte array of length 8 containing the challenge
        Throws:
        net.sf.scuba.smartcards.CardServiceException - on tranceive error
      • sendMutualAuthenticate

        public void sendMutualAuthenticate​(net.sf.scuba.smartcards.APDUWrapper wrapper,
                                           byte[] signature)
                                    throws net.sf.scuba.smartcards.CardServiceException
        Sends the EXTERNAL AUTHENTICATE command. This is used in EAC-TA.
        Specified by:
        sendMutualAuthenticate in interface APDULevelEACTACapable
        Parameters:
        wrapper - secure messaging wrapper
        signature - terminal signature
        Throws:
        net.sf.scuba.smartcards.CardServiceException - if the resulting status word different from 9000