JMRTD 0.4.6

org.jmrtd
Class Passport

java.lang.Object
  extended by org.jmrtd.Passport

public class Passport
extends Object

A passport object is basically a collection of buffered input streams for the data groups, combined with some status information (progress). Contains methods for creating instances from scratch, from file, and from card service. Also contains the document verification logic.

Author:
Wojciech Mostowski (woj@cs.ru.nl), Martijn Oostdijk (martijn.oostdijk@gmail.com)

Constructor Summary
Passport(File file, MRTDTrustStore trustManager)
           
Passport(int docType, MRTDTrustStore trustManager)
          Creates passport from scratch.
Passport(PassportService service, BACKeySpec bacKeySpec, MRTDTrustStore trustManager)
           
Passport(PassportService service, MRTDTrustStore trustManager, BACStore bacStore)
           
 
Method Summary
 void addAuthenticationListener(AuthListener l)
          Adds an authentication listener to this MRTD.
 PrivateKey getAAPrivateKey()
           
 BACKeySpec getBACKeySpec()
           
 int getBytesRead()
           
 List<Certificate> getCertificateChain()
          Builds certificate chain from SOd to CSCA anchor.
 CardVerifiableCertificate getCVCertificate()
           
 PrivateKey getDocSigningPrivateKey()
           
 PrivateKey getEACPrivateKey()
           
 byte[] getFileBytes(short fid)
           
 List<Short> getFileList()
           
 InputStream getInputStream(short fid)
          Gets an inputstream that is ready for reading.
 int getTotalLength()
           
 MRTDTrustStore getTrustManager()
           
 VerificationStatus getVerificationStatus()
          Gets the verification status of this MRTD.
 void putFile(short fid, byte[] bytes)
           
 void setAAPrivateKey(PrivateKey key)
           
 void setAAPublicKey(PublicKey key)
           
 void setCVCertificate(CardVerifiableCertificate cert)
           
 void setDocSigningCertificate(X509Certificate newCertificate)
           
 void setDocSigningPrivateKey(PrivateKey key)
           
 void setEACPrivateKey(PrivateKey privateKey)
           
 void setEACPublicKey(PublicKey publicKey)
           
 void updateCOMSODFile(X509Certificate newCertificate)
           
 void verifySecurity()
          Verifies the passport using the security related mechanisms.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Passport

public Passport(int docType,
                MRTDTrustStore trustManager)
         throws GeneralSecurityException
Creates passport from scratch.

Parameters:
docType - either MRZInfo.DOC_TYPE_ID1 or MRZInfo.DOC_TYPE_ID3
Throws:
GeneralSecurityException - if something wrong

Passport

public Passport(PassportService service,
                MRTDTrustStore trustManager,
                BACStore bacStore)
         throws CardServiceException
Throws:
CardServiceException

Passport

public Passport(PassportService service,
                BACKeySpec bacKeySpec,
                MRTDTrustStore trustManager)
         throws IOException,
                CardServiceException
Throws:
IOException
CardServiceException

Passport

public Passport(File file,
                MRTDTrustStore trustManager)
         throws IOException
Throws:
IOException
Method Detail

getInputStream

public InputStream getInputStream(short fid)
                           throws CardServiceException
Gets an inputstream that is ready for reading.

Parameters:
fid -
Returns:
an inputstream for fid
Throws:
CardServiceException

putFile

public void putFile(short fid,
                    byte[] bytes)

updateCOMSODFile

public void updateCOMSODFile(X509Certificate newCertificate)

getFileBytes

public byte[] getFileBytes(short fid)

getBACKeySpec

public BACKeySpec getBACKeySpec()

setDocSigningPrivateKey

public void setDocSigningPrivateKey(PrivateKey key)

setDocSigningCertificate

public void setDocSigningCertificate(X509Certificate newCertificate)

setCVCertificate

public void setCVCertificate(CardVerifiableCertificate cert)

getCVCertificate

public CardVerifiableCertificate getCVCertificate()

getDocSigningPrivateKey

public PrivateKey getDocSigningPrivateKey()

getTrustManager

public MRTDTrustStore getTrustManager()

setEACPrivateKey

public void setEACPrivateKey(PrivateKey privateKey)

setEACPublicKey

public void setEACPublicKey(PublicKey publicKey)

getAAPrivateKey

public PrivateKey getAAPrivateKey()

setAAPrivateKey

public void setAAPrivateKey(PrivateKey key)

setAAPublicKey

public void setAAPublicKey(PublicKey key)

getEACPrivateKey

public PrivateKey getEACPrivateKey()

getTotalLength

public int getTotalLength()

getBytesRead

public int getBytesRead()

getFileList

public List<Short> getFileList()

verifySecurity

public void verifySecurity()
Verifies the passport using the security related mechanisms. Adjusts the verificationIndicator to show the user the verification status. Assumes passport object is non-null and read from the service.


getCertificateChain

public List<Certificate> getCertificateChain()
                                      throws ExtCertPathValidatorException
Builds certificate chain from SOd to CSCA anchor. Uses PKIX algorithm.

Returns:
a list of certificates
Throws:
ExtCertPathValidatorException - if could not be checked

addAuthenticationListener

public void addAuthenticationListener(AuthListener l)
Adds an authentication listener to this MRTD.

Parameters:
l - an authentication listener

getVerificationStatus

public VerificationStatus getVerificationStatus()
Gets the verification status of this MRTD.

Returns:
a VerificationStatus

JMRTD 0.4.6