use of org.mozilla.jss.nss.PRFDProxy in project jss by dogtagpki.
the class TestPRFD method TestPROpenWriteClose.
public static void TestPROpenWriteClose() {
PRFDProxy fd = PR.Open("results/prfd_open_write_close", 0x04 | 0x08, 00644);
assert (fd != null);
byte[] data = { 0x2a, 0x20, 0x2a, 0x20 };
assert (PR.Write(fd, data) == 4);
assert (PR.Close(fd) == PR.SUCCESS);
}
use of org.mozilla.jss.nss.PRFDProxy in project jss by dogtagpki.
the class TestPRFD method TestPREmptyRead.
public static void TestPREmptyRead() {
PRFDProxy fd = PR.Open("results/prfd_open_close", 0x04, 00644);
assert (fd != null);
byte[] read_data = PR.Read(fd, 10);
assert (read_data == null || read_data.length == 0);
assert (PR.Close(fd) == PR.SUCCESS);
}
use of org.mozilla.jss.nss.PRFDProxy in project jss by dogtagpki.
the class TestPRFD method TestShutdown.
public static void TestShutdown() {
PRFDProxy fd = PR.NewTCPSocket();
assert (fd != null);
PR.Shutdown(fd, PR.SHUTDOWN_RCV);
PR.Shutdown(fd, PR.SHUTDOWN_SEND);
PR.Shutdown(fd, PR.SHUTDOWN_BOTH);
assert (PR.Close(fd) == PR.SUCCESS);
}
use of org.mozilla.jss.nss.PRFDProxy in project jss by dogtagpki.
the class TestRawSSL method TestSSLImportFD.
public static void TestSSLImportFD() throws Exception {
PRFDProxy fd = PR.NewTCPSocket();
assert (fd != null);
SSLFDProxy ssl_fd = SSL.ImportFD(null, fd);
assert (ssl_fd != null);
assert (PR.Close(ssl_fd) == PR.SUCCESS);
}
use of org.mozilla.jss.nss.PRFDProxy in project jss by dogtagpki.
the class TestRawSSL method TestSSLSecurityStatus.
public static void TestSSLSecurityStatus() throws Exception {
PRFDProxy fd = PR.NewTCPSocket();
assert (fd != null);
SSLFDProxy ssl_fd = SSL.ImportFD(null, fd);
assert (ssl_fd != null);
SecurityStatusResult r = SSL.SecurityStatus(ssl_fd);
assert (r != null);
assert (r.on == 0);
// Validate toString works
System.out.println(r.toString());
assert (PR.Close(ssl_fd) == PR.SUCCESS);
}
Aggregations