use of org.mozilla.jss.nss.PRFDProxy in project jss by dogtagpki.
the class TestPRFD method TestPROpenNoCreate.
public static void TestPROpenNoCreate() {
String name = "path_which_should_not_exist_on_any_reasonable_system";
PRFDProxy fd = PR.Open(name, 0x02, 00644);
assert (fd == null);
}
use of org.mozilla.jss.nss.PRFDProxy in project jss by dogtagpki.
the class TestPRFD method TestPRRead.
public static void TestPRRead() {
byte[] data = { 0x2a, 0x20, 0x2a, 0x20 };
PRFDProxy fd = PR.Open("results/prfd_open_write_close", 0x04, 00644);
assert (fd != null);
byte[] read_data = PR.Read(fd, 10);
assert (read_data != null);
assert (read_data.length == data.length);
for (int i = 0; i < data.length; i++) {
assert (read_data[i] == data[i]);
}
assert (PR.Close(fd) == PR.SUCCESS);
}
Aggregations