pkcs11 0.2.4-x64-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. data.tar.gz.sig +0 -0
  2. data/.autotest +23 -0
  3. data/.gemtest +0 -0
  4. data/.yardopts +1 -0
  5. data/History.txt +57 -0
  6. data/MIT-LICENSE +22 -0
  7. data/Manifest.txt +57 -0
  8. data/README.rdoc +205 -0
  9. data/Rakefile +111 -0
  10. data/ext/extconf.rb +7 -0
  11. data/ext/generate_constants.rb +57 -0
  12. data/ext/generate_structs.rb +206 -0
  13. data/ext/generate_thread_funcs.rb +72 -0
  14. data/ext/include/cryptoki.h +66 -0
  15. data/ext/include/ct-kip.h +50 -0
  16. data/ext/include/otp-pkcs11.h +125 -0
  17. data/ext/include/pkcs-11v2-20a3.h +124 -0
  18. data/ext/include/pkcs11.h +299 -0
  19. data/ext/include/pkcs11f.h +912 -0
  20. data/ext/include/pkcs11t.h +1885 -0
  21. data/ext/pk11.c +1675 -0
  22. data/ext/pk11.h +81 -0
  23. data/ext/pk11_const.c +205 -0
  24. data/ext/pk11_const_def.inc +452 -0
  25. data/ext/pk11_const_macros.h +38 -0
  26. data/ext/pk11_struct.doc +792 -0
  27. data/ext/pk11_struct_def.inc +302 -0
  28. data/ext/pk11_struct_impl.inc +302 -0
  29. data/ext/pk11_struct_macros.h +435 -0
  30. data/ext/pk11_thread_funcs.c +411 -0
  31. data/ext/pk11_thread_funcs.h +482 -0
  32. data/ext/pk11_version.h +6 -0
  33. data/lib/2.0/pkcs11_ext.so +0 -0
  34. data/lib/pkcs11.rb +9 -0
  35. data/lib/pkcs11/extensions.rb +68 -0
  36. data/lib/pkcs11/helper.rb +144 -0
  37. data/lib/pkcs11/library.rb +140 -0
  38. data/lib/pkcs11/object.rb +171 -0
  39. data/lib/pkcs11/session.rb +765 -0
  40. data/lib/pkcs11/slot.rb +102 -0
  41. data/pkcs11_protect_server/Manifest.txt +14 -0
  42. data/pkcs11_protect_server/README_PROTECT_SERVER.rdoc +89 -0
  43. data/test/fixtures/softokn/cert8.db +0 -0
  44. data/test/fixtures/softokn/key3.db +0 -0
  45. data/test/fixtures/softokn/secmod.db +0 -0
  46. data/test/helper.rb +58 -0
  47. data/test/test_pkcs11.rb +71 -0
  48. data/test/test_pkcs11_crypt.rb +220 -0
  49. data/test/test_pkcs11_object.rb +122 -0
  50. data/test/test_pkcs11_session.rb +123 -0
  51. data/test/test_pkcs11_slot.rb +78 -0
  52. data/test/test_pkcs11_structs.rb +166 -0
  53. data/test/test_pkcs11_thread.rb +44 -0
  54. metadata +213 -0
  55. metadata.gz.sig +0 -0
