Methods Summary |
---|
private static int | getPINCommandIndex(java.lang.String s)Returns PIN operation identifier for given string.
if (s.equals("verify")) {
return ACLPermissions.CMD_VERIFY;
}
if (s.equals("change")) {
return ACLPermissions.CMD_CHANGE;
}
if (s.equals("disable")) {
return ACLPermissions.CMD_DISABLE;
}
if (s.equals("enable")) {
return ACLPermissions.CMD_ENABLE;
}
if (s.equals("unblock")) {
return ACLPermissions.CMD_UNBLOCK;
}
throw new IOException("Invalid command: " + s);
|
void | getPermissions(boolean isAPDU, java.util.Vector permissions)Places permissions from this ACE to the vector.
if (isAPDU) {
if (APDUPermissions != null) {
permissions.addElement(APDUPermissions);
}
} else {
if (JCRMIPermissions != null) {
for (int k = 0; k < JCRMIPermissions.length; k++) {
permissions.addElement(JCRMIPermissions[k]);
}
}
}
|
boolean | hasPermissions()Verifies if the ACE contains permissions.
return (APDUPermissions != null || JCRMIPermissions != null);
|
private static void | readAPDUPIN(ACLFileReader r, java.util.Vector dest)Reads PIN information from file and adds a new object into vector.
r.checkWord("{");
r.checkWord("id");
int id = r.readByte();
Integer[] commands = new Integer[ACLPermissions.CMD_COUNT];
while (true) {
String s = r.readWord();
if (s.equals("}")) {
break;
}
int index = getPINCommandIndex(s);
int command = 0;
for (int i = 0; i < 4; i++) {
command = (command << 8) | r.readByte();
}
commands[index] = new Integer(command);
}
dest.addElement(new PINData(id, commands));
|
private static void | readAPDUPermission(ACLFileReader r, java.util.Vector t_apdu)Reads APDU permission from file and places it into the vector.
r.checkWord("{");
String s = r.readWord();
while (true) {
if (s.equals("}")) {
break;
}
byte[] data = new byte[8];
for (int i = 0; i < 8; i++) {
data[i] = (byte) Short.parseShort(s, 16);
s = r.readWord();
}
t_apdu.addElement(data);
}
|
private static void | readJCRMIPIN(ACLFileReader r, java.util.Vector dest)Reads PIN information from file and adds a new object into vector.
r.checkWord("{");
r.checkWord("id");
int id = r.readByte();
String[] commands = new String[ACLPermissions.CMD_COUNT];
while (true) {
String s = r.readWord();
if (s.equals("}")) {
break;
}
commands[getPINCommandIndex(s)] = r.readWord();
}
dest.addElement(new PINData(id, commands));
|
private static void | readJCRMIPermission(ACLFileReader r, java.util.Vector t_jcrmi)Reads JCRMI permission from file and places it into the vector.
Vector classes = new Vector();
Vector methods = new Vector();
String hashModifier = null;
r.checkWord("{");
while (true) {
String s = r.readWord();
if (s.equals("}")) {
break;
}
if (s.equals("classes")) {
r.checkWord("{");
s = r.readWord();
while (! s.equals("}")) {
classes.addElement(s);
s = r.readWord();
}
} else
if (s.equals("hashModifier")) {
hashModifier = r.readWord();
} else
if (s.equals("methods")) {
r.checkWord("{");
s = r.readWord();
while (! s.equals("}")) {
methods.addElement(s);
s = r.readWord();
}
} else {
throw new IOException();
}
}
t_jcrmi.addElement(new JCRMIPermission(hashModifier, classes, methods));
|
boolean | verifyPrincipal(java.lang.String root)Verifies if this ACE describes permissions for this CA.
if (roots == null) {
return true;
}
for (int i = 0; i < roots.length; i++) {
if (roots[i].equals(root)) {
return true;
}
}
return false;
|