public abstract class EidCard extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static int |
BLOCK_SIZE |
protected javax.smartcardio.Card |
card |
protected javax.smartcardio.CardChannel |
channel |
protected static byte[] |
DOCUMENT_FILE
Document data
|
protected static org.slf4j.Logger |
logger |
protected static byte[] |
PERSONAL_FILE
Personal data
|
protected static byte[] |
PHOTO_FILE
Personal photo in JPEG format
|
protected static byte[] |
RESIDENCE_FILE
Place of residence
|
| Modifier | Constructor and Description |
|---|---|
protected |
EidCard(javax.smartcardio.Card card) |
| Modifier and Type | Method and Description |
|---|---|
protected Map<Integer,byte[]> |
addAllToBuilder(EidInfo.Builder builder,
Map<Integer,byte[]> rawTagMap,
Map<Integer,EidInfo.Tag> tagMapper)
Add all raw tags to EidInfo builder.
|
String |
debugEidInfo()
Returns a debug string consisting of per-file debug info.
|
void |
disconnect()
Disconnects, but doesn't reset the card.
|
void |
disconnect(boolean reset) |
protected void |
finalize() |
static EidCard |
fromCard(javax.smartcardio.Card card)
Factory method
Return instance of EidCard implementation supporting the given card
|
protected static boolean |
isKnownAtr(byte[] atrBytes)
Factory "selection" method
|
static Map<Integer,byte[]> |
parseTlv(byte[] bytes)
Subdivides the byte array into byte sub-arrays, keyed by their tags
Encoding sequence is a repeated sequence of the following.
|
protected byte[] |
readBinary(int offset,
int length)
Reads the content of the selected file starting at offset, at most length bytes
|
EidInfo |
readEidInfo() |
Image |
readEidPhoto()
Reads the photo data from the card.
|
protected abstract byte[] |
readElementaryFile(byte[] name,
boolean strip_tag)
Read EF contents, selecting by file path.
|
protected byte[] |
selectFile(byte[] name)
Selects the elementary file to read, based on the name passed in.
|
protected byte[] |
selectFile(byte[] name,
int ne) |
protected static final org.slf4j.Logger logger
protected javax.smartcardio.Card card
protected javax.smartcardio.CardChannel channel
protected static final byte[] DOCUMENT_FILE
protected static final byte[] PERSONAL_FILE
protected static final byte[] RESIDENCE_FILE
protected static final byte[] PHOTO_FILE
protected static final int BLOCK_SIZE
public static EidCard fromCard(javax.smartcardio.Card card) throws IllegalArgumentException, SecurityException, IllegalStateException, javax.smartcardio.CardException
card - SecurityExceptionIllegalStateExceptionIllegalArgumentException - Card is not regognized as Serbian eIDjavax.smartcardio.CardExceptionprotected static boolean isKnownAtr(byte[] atrBytes)
public static Map<Integer,byte[]> parseTlv(byte[] bytes)
protected abstract byte[] readElementaryFile(byte[] name,
boolean strip_tag)
throws javax.smartcardio.CardException
javax.smartcardio.CardExceptionprotected byte[] readBinary(int offset,
int length)
throws javax.smartcardio.CardException
javax.smartcardio.CardExceptionprotected byte[] selectFile(byte[] name)
throws javax.smartcardio.CardException
javax.smartcardio.CardExceptionprotected byte[] selectFile(byte[] name,
int ne)
throws javax.smartcardio.CardException
javax.smartcardio.CardExceptionpublic Image readEidPhoto() throws javax.smartcardio.CardException
javax.smartcardio.CardExceptionprotected Map<Integer,byte[]> addAllToBuilder(EidInfo.Builder builder, Map<Integer,byte[]> rawTagMap, Map<Integer,EidInfo.Tag> tagMapper)
builder - EidInfo builderrawTagMap - Parsed map of raw byte strings by TLV codetagMapper - Map translating Tag codes into EidInfo tags; use Tag.NULL
if tag should be silently ignoredpublic EidInfo readEidInfo() throws javax.smartcardio.CardException
javax.smartcardio.CardExceptionpublic String debugEidInfo() throws javax.smartcardio.CardException
javax.smartcardio.CardExceptionpublic void disconnect()
throws javax.smartcardio.CardException
javax.smartcardio.CardExceptionpublic void disconnect(boolean reset)
throws javax.smartcardio.CardException
javax.smartcardio.CardExceptionCopyright © 2017 Open Source Developer, Goran Rakic. All rights reserved.