Code with Finding: |
class BACPanel.ChallengePanel {
public ChallengePanel() {
super(new FlowLayout());
setBorder(BorderFactory.createTitledBorder(PANEL_BORDER, "Get Challenge"));
challengeField = new HexField(8);
challengeField.setEditable(false);
JButton challengeButton = new JButton("Get Challenge");
challengeButton.addActionListener(this);
add(new JLabel("RND.ICC: "));
add(challengeField);
add(challengeButton);
}
}
class BACPanel.MRZPanel {
public MRZPanel() {
super(new BorderLayout());
setBorder(BorderFactory.createTitledBorder(PANEL_BORDER, "MRZ"));
JPanel top = new JPanel(new FlowLayout());
docNrTF = new JTextField(9);
dateOfBirthTF = new JTextField(6);
dateOfExpiryTF = new JTextField(6);
docNrTF.setText(PassportGUI.DEFAULT_DOC_NR);
dateOfBirthTF.setText(PassportGUI.DEFAULT_DATE_OF_BIRTH);
dateOfExpiryTF.setText(PassportGUI.DEFAULT_DATE_OF_EXPIRY);
kEncTF = new HexField(24);
kEncTF.setEditable(false);
kMacTF = new HexField(24);
kMacTF.setEditable(false);
top.add(new JLabel("Document number: "));
top.add(docNrTF);
top.add(new JLabel("Date of birth: "));
top.add(dateOfBirthTF);
top.add(new JLabel("Date of expiry: "));
top.add(dateOfExpiryTF);
JButton updateButton = new JButton("Derive Keys");
top.add(updateButton);
updateButton.addActionListener(this);
JPanel center = new JPanel(new FlowLayout());
JPanel bottom = new JPanel(new GridLayout(2, 2));
bottom.add(new JLabel("K.ENC: ", JLabel.RIGHT));
bottom.add(kEncTF);
bottom.add(new JLabel("K.MAC: ", JLabel.RIGHT));
bottom.add(kMacTF);
add(top, BorderLayout.NORTH);
add(center, BorderLayout.CENTER);
add(bottom, BorderLayout.SOUTH);
}
}
class BACPanel.MutualAuthPanel {
public MutualAuthPanel() {
super(new BorderLayout());
setBorder(BorderFactory.createTitledBorder(PANEL_BORDER,
"Mutual Authenticate"));
JPanel top = new JPanel(new FlowLayout());
challengeField = new HexField(8);
challengeField.setValue(Hex.hexStringToBytes("781723860C06C226"));
keyField = new HexField(16);
keyField.setValue(Hex
.hexStringToBytes("0B795240CB7049B01C19B33E32804F0B"));
JButton authButton = new JButton("Mutual Authenticate");
authButton.addActionListener(this);
top.add(new JLabel("RND.IFD: "));
top.add(challengeField);
top.add(new JLabel("K.IFD: "));
top.add(keyField);
top.add(authButton);
JPanel center = new JPanel(new FlowLayout());
plaintextField = new HexField(32);
plaintextField.setEditable(false);
center.add(new JLabel("[E.ICC]: "));
center.add(plaintextField);
JPanel bottom = new JPanel(new GridLayout(3, 2));
ksEncTF = new HexField(24);
ksEncTF.setEditable(false);
ksMacTF = new HexField(24);
ksMacTF.setEditable(false);
sscTF = new HexField(8);
sscTF.setEditable(false);
bottom.add(new JLabel("KS.ENC: ", JLabel.RIGHT));
bottom.add(ksEncTF);
bottom.add(new JLabel("KS.MAC: ", JLabel.RIGHT));
bottom.add(ksMacTF);
bottom.add(new JLabel("SSC: ", JLabel.RIGHT));
bottom.add(sscTF);
add(top, BorderLayout.NORTH);
add(center, BorderLayout.CENTER);
add(bottom, BorderLayout.SOUTH);
}
}
|