Search in sources :

Example 6 with Timestamp

use of java.security.Timestamp in project robovm by robovm.

the class TimestampTest method testTimestamp.

public void testTimestamp() {
    try {
        new Timestamp(null, cpath);
        fail("null was accepted");
    } catch (NullPointerException ex) {
    /* ok */
    }
    try {
        new Timestamp(now, null);
        fail("null was accepted");
        return;
    } catch (NullPointerException ex) {
    /* ok */
    }
    Timestamp timestamp = new Timestamp(now, cpath);
    assertEquals("not expected value", now, timestamp.getTimestamp());
    assertEquals("not expected cert path", cpath, timestamp.getSignerCertPath());
}
Also used : Timestamp(java.security.Timestamp)

Example 7 with Timestamp

use of java.security.Timestamp in project robovm by robovm.

the class TimestampTest method testGetTimestamp.

public void testGetTimestamp() {
    Timestamp t = new Timestamp(now, cpath);
    assertEquals(now, t.getTimestamp());
    assertNotSame(now, t.getTimestamp());
}
Also used : Timestamp(java.security.Timestamp)

Aggregations

Timestamp (java.security.Timestamp)7 CodeSigner (java.security.CodeSigner)2 X509Certificate (java.security.cert.X509Certificate)2 Date (java.util.Date)2 URI (java.net.URI)1 KeyStoreException (java.security.KeyStoreException)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 UnrecoverableEntryException (java.security.UnrecoverableEntryException)1 UnrecoverableKeyException (java.security.UnrecoverableKeyException)1 CertPath (java.security.cert.CertPath)1 CertStore (java.security.cert.CertStore)1 CertStoreException (java.security.cert.CertStoreException)1 Certificate (java.security.cert.Certificate)1 CertificateException (java.security.cert.CertificateException)1 CertificateFactory (java.security.cert.CertificateFactory)1 JarEntry (java.util.jar.JarEntry)1 JarFile (java.util.jar.JarFile)1 MyCertPath (org.apache.harmony.security.tests.support.cert.MyCertPath)1 CertStoreHelper (sun.security.provider.certpath.CertStoreHelper)1 TimestampToken (sun.security.timestamp.TimestampToken)1