Android Open Source - smartcard-reader D O L






From Project

Back to project page smartcard-reader.

License

The source code is released under:

GNU General Public License

If you think the Android project smartcard-reader listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright 2014 Ryan Jones//from   w  w w  .j a v  a2  s .c om
 * Copyright 2010 sasc
 * 
 * This file was modified from the original source:
 * https://code.google.com/p/javaemvreader/
 * 
 * This file is part of smartcard-reader, package org.docrj.smartcard.reader.
 *
 * smartcard-reader is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * smartcard-reader is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with smartcard-reader. If not, see <http://www.gnu.org/licenses/>.
 */

package org.docrj.smartcard.emv;

import org.docrj.smartcard.iso7816.TagAndLength;
import org.docrj.smartcard.iso7816.TLVUtil;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Data Object List (DOL)
 *
 * In several instances, the terminal is asked to build a flexible list of data
 * elements to be passed to the card under the cards direction.
 * To minimise processing within the ICC, such a list is not TLV encoded but
 * is a single constructed field built by concatenating several data
 * elements together. Since the elements of the constructed field are not
 * TLV encoded, it is imperative that the ICC knows the format of this field
 * when the data is received. This is achieved by including a
 * Data Object List (DOL) in the ICC, specifying the format of the data to
 * be included in the constructed field.
 *
 * DOLs currently used in this specification include:
 * - the Processing Options Data Object List (PDOL) used with the GET PROCESSING OPTIONS command
 * - the Card Risk Management Data Object Lists (CDOL1 and CDOL2) used with the GENERATE APPLICATION CRYPTOGRAM (AC) command
 * - the Transaction Certificate Data Object List (TDOL) used to generate a TC Hash Value
 * - the Dynamic Data Authentication Data Object List (DDOL) used with the INTERNAL AUTHENTICATE command
 *
 * ---------------------------------------------------------------------------
 *
 * In other words, a DOL is sent from the ICC. This DOL contains only Tag ID bytes and length bytes.
 * The Terminal constructs the response, which contains only the VALUES for these tags.
 *
 * TODO: check DOL processing on page 55
 */
public class DOL {

    public enum Type{
        PDOL("Processing Options Data Object List"),
        CDOL1("Card Risk Management Data Object List 1"),
        CDOL2("Card Risk Management Data Object List 2"),
        TDOL("Transaction Certificate Data Object List"),
        //An ICC that supports DDA shall contain a DDOL. The DDOL shall contain only the Unpredictable Number generated by the terminal (tag '9F37', 4 bytes binary).
        DDOL("Dynamic Data Authentication Data Object List");

        private String description;

        private Type(String description){
            this.description = description;
        }

        public String getDescription(){
            return description;
        }

        @Override
        public String toString(){
            return getDescription();
        }
    }

    @SuppressWarnings("unused")
    private Type type;
    private List<TagAndLength> tagAndLengthList = new ArrayList<TagAndLength>();

    public DOL(Type type, byte[] data){
        //Parse tags and lengths
        this.type = type;
        this.tagAndLengthList = TLVUtil.parseTagAndLength(data);
    }

    public List<TagAndLength> getTagAndLengthList(){
        return Collections.unmodifiableList(tagAndLengthList);
    }
}




Java Source Code List

org.docrj.smartcard.emv.AppElementaryFile.java
org.docrj.smartcard.emv.AppFileLocator.java
org.docrj.smartcard.emv.AppInterchangeProfile.java
org.docrj.smartcard.emv.AppPriorityIndicator.java
org.docrj.smartcard.emv.DDF.java
org.docrj.smartcard.emv.DOL.java
org.docrj.smartcard.emv.EMVApp.java
org.docrj.smartcard.emv.EMVTags.java
org.docrj.smartcard.emv.EMVTerminal.java
org.docrj.smartcard.emv.GpoApdu.java
org.docrj.smartcard.emv.IssuerIdNumber.java
org.docrj.smartcard.emv.LanguagePref.java
org.docrj.smartcard.emv.LogEntry.java
org.docrj.smartcard.emv.MCTags.java
org.docrj.smartcard.emv.Record.java
org.docrj.smartcard.emv.TagProvider.java
org.docrj.smartcard.emv.TerminalTranQualifiers.java
org.docrj.smartcard.emv.TerminalVerifResults.java
org.docrj.smartcard.emv.VISATags.java
org.docrj.smartcard.iso7816.BERTLV.java
org.docrj.smartcard.iso7816.CommandApdu.java
org.docrj.smartcard.iso7816.ReadRecordApdu.java
org.docrj.smartcard.iso7816.ResponseApdu.java
org.docrj.smartcard.iso7816.SelectApdu.java
org.docrj.smartcard.iso7816.SmartcardException.java
org.docrj.smartcard.iso7816.TLVException.java
org.docrj.smartcard.iso7816.TLVUtil.java
org.docrj.smartcard.iso7816.TagAndLength.java
org.docrj.smartcard.iso7816.TagImpl.java
org.docrj.smartcard.iso7816.TagType.java
org.docrj.smartcard.iso7816.TagValueType.java
org.docrj.smartcard.iso7816.Tag.java
org.docrj.smartcard.reader.ApduParser.java
org.docrj.smartcard.reader.AppAdapter.java
org.docrj.smartcard.reader.DemoReaderXcvr.java
org.docrj.smartcard.reader.FileShareActivity.java
org.docrj.smartcard.reader.ManualReaderXcvr.java
org.docrj.smartcard.reader.MessageAdapter.java
org.docrj.smartcard.reader.OtherReaderXcvr.java
org.docrj.smartcard.reader.PaymentReaderXcvr.java
org.docrj.smartcard.reader.ReaderActivity.java
org.docrj.smartcard.reader.ReaderXcvr.java
org.docrj.smartcard.reader.SmartcardApp.java
org.docrj.smartcard.util.ByteArrayWrapper.java
org.docrj.smartcard.util.ISO3166_1.java
org.docrj.smartcard.util.ISO4217_Numeric.java
org.docrj.smartcard.util.Util.java