ezcrypto 0.3 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +10 -0
- data/README +152 -152
- data/init.rb +0 -1
- data/lib/active_crypto.rb +313 -294
- data/lib/ezcrypto.rb +24 -5
- data/rakefile +8 -7
- data/test/active_crypto_test.rb +22 -8
- data/test/association_key_holder_test.rb +38 -0
- data/test/debug.log +203 -0
- data/test/encrypt_test.rb +37 -0
- data/test/key_holder_test.rb +44 -0
- metadata +31 -22
@@ -0,0 +1,44 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__) + "/../lib/")
|
2
|
+
require File.join(File.dirname(__FILE__), 'test_helper')
|
3
|
+
require 'test/unit'
|
4
|
+
require 'active_crypto'
|
5
|
+
class KeyHolderSubject
|
6
|
+
include ActiveCrypto::KeyHolder
|
7
|
+
end
|
8
|
+
|
9
|
+
class KeyHolderTest < Test::Unit::TestCase
|
10
|
+
|
11
|
+
attr :key_holder
|
12
|
+
|
13
|
+
def setup
|
14
|
+
@key_holder=KeyHolderSubject.new
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_session_key_should_not_be_set_on_new
|
18
|
+
assert_nil key_holder.session_key
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_set_session_key_should_set_session_key
|
22
|
+
key=EzCrypto::Key.generate
|
23
|
+
key_holder.set_session_key key
|
24
|
+
assert_not_nil key_holder.session_key
|
25
|
+
assert_equal key.raw,key_holder.session_key.raw
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_set_encoded_key_should_set_session_key
|
29
|
+
key=EzCrypto::Key.generate
|
30
|
+
key_holder.set_encoded_key key.encode
|
31
|
+
assert_not_nil key_holder.session_key
|
32
|
+
assert_equal key.raw,key_holder.session_key.raw
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_enter_password_should_set_session_key
|
36
|
+
key=EzCrypto::Key.with_password "test","onetwothree"
|
37
|
+
key_holder.enter_password "test"
|
38
|
+
assert_not_nil key_holder.session_key
|
39
|
+
assert_equal key.raw,key_holder.session_key.raw
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
end
|
44
|
+
|
metadata
CHANGED
@@ -3,11 +3,11 @@ rubygems_version: 0.8.10
|
|
3
3
|
specification_version: 1
|
4
4
|
name: ezcrypto
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: "0.
|
7
|
-
date: 2006-
|
6
|
+
version: "0.5"
|
7
|
+
date: 2006-07-19
|
8
8
|
summary: Simplified encryption library.
|
9
9
|
require_paths:
|
10
|
-
|
10
|
+
- lib
|
11
11
|
email: pelle@stakeitout.com
|
12
12
|
homepage: http://ezcrypto.rubyforge.org
|
13
13
|
rubyforge_project: ezcrypto
|
@@ -18,32 +18,41 @@ bindir: bin
|
|
18
18
|
has_rdoc: true
|
19
19
|
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
20
|
requirements:
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
version: 0.0.0
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
25
24
|
version:
|
26
25
|
platform: ruby
|
27
26
|
authors:
|
28
|
-
|
27
|
+
- Pelle Braendgaard
|
29
28
|
files:
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
29
|
+
- rakefile
|
30
|
+
- README
|
31
|
+
- README_ACTIVE_CRYPTO
|
32
|
+
- MIT-LICENSE
|
33
|
+
- CHANGELOG
|
34
|
+
- init.rb
|
35
|
+
- lib/active_crypto.rb
|
36
|
+
- lib/ezcrypto.rb
|
37
|
+
- test/active_crypto_test.rb
|
38
|
+
- test/association_key_holder_test.rb
|
39
|
+
- test/database.yml
|
40
|
+
- test/debug.log
|
41
|
+
- test/encrypt_test.rb
|
42
|
+
- test/ezcrypto_test.rb
|
43
|
+
- test/key_holder_test.rb
|
44
|
+
- test/test_helper.rb
|
42
45
|
test_files: []
|
46
|
+
|
43
47
|
rdoc_options: []
|
48
|
+
|
44
49
|
extra_rdoc_files: []
|
50
|
+
|
45
51
|
executables: []
|
52
|
+
|
46
53
|
extensions: []
|
54
|
+
|
47
55
|
requirements:
|
48
|
-
|
49
|
-
dependencies: []
|
56
|
+
- none
|
57
|
+
dependencies: []
|
58
|
+
|