Class BACAPDUSender

    • Constructor Detail

      • BACAPDUSender

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

      • sendGetChallenge

        public byte[] sendGetChallenge()
                                throws net.sf.scuba.smartcards.CardServiceException
        Sends a GET CHALLENGE command to the passport.
        Specified by:
        sendGetChallenge in interface APDULevelBACCapable
        Returns:
        a byte array of length 8 containing the challenge
        Throws:
        net.sf.scuba.smartcards.CardServiceException - on tranceive 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.
        Parameters:
        wrapper - secure messaging wrapper
        Returns:
        a byte array of length 8 containing the challenge
        Throws:
        net.sf.scuba.smartcards.CardServiceException - on tranceive error
      • sendMutualAuth

        public byte[] sendMutualAuth​(byte[] rndIFD,
                                     byte[] rndICC,
                                     byte[] kIFD,
                                     SecretKey kEnc,
                                     SecretKey kMac)
                              throws net.sf.scuba.smartcards.CardServiceException
        Sends an EXTERNAL AUTHENTICATE command to the passport. This is part of BAC. The resulting byte array has length 32 and contains rndICC (first 8 bytes), rndIFD (next 8 bytes), their key material kICC (last 16 bytes).
        Specified by:
        sendMutualAuth in interface APDULevelBACCapable
        Parameters:
        rndIFD - our challenge
        rndICC - their challenge
        kIFD - our key material
        kEnc - the static encryption key
        kMac - the static mac key
        Returns:
        a byte array of length 32 containing the response that was sent by the passport, decrypted (using kEnc) and verified (using kMac)
        Throws:
        net.sf.scuba.smartcards.CardServiceException - on tranceive error