kz.gamma.hardware.crypto.pcsc.kztoken
Class TokenKzToken

java.lang.Object
  extended by kz.gamma.hardware.crypto.pcsc.kztoken.TokenKzToken

public class TokenKzToken
extends java.lang.Object

Author:
Sergey Moisseyev

Field Summary
private  java.lang.String atr
           
private  javax.smartcardio.CommandAPDU capdu
           
private  javax.smartcardio.CardChannel ch
           
private  javax.smartcardio.TerminalFactory factory
           
private  javax.smartcardio.ResponseAPDU respApdu
           
private  javax.smartcardio.Card sc
           
private  javax.smartcardio.CardTerminal terminal
           
 
Constructor Summary
TokenKzToken(java.lang.String reader)
           
 
Method Summary
 ResponceCard changePin(byte right, java.lang.String pin)
           
private  ResponceCard createDir(short id)
           
private  ResponceCard createFile(short id, short size, boolean isPrivate)
           
private  ResponceCard delFile(short id)
           
 ResponceCard delObject(byte id)
           
 void disconnect()
           
 int findIndx(byte tag, byte[] data)
           
 ResponceCard genKeyPair(int algType, byte newId)
           
 ResponceCard getCertificate(byte id)
           
 ResponceCard getFCP(byte id)
           
 byte getKeyAlgID(byte id)
           
 ResponceCard getPathDir(byte type, boolean isDir, byte id)
          Функция выбирает каталог или файл
 ResponceCard getPublicKey(byte id)
           
 ResponceCard getSerial()
           
 ResponceCard getStatus()
           
 ResponceCard isContainer()
           
 boolean isObjectExists(byte id, short type)
           
 ResponceCard read(int offset, int size)
           
 ResponceCard readContainer()
           
private  ResponceCard selectMapDir()
           
 ResponceCard setCertificate(byte id, byte[] certBlob)
           
 ResponceCard signature(byte id, byte[] hash)
           
 ResponceCard verifyPin(byte right, java.lang.String pin)
           
 ResponceCard write(int offset, byte[] data)
           
 ResponceCard writeContainer(byte[] cont)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

respApdu

private javax.smartcardio.ResponseAPDU respApdu

capdu

private javax.smartcardio.CommandAPDU capdu

sc

private javax.smartcardio.Card sc

ch

private javax.smartcardio.CardChannel ch

factory

private javax.smartcardio.TerminalFactory factory

terminal

private javax.smartcardio.CardTerminal terminal

atr

private java.lang.String atr
Constructor Detail

TokenKzToken

public TokenKzToken(java.lang.String reader)
             throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException
Method Detail

getStatus

public ResponceCard getStatus()
                       throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

getSerial

public ResponceCard getSerial()
                       throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

verifyPin

public ResponceCard verifyPin(byte right,
                              java.lang.String pin)
                       throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

changePin

public ResponceCard changePin(byte right,
                              java.lang.String pin)
                       throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

isContainer

public ResponceCard isContainer()
                         throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

readContainer

public ResponceCard readContainer()
                           throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

selectMapDir

private ResponceCard selectMapDir()
                           throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

delFile

private ResponceCard delFile(short id)
                      throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

createFile

private ResponceCard createFile(short id,
                                short size,
                                boolean isPrivate)
                         throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

createDir

private ResponceCard createDir(short id)
                        throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

writeContainer

public ResponceCard writeContainer(byte[] cont)
                            throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

write

public ResponceCard write(int offset,
                          byte[] data)
                   throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

read

public ResponceCard read(int offset,
                         int size)
                  throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

getPathDir

public ResponceCard getPathDir(byte type,
                               boolean isDir,
                               byte id)
                        throws javax.smartcardio.CardException
Функция выбирает каталог или файл

Parameters:
type - тип запрашиваемого каталога PubKey 0x22 PrivKey 0x23 SecFile 0x24 Certificate 0x25 SeRSF 0x21
isDir - - true если выбирается каталог
id - - идентификатор файла
Returns:
возвращает статус
Throws:
javax.smartcardio.CardException

getFCP

public ResponceCard getFCP(byte id)
                    throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

findIndx

public int findIndx(byte tag,
                    byte[] data)

genKeyPair

public ResponceCard genKeyPair(int algType,
                               byte newId)
                        throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

delObject

public ResponceCard delObject(byte id)
                       throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

signature

public ResponceCard signature(byte id,
                              byte[] hash)
                       throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

setCertificate

public ResponceCard setCertificate(byte id,
                                   byte[] certBlob)
                            throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

getCertificate

public ResponceCard getCertificate(byte id)
                            throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

isObjectExists

public boolean isObjectExists(byte id,
                              short type)
                       throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

getKeyAlgID

public byte getKeyAlgID(byte id)
                 throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

getPublicKey

public ResponceCard getPublicKey(byte id)
                          throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException

disconnect

public void disconnect()
                throws javax.smartcardio.CardException
Throws:
javax.smartcardio.CardException


Copyright © 2013 Gamma Technologies. All Rights Reserved.