ACListpublic class ACList extends Object This class represents access control list (ACL). |
Fields Summary |
---|
private byte[] | AIDAID for this ACL. | private Vector | ACEntriesThe list of ACEs. | private PINData[] | PINInfoPIN information for APDU connection. |
Constructors Summary |
---|
ACList(ACLFileReader r)Constructs ACL object.
byte [] aid = new byte[16];
int count = 0;
String s = r.readWord();
while (! s.equals("{")) {
aid[count++] = (byte) Short.parseShort(s, 16);
s = r.readWord();
}
if (count > 0) {
AID = new byte[count];
System.arraycopy(aid, 0, AID, 0, count);
}
Vector pin_info = new Vector();
while (true) {
s = r.readWord();
if (s.equals("}")) {
break;
}
if (! s.equals("ace")) {
throw new IOException();
}
ACEntries.addElement(new ACEntry(r, pin_info));
}
PINInfo = new PINData[pin_info.size()];
pin_info.copyInto(PINInfo);
|
Methods Summary |
---|
public java.util.Vector | getACEntries()Returns the list of ACEs.
return ACEntries;
| void | getPINs(boolean isAPDU, java.util.Vector result)Places information about PINs into the vector.
for (int i = 0; i < PINInfo.length; i++) {
if (isAPDU == (PINInfo[i].commands instanceof Integer[])) {
result.addElement(PINInfo[i]);
}
}
| public boolean | match(byte[] selectAPDU)Verifies if this ACL describes permissions for AID in SELECT APDU.
return (AID == null) ||
(AID.length == selectAPDU[4] &&
Utils.byteMatch(AID, 0, AID.length,
selectAPDU, 5, AID.length));
|
|