|
Java example source code file (CardChannel.java)
The CardChannel.java Java example source code
/*
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.smartcardio;
import java.nio.*;
/**
* A logical channel connection to a Smart Card. It is used to exchange APDUs
* with a Smart Card.
* A CardChannel object can be obtained by calling the method
* {@linkplain Card#getBasicChannel} or {@linkplain Card#openLogicalChannel}.
*
* @see Card
* @see CommandAPDU
* @see ResponseAPDU
*
* @since 1.6
* @author Andreas Sterbenz
* @author JSR 268 Expert Group
*/
public abstract class CardChannel {
/**
* Constructs a new CardChannel object.
*
* <p>This constructor is called by subclasses only. Application should
* call the {@linkplain Card#getBasicChannel} and
* {@linkplain Card#openLogicalChannel} methods to obtain a CardChannel
* object.
*/
protected CardChannel() {
// empty
}
/**
* Returns the Card this channel is associated with.
*
* @return the Card this channel is associated with
*/
public abstract Card getCard();
/**
* Returns the channel number of this CardChannel. A channel number of
* 0 indicates the basic logical channel.
*
* @return the channel number of this CardChannel.
*
* @throws IllegalStateException if this channel has been
* {@linkplain #close closed} or if the corresponding Card has been
* {@linkplain Card#disconnect disconnected}.
*/
public abstract int getChannelNumber();
/**
* Transmits the specified command APDU to the Smart Card and returns the
* response APDU.
*
* <p>The CLA byte of the command APDU is automatically adjusted to
* match the channel number of this CardChannel.
*
* <p>Note that this method cannot be used to transmit
* <code>MANAGE CHANNEL APDUs. Logical channels should be managed
* using the {@linkplain Card#openLogicalChannel} and {@linkplain
* CardChannel#close CardChannel.close()} methods.
*
* <p>Implementations should transparently handle artifacts
* of the transmission protocol.
* For example, when using the T=0 protocol, the following processing
* should occur as described in ISO/IEC 7816-4:
*
* <ul>
* <li>
Other Java examples (source code examples)Here is a short list of links related to this Java CardChannel.java source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.