diff options
author | Tarun Gupta <tarun1995gupta@gmail.com> | 2015-07-26 08:19:02 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2015-08-17 15:06:09 (GMT) |
commit | afac50e2a7bfaf70d53a8265194b5a5ca13034f8 (patch) | |
tree | 255a9b20fd99995eb6c68c46f13a26221ccae46a /test/com/isode/stroke/stringcodecs/HMACSHA1Test.java | |
parent | f56f245c1f7e768caf356a0e7b57f428cf8cc6da (diff) | |
download | stroke-afac50e2a7bfaf70d53a8265194b5a5ca13034f8.zip stroke-afac50e2a7bfaf70d53a8265194b5a5ca13034f8.tar.bz2 |
Remove unnecessary Crypto functions from StringCodecs.
Remove SHA1 and HMACSHA1 from StringCodecs as they are already provided by CryptoProvider,
and is equivalent to Swiften.
License:
This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
Test-Information:
Add tests for Base64 and PBKDF2, which passes.
Change-Id: Ife05f185a10a79c9d69a12235f1b0397d022d992
Diffstat (limited to 'test/com/isode/stroke/stringcodecs/HMACSHA1Test.java')
-rw-r--r-- | test/com/isode/stroke/stringcodecs/HMACSHA1Test.java | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/test/com/isode/stroke/stringcodecs/HMACSHA1Test.java b/test/com/isode/stroke/stringcodecs/HMACSHA1Test.java deleted file mode 100644 index dedcd7c..0000000 --- a/test/com/isode/stroke/stringcodecs/HMACSHA1Test.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2010, Isode Limited, London, England. - * All rights reserved. - */ -/* - * Copyright (c) 2010, Remko Tron?on. - * All rights reserved. - */ - -package com.isode.stroke.stringcodecs; - -import com.isode.stroke.base.ByteArray; - -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import static org.junit.Assert.*; - -public class HMACSHA1Test { - - private ByteArray cast(int[] source) { - byte[] result = new byte[source.length]; - for (int i = 0; i < source.length; i++) { - result[i] = (byte)source[i]; - } - return new ByteArray(result); - } - - @Test - public void testGetResult() { - ByteArray result = HMACSHA1.getResult(new ByteArray("foo"), new ByteArray("foobar")); - assertEquals(cast(new int[]{0xa4, 0xee, 0xba, 0x8e, 0x63, 0x3d, 0x77, 0x88, 0x69, 0xf5, 0x68, 0xd0, 0x5a, 0x1b, 0x3d, 0xc7, 0x2b, 0xfd, 0x4, 0xdd}), result); - } -} |