Package javax.smartcardio

Examples of javax.smartcardio.CardNotPresentException


            this.protocol = PROTOCOL_T_0;
            //basicChannel = new ChannelImpl(this, 0);
            state = State.CARD_PRESENT;
        } catch (MP300Exception e) {
            if (e.code == MP300Exception.CRET_ABSENT) {
                throw new CardNotPresentException("No card present", e);
            } else {
                throw new ScardException("connect() failed", e);
            }
        }
    }
View Full Code Here


                this.protocol = NimpPcScTerminalManager.win32Protocol2GenericTerminalProtocol(status[1]);
                //basicChannel = new ChannelImpl(this, 0);
                state = State.CARD_PRESENT;
            } catch (PcScException e) {
                if (e.code == NimpPcScTerminalManager.SCARD_W_REMOVED_CARD) {
                    throw new CardNotPresentException("No card present", e);
                } else {
                    throw new ScardException("connect() failed", e);
                }
            }
        }
        if ((null == atr) || (ACTIVATION_ANY != activation)) {
            try {
                SCardReconnect(cardId, sharingMode, connectProtocol, activationPolicy);
                byte[] status = new byte[2];
                byte[] atrBytes = SCardStatus(cardId, status);
                atr = new AnswerToReset(atrBytes);
                logAtr(atr);
                this.protocol = NimpPcScTerminalManager.win32Protocol2GenericTerminalProtocol(status[1]);
                //basicChannel = new ChannelImpl(this, 0);
                state = State.CARD_PRESENT;
            } catch (PcScException e) {
                if (e.code == NimpPcScTerminalManager.SCARD_W_REMOVED_CARD) {
                    throw new CardNotPresentException("No card present", e);
                } else {
                    throw new ScardException("connect() failed", e);
                }
            }
        }
View Full Code Here

                //this.protocol = PcScTerminalManager.win32Protocol2GenericTerminalProtocol(status[1]);
                //basicChannel = new ChannelImpl(this, 0);
                //state = State.CARD_PRESENT;
            } catch (PcScException e) {
                if (e.code == PcScTerminalManager.SCARD_W_REMOVED_CARD) {
                    throw new CardNotPresentException("No card present", e);
                } else {
                    throw new ScardException("connect() failed", e);
                }
            }
        }
        //if ((null == atr) || (ACTIVATION_ANY != activation)) {
            try {
                SCardReconnect(cardId, sharingMode, connectProtocol, activationPolicy);
                byte[] status = new byte[2];
                byte[] atrBytes = SCardStatus(cardId, status);
                atr = new AnswerToReset(atrBytes);
                logAtr(atr);
                this.protocol = PcScTerminalManager.win32Protocol2GenericTerminalProtocol(status[1]);
                //basicChannel = new ChannelImpl(this, 0);
                state = State.CARD_PRESENT;
            } catch (PcScException e) {
                if (e.code == PcScTerminalManager.SCARD_W_REMOVED_CARD) {
                    throw new CardNotPresentException("No card present", e);
                } else {
                    throw new ScardException("connect() failed", e);
                }
            }
        //}
View Full Code Here

            //TODO: retrieve the actual protocol
            this.protocol = PROTOCOL_T_0;
            state = State.CARD_PRESENT;
        } catch (MP300Exception e) {
            if (e.code == MP300Exception.CRET_ABSENT) {
                throw new CardNotPresentException("No card present", e);
            } else {
                throw new ScardException("connect() failed", e);
            }
        }
    }
View Full Code Here

TOP

Related Classes of javax.smartcardio.CardNotPresentException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.