commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb AT ASF <s...@apache.org>
Subject Re: svn commit: r1744385 - in /commons/proper/codec/trunk/src: main/java/org/apache/commons/codec/digest/ test/java/org/apache/commons/codec/digest/
Date Wed, 18 May 2016 10:52:38 GMT
On 18 May 2016 at 11:41,  <sebb@apache.org> wrote:
> Author: sebb
> Date: Wed May 18 10:41:50 2016
> New Revision: 1744385
>
> URL: http://svn.apache.org/viewvc?rev=1744385&view=rev
> Log:
> MessageDigestAlgorithm => MessageDigestAlgorithms as the former has been dropped
>
> Modified:
>     commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/Digest.java
>     commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/DigestUtils.java
>     commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/HmacUtils.java

Committed in error

>     commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/Sha2Crypt.java
>     commons/proper/codec/trunk/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmTest.java
>
...
>
> Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/HmacUtils.java
> URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/HmacUtils.java?rev=1744385&r1=1744384&r2=1744385&view=diff
> ==============================================================================
> --- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/HmacUtils.java
(original)
> +++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/HmacUtils.java
Wed May 18 10:41:50 2016
> @@ -833,4 +833,34 @@ public final class HmacUtils {
>          mac.update(StringUtils.getBytesUtf8(valueToDigest));
>          return mac;
>      }

Committed in error; reverted in r1744388

> +
> +    // Fluent interface code
> +
> +    private final Mac mac;
> +
> +    private HmacUtils(Mac mac) {
> +        this.mac = mac;
> +    }
> +
> +    public static HmacUtils with(HmacAlgorithms algo, byte[] key) {
> +        return with(algo.getName(), key);
> +    }
> +
> +    public static HmacUtils with(String algo, byte[] key) {
> +        Mac mac = getInitializedMac(algo, key);
> +        return new HmacUtils(mac);
> +    }
> +
> +    public HmacUtils updateHmac(byte[] valueToDigest) {
> +        mac.update(valueToDigest);
> +        return this;
> +    }
> +
> +    public Mac getMac() {
> +        return mac;
> +    }
> +
> +    public byte[] doFinal() {
> +        return mac.doFinal();
> +    }
>  }
>

...

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message