|
JMRTD 0.4.5 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sourceforge.scuba.smartcards.CardService
org.jmrtd.PassportApduService
org.jmrtd.PassportService
public class PassportService
Card service for reading files (such as data groups) and using the BAC and AA protocols on the passport. Defines secure messaging. Defines active authentication. Based on ICAO-TR-PKI and ICAO-TR-LDS. Usage:
open() ==><br />
doBAC(...) ==><br />
doAA() ==><br />
readFile(...)<sup>*</sup> ==><br />
close()
| Field Summary | |
|---|---|
static short |
EF_COM
File indicating which data groups are present. |
static short |
EF_CVCA
File with the EAC CVCA references. |
static short |
EF_DG1
Data group 1 contains the MRZ. |
static short |
EF_DG10
Data group 10 contains substance features. |
static short |
EF_DG11
Data group 11 contains additional personal details. |
static short |
EF_DG12
Data group 12 contains additional document details. |
static short |
EF_DG13
Data group 13 contains optional details. |
static short |
EF_DG14
Data group 14 is RFU. |
static short |
EF_DG15
Data group 15 contains the public key used for Active Authentication. |
static short |
EF_DG16
Data group 16 contains person(s) to notify. |
static short |
EF_DG2
Data group 2 contains face image data. |
static short |
EF_DG3
Data group 3 contains finger print data. |
static short |
EF_DG4
Data group 4 contains iris data. |
static short |
EF_DG5
Data group 5 contains displayed portrait. |
static short |
EF_DG6
Data group 6 is RFU. |
static short |
EF_DG7
Data group 7 contains displayed signature. |
static short |
EF_DG8
Data group 8 contains data features. |
static short |
EF_DG9
Data group 9 contains structure features. |
static short |
EF_SOD
The security document. |
static int |
maxBlockSize
Deprecated. hack |
protected Random |
random
|
static SimpleDateFormat |
SDF
|
static byte |
SF_COM
|
static byte |
SF_CVCA
|
static byte |
SF_DG1
Short file identifiers for the DGs |
static byte |
SF_DG10
|
static byte |
SF_DG11
|
static byte |
SF_DG12
|
static byte |
SF_DG13
|
static byte |
SF_DG14
|
static byte |
SF_DG15
|
static byte |
SF_DG16
|
static byte |
SF_DG2
|
static byte |
SF_DG3
|
static byte |
SF_DG4
|
static byte |
SF_DG5
|
static byte |
SF_DG6
|
static byte |
SF_DG7
|
static byte |
SF_DG8
|
static byte |
SF_DG9
|
static byte |
SF_SOD
|
protected SecureMessagingWrapper |
wrapper
Deprecated. visibility will be set to private |
| Fields inherited from class net.sourceforge.scuba.smartcards.CardService |
|---|
listeners |
| Constructor Summary | |
|---|---|
PassportService(CardService service)
Creates a new passport service for accessing the passport. |
|
| Method Summary | |
|---|---|
void |
addAuthenticationListener(AuthListener l)
Adds an authentication event listener. |
void |
close()
Closes this service. |
boolean |
doAA(PublicKey publicKey)
s * Performs the Active Authentication protocol. |
void |
doBAC(BACKeySpec bacKey)
Performs the Basic Access Control protocol. |
KeyPair |
doCA(int keyId,
PublicKey key)
Perform CA (Chip Authentication) part of EAC. |
void |
doEAC(int keyId,
PublicKey key,
org.jmrtd.cert.CVCPrincipal caReference,
List<org.jmrtd.cert.CardVerifiableCertificate> terminalCertificates,
PrivateKey terminalKey,
String documentNumber)
Performs the EAC protocol with the passport. |
byte[] |
doTA(org.jmrtd.cert.CVCPrincipal caReference,
List<org.jmrtd.cert.CardVerifiableCertificate> terminalCertificates,
PrivateKey terminalKey,
byte[] caKeyHash,
String documentNumber)
|
byte[] |
doTA(org.jmrtd.cert.CVCPrincipal caReference,
List<org.jmrtd.cert.CardVerifiableCertificate> terminalCertificates,
PrivateKey terminalKey,
String taAlg,
byte[] caKeyHash,
String documentNumber)
Perform TA (Terminal Authentication) part of EAC. |
SecureMessagingWrapper |
getWrapper()
Gets the wrapper. |
boolean |
isOpen()
Whether this service is open. |
protected void |
notifyAAPerformed(AAEvent event)
Notifies listeners about AA event. |
protected void |
notifyBACPerformed(BACEvent event)
Notifies listeners about BAC events. |
protected void |
notifyEACPerformed(EACEvent event)
Notifies listeners about EAC event. |
void |
open()
Opens a session. |
CardFileInputStream |
readFile(short fid)
Gets the file indicated by a file identifier. |
void |
removeAuthenticationListener(AuthListener l)
Removes an authentication event listener. |
byte[] |
sendAA(PublicKey publicKey,
byte[] challenge)
Performs the Active Authentication protocol. |
void |
setWrapper(SecureMessagingWrapper wrapper)
Deprecated. hack |
| Methods inherited from class net.sourceforge.scuba.smartcards.CardService |
|---|
notifyExchangedAPDU |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final short EF_DG1
public static final short EF_DG2
public static final short EF_DG3
public static final short EF_DG4
public static final short EF_DG5
public static final short EF_DG6
public static final short EF_DG7
public static final short EF_DG8
public static final short EF_DG9
public static final short EF_DG10
public static final short EF_DG11
public static final short EF_DG12
public static final short EF_DG13
public static final short EF_DG14
public static final short EF_DG15
public static final short EF_DG16
public static final short EF_SOD
public static final short EF_COM
public static final short EF_CVCA
public static final byte SF_DG1
public static final byte SF_DG2
public static final byte SF_DG3
public static final byte SF_DG4
public static final byte SF_DG5
public static final byte SF_DG6
public static final byte SF_DG7
public static final byte SF_DG8
public static final byte SF_DG9
public static final byte SF_DG10
public static final byte SF_DG11
public static final byte SF_DG12
public static final byte SF_DG13
public static final byte SF_DG14
public static final byte SF_DG15
public static final byte SF_DG16
public static final byte SF_COM
public static final byte SF_SOD
public static final byte SF_CVCA
public static final SimpleDateFormat SDF
public static int maxBlockSize
protected SecureMessagingWrapper wrapper
protected Random random
| Constructor Detail |
|---|
public PassportService(CardService service)
throws CardServiceException
service - another service which will deal with sending the apdus to the
card.
GeneralSecurityException - when the available JCE providers cannot provide the necessary
cryptographic primitives.
CardServiceException| Method Detail |
|---|
public void open()
throws CardServiceException
open in class PassportApduServiceCardServiceExceptionpublic boolean isOpen()
isOpen in class PassportApduService
public void doBAC(BACKeySpec bacKey)
throws CardServiceException
bacKey - the key based on the document number,
the card holder's birth date,
and the document's expiry date
CardServiceException - if authentication failed
public KeyPair doCA(int keyId,
PublicKey key)
throws CardServiceException
keyId - passport's public key id (stored in DG14), -1 if none.key - passport's public key (stored in DG14).
CardServiceException - if CA failed or some error occurred
public byte[] doTA(org.jmrtd.cert.CVCPrincipal caReference,
List<org.jmrtd.cert.CardVerifiableCertificate> terminalCertificates,
PrivateKey terminalKey,
String taAlg,
byte[] caKeyHash,
String documentNumber)
throws CardServiceException
CardServiceException
public byte[] doTA(org.jmrtd.cert.CVCPrincipal caReference,
List<org.jmrtd.cert.CardVerifiableCertificate> terminalCertificates,
PrivateKey terminalKey,
byte[] caKeyHash,
String documentNumber)
throws CardServiceException
CardServiceException
public void doEAC(int keyId,
PublicKey key,
org.jmrtd.cert.CVCPrincipal caReference,
List<org.jmrtd.cert.CardVerifiableCertificate> terminalCertificates,
PrivateKey terminalKey,
String documentNumber)
throws CardServiceException
keyId - passport's public key id (stored in DG14), -1 if none.key - passport's public key (stored in DG14).caReference - the CA certificate key reference, this can be read from the
CVCA fileterminalCertificates - the list/chain of terminal certificatesterminalKey - terminal private keydocumentNumber - the passport number
CardServiceException - on errorpublic void addAuthenticationListener(AuthListener l)
l - listenerpublic void removeAuthenticationListener(AuthListener l)
l - listenerprotected void notifyBACPerformed(BACEvent event)
event - BAC eventprotected void notifyEACPerformed(EACEvent event)
event - EAC event.
public boolean doAA(PublicKey publicKey)
throws CardServiceException
publicKey - the public key to use (usually read from the card)
GeneralSecurityException - if something goes wrong
CardServiceException
public byte[] sendAA(PublicKey publicKey,
byte[] challenge)
throws CardServiceException
doAA(PublicKey) instead.
publicKey - the public key to use (usually read from the card)challenge - the random challenge of exactly 8 bytes
CardServiceExceptionprotected void notifyAAPerformed(AAEvent event)
event - AA event.public void close()
close in class PassportApduServicepublic SecureMessagingWrapper getWrapper()
null until BAC has been
performed.
public void setWrapper(SecureMessagingWrapper wrapper)
wrapper - wrapper
public CardFileInputStream readFile(short fid)
throws CardServiceException
fid - ICAO file identifier
IOException - if the file cannot be read
CardServiceException
|
JMRTD 0.4.5 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||