Class EACCAAPDUSender

  • All Implemented Interfaces:
    APDULevelEACCACapable

    public class EACCAAPDUSender
    extends java.lang.Object
    implements APDULevelEACCACapable
    A low-level APDU sender to support the EAC-CA protocol (version 1). This provides functionality for the "DESede" case and for the "AES" case.
    Since:
    0.7.0
    Version:
    $Revision: 1850 $
    Author:
    The JMRTD team
    • Constructor Summary

      Constructors 
      Constructor Description
      EACCAAPDUSender​(net.sf.scuba.smartcards.CardService service)
      Creates an APDU sender for the EAC-CA protocol.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] sendGeneralAuthenticate​(net.sf.scuba.smartcards.APDUWrapper wrapper, byte[] data, boolean isLast)
      Sends a General Authenticate command.
      byte[] sendGeneralAuthenticate​(net.sf.scuba.smartcards.APDUWrapper wrapper, byte[] data, int le, boolean isLast)
      Sends a General Authenticate command.
      void sendMSEKAT​(net.sf.scuba.smartcards.APDUWrapper wrapper, byte[] keyData, byte[] idData)
      The MSE KAT APDU, see EAC 1.11 spec, Section B.1.
      void sendMSESetATIntAuth​(net.sf.scuba.smartcards.APDUWrapper wrapper, java.lang.String oid, java.math.BigInteger keyId)
      The MSE Set AT for Chip Authentication.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EACCAAPDUSender

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

      • sendMSEKAT

        public void sendMSEKAT​(net.sf.scuba.smartcards.APDUWrapper wrapper,
                               byte[] keyData,
                               byte[] idData)
                        throws net.sf.scuba.smartcards.CardServiceException
        The MSE KAT APDU, see EAC 1.11 spec, Section B.1. This command is sent in the "DESede" case.
        Specified by:
        sendMSEKAT in interface APDULevelEACCACapable
        Parameters:
        wrapper - secure messaging wrapper
        keyData - key data object (tag 0x91)
        idData - key id data object (tag 0x84), can be null
        Throws:
        net.sf.scuba.smartcards.CardServiceException - on error
      • sendMSESetATIntAuth

        public void sendMSESetATIntAuth​(net.sf.scuba.smartcards.APDUWrapper wrapper,
                                        java.lang.String oid,
                                        java.math.BigInteger keyId)
                                 throws net.sf.scuba.smartcards.CardServiceException
        The MSE Set AT for Chip Authentication. This command is the first command that is sent in the "AES" case.
        Specified by:
        sendMSESetATIntAuth in interface APDULevelEACCACapable
        Parameters:
        wrapper - secure messaging wrapper
        oid - the OID
        keyId - the keyId or null
        Throws:
        net.sf.scuba.smartcards.CardServiceException - on error
      • sendGeneralAuthenticate

        public byte[] sendGeneralAuthenticate​(net.sf.scuba.smartcards.APDUWrapper wrapper,
                                              byte[] data,
                                              boolean isLast)
                                       throws net.sf.scuba.smartcards.CardServiceException
        Sends a General Authenticate command. This command is the second command that is sent in the "AES" case. This uses 256 for the expected length.
        Specified by:
        sendGeneralAuthenticate in interface APDULevelEACCACapable
        Parameters:
        wrapper - secure messaging wrapper
        data - data to be sent, without the 0x7C prefix (this method will add it)
        isLast - indicates whether this is the last command in the chain
        Returns:
        dynamic authentication data without the 0x7C prefix (this method will remove it)
        Throws:
        net.sf.scuba.smartcards.CardServiceException - on error
      • sendGeneralAuthenticate

        public byte[] sendGeneralAuthenticate​(net.sf.scuba.smartcards.APDUWrapper wrapper,
                                              byte[] data,
                                              int le,
                                              boolean isLast)
                                       throws net.sf.scuba.smartcards.CardServiceException
        Sends a General Authenticate command. This command is the second command that is sent in the "AES" case.
        Parameters:
        wrapper - secure messaging wrapper
        data - data to be sent, without the 0x7C prefix (this method will add it)
        le - the expected length
        isLast - indicates whether this is the last command in the chain
        Returns:
        dynamic authentication data without the 0x7C prefix (this method will remove it)
        Throws:
        net.sf.scuba.smartcards.CardServiceException - on error