Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.google.code.springcryptoutils.core.mac;
 
 
The default implementation for providing base64 encoded Message Authentication Codes.

Author(s):
Mirko Caserta (mirko.caserta@gmail.com)
public class Base64EncodedMacImpl implements Base64EncodedMac {
    private final MacImpl mac = new MacImpl();

    
The secret key for digesting the message.

Parameters:
secretKey the secret key
    public void setSecretKey(Key secretKey) {
        .setSecretKey(secretKey);
    }

    
The algorithm. The default is HmacSHA1.

Parameters:
algorithm the signature algorithm
    public void setAlgorithm(String algorithm) {
        .setAlgorithm(algorithm);
    }
    public String digest(String message) {
        return Base64.encodeBase64String(.digest(Base64.decodeBase64(message)));
    }
New to GrepCode? Check out our FAQ X