|
JMRTD 0.4.6 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jmrtd.lds.PassportFile
org.jmrtd.lds.SODFile
public class SODFile
File structure for the EF_SOD file. This file contains the security object.
| Field Summary |
|---|
| Fields inherited from class org.jmrtd.lds.PassportFile |
|---|
EF_COM_TAG, EF_DG1_TAG, EF_DG10_TAG, EF_DG11_TAG, EF_DG12_TAG, EF_DG13_TAG, EF_DG14_TAG, EF_DG15_TAG, EF_DG16_TAG, EF_DG2_TAG, EF_DG3_TAG, EF_DG4_TAG, EF_DG5_TAG, EF_DG6_TAG, EF_DG7_TAG, EF_DG8_TAG, EF_DG9_TAG, EF_SOD_TAG |
| Constructor Summary | |
|---|---|
SODFile(InputStream in)
Constructs a Security Object data structure. |
|
SODFile(String digestAlgorithm,
String digestEncryptionAlgorithm,
Map<Integer,byte[]> dataGroupHashes,
byte[] encryptedDigest,
X509Certificate docSigningCertificate)
Constructs a Security Object data structure. |
|
SODFile(String digestAlgorithm,
String digestEncryptionAlgorithm,
Map<Integer,byte[]> dataGroupHashes,
PrivateKey privateKey,
X509Certificate docSigningCertificate)
Constructs a Security Object data structure. |
|
SODFile(String digestAlgorithm,
String digestEncryptionAlgorithm,
Map<Integer,byte[]> dataGroupHashes,
PrivateKey privateKey,
X509Certificate docSigningCertificate,
String provider)
Constructs a Security Object data structure using a specified signature provider. |
|
SODFile(String digestAlgorithm,
String digestEncryptionAlgorithm,
Map<Integer,byte[]> dataGroupHashes,
PrivateKey privateKey,
X509Certificate docSigningCertificate,
String provider,
String ldsVersion,
String unicodeVersion)
Constructs a Security Object data structure using a specified signature provider. |
|
| Method Summary | |
|---|---|
boolean |
checkDocSignature(Certificate docSigningCert)
Verifies the signature over the contents of the security object. |
boolean |
equals(Object obj)
|
Map<Integer,byte[]> |
getDataGroupHashes()
Gets the stored data group hashes. |
String |
getDigestAlgorithm()
Gets the name of the algorithm used in the data group hashes. |
String |
getDigestEncryptionAlgorithm()
Gets the name of the algorithm used in the signature. |
X509Certificate |
getDocSigningCertificate()
Gets the document signing certificate. |
byte[] |
getEncoded()
Gets the contents of this file as byte array, includes the ICAO tag and length. |
byte[] |
getEncryptedDigest()
Gets the signature (the encrypted digest) over the hashes. |
X500Principal |
getIssuerX500Principal()
|
String |
getLdsVersion()
Gets the version of the LDS if stored in the Security Object (SOd). |
BigInteger |
getSerialNumber()
|
int |
getTag()
The tag of this file. |
String |
getUnicodeVersion()
Gets the version of unicode if stored in the Security Object (SOd). |
int |
hashCode()
|
String |
toString()
Gets a textual representation of this file. |
| Methods inherited from class org.jmrtd.lds.PassportFile |
|---|
createPassportFile, lookupDataGroupNumberByTag, lookupFIDByDataGroupNumber, lookupFIDByTag, lookupTagByDataGroupNumber, lookupTagByFID, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SODFile(String digestAlgorithm,
String digestEncryptionAlgorithm,
Map<Integer,byte[]> dataGroupHashes,
byte[] encryptedDigest,
X509Certificate docSigningCertificate)
throws NoSuchAlgorithmException,
CertificateException
digestAlgorithm - a digest algorithm, such as "SHA1" or "SHA256"digestEncryptionAlgorithm - a digest encryption algorithm, such as "SHA256withRSA"dataGroupHashes - maps datagroupnumbers (1 to 16) to hashes of the data groupsencryptedDigest - ???docSigningCertificate - the document signing certificate
NoSuchAlgorithmException - if either of the algorithm parameters is not recognized
CertificateException - if the document signing certificate cannot be used
public SODFile(String digestAlgorithm,
String digestEncryptionAlgorithm,
Map<Integer,byte[]> dataGroupHashes,
PrivateKey privateKey,
X509Certificate docSigningCertificate,
String provider)
throws NoSuchAlgorithmException,
CertificateException
digestAlgorithm - a digest algorithm, such as "SHA1" or "SHA256"digestEncryptionAlgorithm - a digest encryption algorithm, such as "SHA256withRSA"dataGroupHashes - maps datagroup numbers (1 to 16) to hashes of the data groupsprivateKey - private key to sign the datadocSigningCertificate - the document signing certificateprovider - specific signature provider that should be used to create the signature
NoSuchAlgorithmException - if either of the algorithm parameters is not recognized
CertificateException - if the document signing certificate cannot be used
public SODFile(String digestAlgorithm,
String digestEncryptionAlgorithm,
Map<Integer,byte[]> dataGroupHashes,
PrivateKey privateKey,
X509Certificate docSigningCertificate,
String provider,
String ldsVersion,
String unicodeVersion)
throws NoSuchAlgorithmException,
CertificateException
digestAlgorithm - a digest algorithm, such as "SHA1" or "SHA256"digestEncryptionAlgorithm - a digest encryption algorithm, such as "SHA256withRSA"dataGroupHashes - maps datagroup numbers (1 to 16) to hashes of the data groupsprivateKey - private key to sign the datadocSigningCertificate - the document signing certificateprovider - specific signature provider that should be used to create the signature
NoSuchAlgorithmException - if either of the algorithm parameters is not recognized
CertificateException - if the document signing certificate cannot be used
public SODFile(String digestAlgorithm,
String digestEncryptionAlgorithm,
Map<Integer,byte[]> dataGroupHashes,
PrivateKey privateKey,
X509Certificate docSigningCertificate)
throws NoSuchAlgorithmException,
CertificateException
digestAlgorithm - a digest algorithm, such as "SHA1" or "SHA256"digestEncryptionAlgorithm - a digest encryption algorithm, such as "SHA256withRSA"dataGroupHashes - maps datagroup numbers (1 to 16) to hashes of the data groupsprivateKey - private key to sign the datadocSigningCertificate - the document signing certificate
NoSuchAlgorithmException - if either of the algorithm parameters is not recognized
CertificateException - if the document signing certificate cannot be used
public SODFile(InputStream in)
throws IOException
in - some inputstream
IOException - if something goes wrong| Method Detail |
|---|
public int getTag()
public byte[] getEncoded()
PassportFile
getEncoded in class PassportFilepublic Map<Integer,byte[]> getDataGroupHashes()
public byte[] getEncryptedDigest()
public String getDigestAlgorithm()
public String getDigestEncryptionAlgorithm()
public String getLdsVersion()
public String getUnicodeVersion()
public X509Certificate getDocSigningCertificate()
throws IOException,
CertificateException
IOException
CertificateException
public boolean checkDocSignature(Certificate docSigningCert)
throws GeneralSecurityException
docSigningCert - the certificate to use
(should be X509 certificate)
GeneralSecurityException - if something goes wrongpublic X500Principal getIssuerX500Principal()
public BigInteger getSerialNumber()
public String toString()
toString in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
JMRTD 0.4.6 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||