Examples of TSTInfo


Examples of org.apache.harmony.security.x509.tsp.TSTInfo

        byte[] timeStampingExtValue = new byte[] { (byte) 1, (byte) 2, (byte) 3 };
        Extension ext = new Extension(timeStampingExtOID, true,
                timeStampingExtValue);
        exts.addExtension(ext);

        TSTInfo tSTInfo = new TSTInfo(1, policy, msgImprint, BigInteger.TEN,
                genTime, accuracy, Boolean.FALSE, nonce, tsa, exts);
       
        Object[] issuerAndSerialNumber = new Object[] { new Name("CN=issuer"),
                ASN1Integer.fromIntValue(12345) };
        // SHA1withDSA OID
View Full Code Here

Examples of org.apache.harmony.security.x509.tsp.TSTInfo

        byte[] timeStampingExtValue = new byte[] { (byte) 1, (byte) 2, (byte) 3 };
        Extension ext = new Extension(timeStampingExtOID, true,
                timeStampingExtValue);
        exts.addExtension(ext);

        TSTInfo info = new TSTInfo(1, policy, msgImprint, BigInteger.TEN,
                genTime, accuracy, Boolean.FALSE, nonce, tsa, exts);

        byte[] encoding = TSTInfo.ASN1.encode(info);
        TSTInfo decoded = (TSTInfo) TSTInfo.ASN1.decode(encoding);

        assertEquals("Decoded version is incorrect", info.getVersion(), decoded
                .getVersion());
        assertEquals("Decoded policy is incorrect", policy, decoded.getPolicy());
        assertTrue("Decoded messageImprint is incorrect", Arrays.equals(
                MessageImprint.ASN1.encode(msgImprint), MessageImprint.ASN1
                        .encode(decoded.getMessageImprint())));
        assertEquals("Decoded serialNumber is incorrect", BigInteger.TEN,
                decoded.getSerialNumber());
        assertEquals("Decoded genTime is incorrect", genTime, decoded
                .getGenTime());
        assertTrue("Decoded accuracy is incorrect", Arrays.equals(accuracy,
                decoded.getAccuracy()));
        assertFalse("Decoded ordering is incorrect", decoded.getOrdering()
                .booleanValue());
        assertEquals("Decoded nonce is incorrect", nonce, decoded.getNonce());
        assertEquals("Decoded tsa is incorrect", tsa, decoded.getTsa());
        assertEquals("Decoded extensions is incorrect", exts, decoded
                .getExtensions());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.