Example usage for org.bouncycastle.tsp TSPAlgorithms SHA384

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

Introduction

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

Prototype

ASN1ObjectIdentifier SHA384

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

Click Source Link

Usage

From source file:be.fedict.eid.applet.service.signer.time.TSPTimeStampService.java

License:Open Source License

/**
 * Sets the digest algorithm used for time-stamping data. Example value:
 * "SHA-1"./*from   ww  w . ja va2 s . c o  m*/
 * 
 * @param digestAlgo
 */
public void setDigestAlgo(String digestAlgo) {
    if ("SHA-1".equals(digestAlgo)) {
        this.digestAlgoOid = TSPAlgorithms.SHA1;
    } else if ("SHA-256".equals(digestAlgo)) {
        this.digestAlgoOid = TSPAlgorithms.SHA256;
    } else if ("SHA-384".equals(digestAlgo)) {
        this.digestAlgoOid = TSPAlgorithms.SHA384;
    } else if ("SHA-512".equals(digestAlgo)) {
        this.digestAlgoOid = TSPAlgorithms.SHA512;
    } else {
        throw new IllegalArgumentException("unsupported digest algo: " + digestAlgo);
    }
    this.digestAlgo = digestAlgo;
}

From source file:es.mityc.firmaJava.ts.TSPAlgoritmos.java

License:LGPL

public static String getAlgName(String oid) {
    if (TSPAlgorithms.SHA1.equals(oid))
        return SHA1;
    else if (TSPAlgorithms.SHA256.equals(oid))
        return SHA2;
    else if (TSPAlgorithms.SHA224.equals(oid))
        return SHA224;
    else if (TSPAlgorithms.SHA256.equals(oid))
        return SHA256;
    else if (TSPAlgorithms.SHA384.equals(oid))
        return SHA384;
    else if (TSPAlgorithms.SHA512.equals(oid))
        return SHA512;
    return oid;//from   w  ww  . ja v  a 2s  .  co m
}

From source file:es.mityc.firmaJava.ts.TSPAlgoritmos.java

License:LGPL

public static String getOID(String algoritmo) {

    Set permitidos = new HashSet(Arrays.asList(getValoresPermitidos()));

    if (permitidos.contains(algoritmo)) {
        if (SHA1.equals(algoritmo))
            return TSPAlgorithms.SHA1;
        else if (SHA2.equals(algoritmo))
            return TSPAlgorithms.SHA256;
        else if (SHA224.equals(algoritmo))
            return TSPAlgorithms.SHA224;
        else if (SHA256.equals(algoritmo))
            return TSPAlgorithms.SHA256;
        else if (SHA384.equals(algoritmo))
            return TSPAlgorithms.SHA384;
        else if (SHA512.equals(algoritmo))
            return TSPAlgorithms.SHA512;
    }//w w  w. java  2s.  c  o m
    return null;
}