Example usage for org.bouncycastle.tsp TSPAlgorithms RIPEMD160

List of usage examples for org.bouncycastle.tsp TSPAlgorithms RIPEMD160

Introduction

In this page you can find the example usage for org.bouncycastle.tsp TSPAlgorithms RIPEMD160.

Prototype

ASN1ObjectIdentifier RIPEMD160

To view the source code for org.bouncycastle.tsp TSPAlgorithms RIPEMD160.

Click Source Link

Usage

From source file:org.signserver.module.tsa.TimeStampSignerTest.java

License:Open Source License

/**
 * Utility method to return the hash length for the hash types we're testing against
 * /*from  www  .  java2s .c om*/
 * @param hashType
 * @return
 */
private int getHashLength(ASN1ObjectIdentifier hashType) {
    if (TSPAlgorithms.SHA1.equals(hashType)) {
        return 20;
    } else if (TSPAlgorithms.SHA256.equals(hashType)) {
        return 32;
    } else if (TSPAlgorithms.SHA512.equals(hashType)) {
        return 64;
    } else if (TSPAlgorithms.RIPEMD160.equals(hashType)) {
        return 20;
    } else {
        LOG.info("Trying to use an unknow hash algorithm, using dummy length");
        // return the length of a SHA1 hash as a dummy value to allow passing
        // invalid hash algo names for testing
        return 20;
    }
}

From source file:org.signserver.module.tsa.TimeStampSignerTest.java

License:Open Source License

/**
 * Test requesting a timestamp with RIPEMD160 as the hash algorithm
 * // w  w w.j  a  va2s.  com
 * @param worker
 * @throws Exception
 */
@Test
public void test08HashRIPE160() throws Exception {
    testWithHash(TSPAlgorithms.RIPEMD160);
}