@@ -0,0 +1,44 @@
1
+ require "test/unit"
2
+ require "pkcs11"
3
+ require "test/helper"
4
+
5
+ class TestPkcs11Thread < Test::Unit::TestCase
6
+ include PKCS11
7
+
8
+ attr_reader :slots
9
+ attr_reader :slot
10
+ attr_reader :session
11
+
12
+ def setup
13
+ $pkcs11 ||= open_softokn
14
+ @slots = $pkcs11.active_slots
15
+ @slot = slots.last
16
+ @session = slot.open
17
+ # session.login(:USER, "")
18
+ end
19
+
20
+ def teardown
21
+ # @session.logout
22
+ @session.close
23
+ end
24
+
25
+ def test_concurrency
26
+ return unless self.respond_to?(:skip)
27
+ skip "PKCS#11 calls will block on Ruby 1.8.x" if RUBY_VERSION<'1.9'
28
+
29
+ count = 0
30
+ th = Thread.new{
31
+ loop do
32
+ count += 1
33
+ sleep 0.01
34
+ end
35
+ }
36
+ # This should take some seconds:
37
+ pub_key, priv_key = session.generate_key_pair(:RSA_PKCS_KEY_PAIR_GEN,
38
+ {:MODULUS_BITS=>2048, :PUBLIC_EXPONENT=>[3].pack("N"), :TOKEN=>false},
39
+ {})
40
+ th.kill
41
+ assert_operator count, :>, 10, "The second thread should count further concurrent to the key generation"
42
+ end
43
+
44
+ end
metadata ADDED
@@ -0,0 +1,213 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pkcs11
3
+ version: !ruby/object:Gem::Version
4
+ hash: 31
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 4
10
+ version: 0.2.4
11
+ platform: x64-mingw32
12
+ authors:
13
+ - Ryosuke Kutsuna
14
+ - GOTOU Yuuzou
15
+ - Lars Kanis
16
+ autorequire:
17
+ bindir: bin
18
+ cert_chain:
19
+ - |
20
+ -----BEGIN CERTIFICATE-----
21
+ MIIDPDCCAiSgAwIBAgIBADANBgkqhkiG9w0BAQUFADBEMQ0wCwYDVQQDDARsYXJz
22
+ MR8wHQYKCZImiZPyLGQBGRYPZ3JlaXotcmVpbnNkb3JmMRIwEAYKCZImiZPyLGQB
23
+ GRYCZGUwHhcNMTMwMzExMjAyMjIyWhcNMTQwMzExMjAyMjIyWjBEMQ0wCwYDVQQD
24
+ DARsYXJzMR8wHQYKCZImiZPyLGQBGRYPZ3JlaXotcmVpbnNkb3JmMRIwEAYKCZIm
25
+ iZPyLGQBGRYCZGUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZb4Uv
26
+ RFJfRu/VEWiy3psh2jinETjiuBrL0NeRFGf8H7iU9+gx/DI/FFhfHGLrDeIskrJx
27
+ YIWDMmEjVO10UUdj7wu4ZhmU++0Cd7Kq9/TyP/shIP3IjqHjVLCnJ3P6f1cl5rxZ
28
+ gqo+d3BAoDrmPk0rtaf6QopwUw9RBiF8V4HqvpiY+ruJotP5UQDP4/lVOKvA8PI9
29
+ P0GmVbFBrbc7Zt5h78N3UyOK0u+nvOC23BvyHXzCtcFsXCoEkt+Wwh0RFqVZdnjM
30
+ LMO2vULHKKHDdX54K/sbVCj9pN9h1aotNzrEyo55zxn0G9PHg/G3P8nMvAXPkUTe
31
+ brhXrfCwWRvOXA4TAgMBAAGjOTA3MAsGA1UdDwQEAwIEsDAJBgNVHRMEAjAAMB0G
32
+ A1UdDgQWBBRAHK81igrXodaDj8a8/BIKsaZrETANBgkqhkiG9w0BAQUFAAOCAQEA
33
+ Iswhcol3ytXthaUH3k5LopZ09viZrZHzAw0QleI3Opl/9QEGJ2BPV9+93iC0OrNL
34
+ hmnxig6vKK1EeJ5PHXJ8hOI3nTZBrOmQcEXNBqyToP1FHMWZqwZ8wiBPXtiCqDBR
35
+ ePQ25J9xFNzQ1ItgzNSpx5cs67QNKrx5woocoBHD6kStFbshZPJx4axl3GbUFQd5
36
+ H//3YdPQOH3jaVeUXhS+pz/gfbx8fhFAtsQ+855A3HO7g2ZRIg/atAp/0MFyn5s5
37
+ 0rq+VHOIPyvxF5khT0mYAcNmZTC8z1yPsqdgwfYNDjsSWwiIRSPUSmJRvfjM8hsW
38
+ mMFp4kPUHbWOqCp2mz9gCA==
39
+ -----END CERTIFICATE-----
40
+
41
+ date: 2013-04-05 00:00:00 Z
42
+ dependencies:
43
+ - !ruby/object:Gem::Dependency
44
+ name: rdoc
45
+ prerelease: false
46
+ requirement: &id001 !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ~>
50
+ - !ruby/object:Gem::Version
51
+ hash: 19
52
+ segments:
53
+ - 3
54
+ - 10
55
+ version: "3.10"
56
+ type: :development
57
+ version_requirements: *id001
58
+ - !ruby/object:Gem::Dependency
59
+ name: yard
60
+ prerelease: false
61
+ requirement: &id002 !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ hash: 7
67
+ segments:
68
+ - 0
69
+ - 6
70
+ version: "0.6"
71
+ type: :development
72
+ version_requirements: *id002
73
+ - !ruby/object:Gem::Dependency
74
+ name: rake-compiler
75
+ prerelease: false
76
+ requirement: &id003 !ruby/object:Gem::Requirement
77
+ none: false
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ hash: 5
82
+ segments:
83
+ - 0
84
+ - 7
85
+ version: "0.7"
86
+ type: :development
87
+ version_requirements: *id003
88
+ - !ruby/object:Gem::Dependency
89
+ name: hoe
90
+ prerelease: false
91
+ requirement: &id004 !ruby/object:Gem::Requirement
92
+ none: false
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ hash: 7
97
+ segments:
98
+ - 3
99
+ - 0
100
+ version: "3.0"
101
+ type: :development
102
+ version_requirements: *id004
103
+ description: "This module allows Ruby programs to interface with \"RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki)\"."
104
+ email:
105
+ - ryosuke@deer-n-horse.jp
106
+ - gotoyuzo@notwork.org
107
+ - kanis@comcard.de
108
+ executables: []
109
+
110
+ extensions: []
111
+
112
+ extra_rdoc_files:
113
+ - History.txt
114
+ - Manifest.txt
115
+ - README.rdoc
116
+ - pkcs11_protect_server/Manifest.txt
117
+ - pkcs11_protect_server/README_PROTECT_SERVER.rdoc
118
+ - ext/pk11.c
119
+ files:
120
+ - .autotest
121
+ - .gemtest
122
+ - .yardopts
123
+ - History.txt
124
+ - MIT-LICENSE
125
+ - Manifest.txt
126
+ - README.rdoc
127
+ - Rakefile
128
+ - ext/extconf.rb
129
+ - ext/generate_constants.rb
130
+ - ext/generate_structs.rb
131
+ - ext/generate_thread_funcs.rb
132
+ - ext/include/cryptoki.h
133
+ - ext/include/ct-kip.h
134
+ - ext/include/otp-pkcs11.h
135
+ - ext/include/pkcs-11v2-20a3.h
136
+ - ext/include/pkcs11.h
137
+ - ext/include/pkcs11f.h
138
+ - ext/include/pkcs11t.h
139
+ - ext/pk11.c
140
+ - ext/pk11.h
141
+ - ext/pk11_const.c
142
+ - ext/pk11_const_macros.h
143
+ - ext/pk11_struct_macros.h
144
+ - ext/pk11_version.h
145
+ - lib/pkcs11.rb
146
+ - lib/pkcs11/extensions.rb
147
+ - lib/pkcs11/helper.rb
148
+ - lib/pkcs11/library.rb
149
+ - lib/pkcs11/object.rb
150
+ - lib/pkcs11/session.rb
151
+ - lib/pkcs11/slot.rb
152
+ - test/fixtures/softokn/cert8.db
153
+ - test/fixtures/softokn/key3.db
154
+ - test/fixtures/softokn/secmod.db
155
+ - test/helper.rb
156
+ - test/test_pkcs11.rb
157
+ - test/test_pkcs11_crypt.rb
158
+ - test/test_pkcs11_object.rb
159
+ - test/test_pkcs11_session.rb
160
+ - test/test_pkcs11_slot.rb
161
+ - test/test_pkcs11_structs.rb
162
+ - test/test_pkcs11_thread.rb
163
+ - ext/pk11_struct_impl.inc
164
+ - ext/pk11_struct_def.inc
165
+ - ext/pk11_const_def.inc
166
+ - ext/pk11_struct.doc
167
+ - ext/pk11_thread_funcs.h
168
+ - ext/pk11_thread_funcs.c
169
+ - pkcs11_protect_server/Manifest.txt
170
+ - pkcs11_protect_server/README_PROTECT_SERVER.rdoc
171
+ - lib/2.0/pkcs11_ext.so
172
+ homepage: http://github.com/larskanis/pkcs11
173
+ licenses: []
174
+
175
+ post_install_message:
176
+ rdoc_options:
177
+ - --main
178
+ - README.rdoc
179
+ require_paths:
180
+ - lib
181
+ required_ruby_version: !ruby/object:Gem::Requirement
182
+ none: false
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ hash: 3
187
+ segments:
188
+ - 0
189
+ version: "0"
190
+ required_rubygems_version: !ruby/object:Gem::Requirement
191
+ none: false
192
+ requirements:
193
+ - - ">="
194
+ - !ruby/object:Gem::Version
195
+ hash: 3
196
+ segments:
197
+ - 0
198
+ version: "0"
199
+ requirements: []
200
+
201
+ rubyforge_project: pkcs11
202
+ rubygems_version: 1.8.17
203
+ signing_key:
204
+ specification_version: 3
205
+ summary: PKCS#11 binding for Ruby
206
+ test_files:
207
+ - test/test_pkcs11_object.rb
208
+ - test/test_pkcs11_thread.rb
209
+ - test/test_pkcs11.rb
210
+ - test/test_pkcs11_slot.rb
211
+ - test/test_pkcs11_session.rb
212
+ - test/test_pkcs11_structs.rb
213
+ - test/test_pkcs11_crypt.rb
Binary file