Example usage for org.bouncycastle.asn1.pkcs PKCSObjectIdentifiers id_hmacWithSHA256

List of usage examples for org.bouncycastle.asn1.pkcs PKCSObjectIdentifiers id_hmacWithSHA256

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.pkcs PKCSObjectIdentifiers id_hmacWithSHA256.

Prototype

ASN1ObjectIdentifier id_hmacWithSHA256

To view the source code for org.bouncycastle.asn1.pkcs PKCSObjectIdentifiers id_hmacWithSHA256.

Click Source Link

Document

1.2.840.113549.2.9

Usage

From source file:org.viafirma.nucleo.inicio.SecurityProvidersUtils.java

License:Apache License

/**
 * Inicializa los proveedores criptograficos para corregir problemas con las
 * distintas maquinas virtuales/*w  ww. jav a 2 s  .c  om*/
 */
public static void initProviders() {
    BouncyCastleProvider bc = new BouncyCastleProvider();
    // Eliminamos el proveedor para evitar que se solapen si ya existia uno.
    Security.removeProvider(bc.getName());
    Security.addProvider(bc);
    log.info("Lista de proveedores disponible:" + Arrays.asList(Security.getProviders()));
    addHMACAlgorithm(bc, "SHA2", "org.bouncycastle.jce.provider.JCEMac$SHA256",
            "org.bouncycastle.jce.provider.JCEKeyGenerator$HMACSHA256");
    addHMACAlias(bc, "SHA2", PKCSObjectIdentifiers.id_hmacWithSHA256);
    Security.addProvider(bc);
}