Commons Codec
  1. Commons Codec
  2. CODEC-40

[codec] Patch to add crypto-compatible BigInteger encoding support to Base64

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: Nightly Builds
    • Fix Version/s: 1.4
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      There are crypto standards that require large integers for keys to be encoded in
      base64 with some special caveats (no sign bit, padding, etc). One of the
      standards that requires this is the w3c's XML-Signature standard. This patch
      adds this support along with junit tests. This code is taken from the Apache XML
      Security project's own Base64 class and changed to be more readable and add
      junit tests.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        1244d 18h 42m 1 ggregory@seagullsw.com 14/Jul/09 18:43
        Mark Thomas made changes -
        Workflow jira [ 12371819 ] Default workflow, editable Closed status [ 12601630 ]
        ggregory@seagullsw.com made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        ggregory@seagullsw.com added a comment -

        Should have been closed a while back. Code was committed in 2008!

        Show
        ggregory@seagullsw.com added a comment - Should have been closed a while back. Code was committed in 2008!
        Hide
        Henri Yandell added a comment -

        svn ci -m "Adding Chris Black's patch from CODEC-40 adding BigInteger support to Base64. Still needs edge case testing" src

        Sending src/java/org/apache/commons/codec/binary/Base64.java
        Sending src/test/org/apache/commons/codec/binary/Base64Test.java
        Transmitting file data ..
        Committed revision 634904.

        Show
        Henri Yandell added a comment - svn ci -m "Adding Chris Black's patch from CODEC-40 adding BigInteger support to Base64. Still needs edge case testing" src Sending src/java/org/apache/commons/codec/binary/Base64.java Sending src/test/org/apache/commons/codec/binary/Base64Test.java Transmitting file data .. Committed revision 634904.
        Hide
        Chris Black added a comment -

        Wow, I can't believe that patch has come back after so long
        Feel free to use it, let me know if you need me to do anything more official.

        Show
        Chris Black added a comment - Wow, I can't believe that patch has come back after so long Feel free to use it, let me know if you need me to do anything more official.
        Hide
        Henri Yandell added a comment -

        Also, just noticed that we'd need to get approval from Chris to use the patch. This predates moving to JIRA, so the Attachment says 'No' under the 'Apache granted permisson' bit.

        Show
        Henri Yandell added a comment - Also, just noticed that we'd need to get approval from Chris to use the patch. This predates moving to JIRA, so the Attachment says 'No' under the 'Apache granted permisson' bit.
        Hide
        ggregory@seagullsw.com added a comment -

        I think it would be nice to have the tests and unit tests cover some simple and edge cases: null, -1, 0, 1 as well as bogus byte arrays. A senisble error should be throws NullArgumentException, Illegal ArgumentException, etc.

        Show
        ggregory@seagullsw.com added a comment - I think it would be nice to have the tests and unit tests cover some simple and edge cases: null, -1, 0, 1 as well as bogus byte arrays. A senisble error should be throws NullArgumentException, Illegal ArgumentException, etc.
        Henri Yandell made changes -
        Bugzilla Id 38657
        Fix Version/s 1.4 [ 12311779 ]
        Hide
        Henri Yandell added a comment -

        Consider for 1.4.

        Show
        Henri Yandell added a comment - Consider for 1.4.
        Henri Yandell made changes -
        Affects Version/s Nightly Builds [ 12311728 ]
        Henri Yandell made changes -
        Component/s Codec [ 12311105 ]
        Affects Version/s Nightly Builds [ 12311648 ]
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Key COM-2762 CODEC-40
        Project Commons [ 12310458 ] Commons Codec [ 12310464 ]
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 38657 12342914
        Hide
        Chris Black added a comment -

        Created an attachment (id=17703)
        Adds crypto-compatible integer encoding/decoding to commons-codec Base64

        Show
        Chris Black added a comment - Created an attachment (id=17703) Adds crypto-compatible integer encoding/decoding to commons-codec Base64
        Chris Black created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Chris Black
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development