|
JMRTD 0.4.5 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jmrtd.Util
public class Util
Some static helper functions. Mostly dealing with low-level crypto.
| Field Summary | |
|---|---|
static int |
ENC_MODE
Deprecated. |
static int |
MAC_MODE
Deprecated. |
| Method Summary | |
|---|---|
static byte[] |
computeKeySeed(String docNrStr,
String dateOfBirthStr,
String dateOfExpiryStr)
Deprecated. Computes the static key seed, based on information from the MRZ. |
static long |
computeSendSequenceCounter(byte[] rndICC,
byte[] rndIFD)
Deprecated. |
static SecretKey |
deriveKey(byte[] keySeed,
int mode)
Deprecated. Derives the ENC or MAC key from the keySeed. |
static byte[] |
pad(byte[] in)
Deprecated. Pads the input in according to ISO9797-1 padding method 2. |
static byte[] |
pad(byte[] in,
int offset,
int length)
Deprecated. |
static byte[] |
recoverMessage(int digestLength,
byte[] plaintext)
Deprecated. Recovers the M1 part of the message sent back by the AA protocol (INTERNAL AUTHENTICATE command). |
static byte[] |
unpad(byte[] in)
Deprecated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ENC_MODE
public static final int MAC_MODE
| Method Detail |
|---|
public static SecretKey deriveKey(byte[] keySeed,
int mode)
throws GeneralSecurityException
keySeed - the key seed.mode - either ENC_MODE or MAC_MODE.
GeneralSecurityException
public static byte[] computeKeySeed(String docNrStr,
String dateOfBirthStr,
String dateOfExpiryStr)
throws UnsupportedEncodingException,
GeneralSecurityException
docNrStr - a string containing the document number.dateOfBirthStr - a string containing the date of birth (YYMMDD).dateOfExpiryStr - a string containing the date of expiry (YYMMDD).
UnsupportedEncodingException
GeneralSecurityException
public static long computeSendSequenceCounter(byte[] rndICC,
byte[] rndIFD)
public static byte[] pad(byte[] in)
in according to ISO9797-1 padding method 2.
in - input
public static byte[] pad(byte[] in,
int offset,
int length)
public static byte[] unpad(byte[] in)
public static byte[] recoverMessage(int digestLength,
byte[] plaintext)
digestLength - should be 20plaintext - response from card, already 'decrypted' (using the
AA public key)
|
JMRTD 0.4.5 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||