You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2016/05/19 11:39:12 UTC

[jira] [Commented] (CODEC-222) Fluent interface for HmacUtils

    [ https://issues.apache.org/jira/browse/CODEC-222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15290953#comment-15290953 ] 

Sebb commented on CODEC-222:
----------------------------

URL: http://svn.apache.org/viewvc?rev=1744554&view=rev
Log:
CODEC-222 Fluent interface for HmacUtils
Initial implementation

Modified:
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/HmacUtils.java

As for the Digest implementation, only the parameterless doFinal() methods are supported.
This avoids the need to duplicate the doFinalHex() methods.

The static getter name here is 'use' rather than 'with'.
That can be changed.

Also the key is set up in a separate method. 
This allows a new key to be used with the same instance if required.

> Fluent interface for HmacUtils
> ------------------------------
>
>                 Key: CODEC-222
>                 URL: https://issues.apache.org/jira/browse/CODEC-222
>             Project: Commons Codec
>          Issue Type: New Feature
>            Reporter: Sebb
>
> As with DigestUtils, HmacUtils has lots of similar methods, differing only by their name.
> To simplify this, and unify the API for current standard and new algorithms, a fluent approach is proposed. This still allows for using the enum values defined in HmacAlgorithms but does not require the use of a different API for algorithms that are not supported by the enum.
> The design is as for DigestUtils: create an instance of HmacUtils containing the Mac to be updated, and provide chaining instance methods to update it and generate the output.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)