Search in sources :

Example 16 with PRFDProxy

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);
}
Also used : PRFDProxy(org.mozilla.jss.nss.PRFDProxy)

Example 17 with PRFDProxy

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);
}
Also used : PRFDProxy(org.mozilla.jss.nss.PRFDProxy)

Aggregations

PRFDProxy (org.mozilla.jss.nss.PRFDProxy)17 SSLFDProxy (org.mozilla.jss.nss.SSLFDProxy)11 BufferProxy (org.mozilla.jss.nss.BufferProxy)2 SSLException (javax.net.ssl.SSLException)1 CryptoManager (org.mozilla.jss.CryptoManager)1 SSLChannelInfo (org.mozilla.jss.nss.SSLChannelInfo)1 SSLPreliminaryChannelInfo (org.mozilla.jss.nss.SSLPreliminaryChannelInfo)1 SecurityStatusResult (org.mozilla.jss.nss.SecurityStatusResult)1 PK11Cert (org.mozilla.jss.pkcs11.PK11Cert)1 PK11PrivKey (org.mozilla.jss.pkcs11.PK11PrivKey)1 SSLAlertEvent (org.mozilla.jss.ssl.SSLAlertEvent)1