pkcs11 0.2.5-x86-mingw32 → 0.2.6-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Binary file
Binary file
Binary file
Binary file
Binary file
data/lib/pkcs11/helper.rb CHANGED
@@ -53,7 +53,8 @@ module PKCS11
53
53
  CKM_SSL3_KEY_AND_MAC_DERIVE => CK_SSL3_KEY_MAT_OUT,
54
54
  CKM_SSL3_KEY_AND_MAC_DERIVE => CK_SSL3_KEY_MAT_PARAMS,
55
55
  CKM_TLS_MASTER_KEY_DERIVE => CK_SSL3_MASTER_KEY_DERIVE_PARAMS,
56
- CKM_TLS_PRF => CK_TLS_PRF_PARAMS,
56
+ CKM_TLS_MAC => CK_TLS_MAC_PARAMS,
57
+ CKM_TLS_KDF => CK_TLS_KDF_PARAMS,
57
58
  CKM_WTLS_MASTER_KEY_DERIVE => CK_WTLS_RANDOM_DATA,
58
59
  CKM_WTLS_MASTER_KEY_DERIVE => CK_WTLS_MASTER_KEY_DERIVE_PARAMS,
59
60
  CKM_WTLS_PRF => CK_WTLS_PRF_PARAMS,
@@ -0,0 +1,24 @@
1
+ .gemtest
2
+ .yardopts
3
+ Manifest.txt
4
+ README_LUNA.rdoc
5
+ Rakefile
6
+ ext/extconf.rb
7
+ ext/generate_constants.rb
8
+ ext/generate_structs.rb
9
+ ext/pk11l.c
10
+ lib/pkcs11_luna.rb
11
+ lib/pkcs11_luna/extensions.rb
12
+ test/luna_helper.rb
13
+ test/app_id_helper.rb
14
+ test/test_pkcs11_luna.rb
15
+ test/test_pkcs11_luna_crypt.rb
16
+ examples/config.rb
17
+ examples/derive_aes_ecdh_key.rb
18
+ examples/sign_verify.rb
19
+ examples/encrypt_decrypt_aes.rb
20
+ examples/encrypt_decrypt_rsa.rb
21
+ examples/mechanism_list.rb
22
+ examples/multithread.rb
23
+ examples/objects_list.rb
24
+ examples/slot_info.rb
@@ -0,0 +1,103 @@
1
+ = PKCS #11/Ruby Interface for Safenet Luna HSM
2
+
3
+ * Homepage: http://github.com/larskanis/pkcs11
4
+ * API documentation: http://pkcs11.rubyforge.org/pkcs11/
5
+ * Safenet[http://www.safenet-inc.com] - Luna HSM
6
+
7
+ This ruby gem is an add-on to ruby-pkcs11[http://github.com/larskanis/pkcs11] .
8
+ It allows to use Luna specific extensions, which are beyond the PKCS#11 standard.
9
+ The module works on the Unix like operating systems and win32.
10
+
11
+ == Requirements
12
+
13
+ * Luna Client installed including the Luna Sofware Development Kit (SDK)
14
+ * pkcs11 gem installed (use: <tt>gem install pkcs11</tt> )
15
+
16
+ == Installation
17
+
18
+ First check the permissions for the directories in the sdk. It may be required to run:
19
+ chmod a+x <luna client include dir>
20
+ chmod a+x <luna client include dir>/RSA
21
+
22
+ gem install pkcs11_luna -- --with-luna-dir-include=<luna client include dir>
23
+
24
+ This installs the Luna-PKCS#11 extension either by compiling (Unix)
25
+ or by using the precompiled gem for Win32.
26
+
27
+ git clone git://github.com/larskanis/pkcs11.git
28
+ cd pkcs11_luna
29
+ gem install hoe rake-compiler minitest
30
+ rake gem LUNA_INCLUDE_DIR=<luna client include dir>
31
+ gem install --verbose pkg/pkcs11_luna-<version>.gem -- --with-luna-dir-include=<luna client include dir>
32
+
33
+ rake test
34
+ cd ../
35
+ rake test
36
+
37
+ Downloads and installs the gem from git source. If LUNA_INCLUDE_DIR and --with-luna-dir-include are not specified,
38
+ The default of /usr/safenet/lunaclient/samples/include is used.
39
+
40
+
41
+ == Usage
42
+
43
+ Open the software emulation library and login to a session:
44
+
45
+ require "rubygems"
46
+ require "pkcs11_luna"
47
+
48
+ pkcs11 = PKCS11::Luna::Library.new
49
+ p pkcs11.info
50
+ session = pkcs11.active_slots.last.open
51
+ session.login(:USER, "1234")
52
+ # ... crypto operations
53
+ session.logout
54
+ session.close
55
+
56
+ Look in the examples directories for some more usage examples.
57
+
58
+ {PKCS11::Luna::Library#initialize} reads the crystoki.ini or /etc/Chrystoki.conf
59
+ and parses the configuration file to determine what .so or .dll to use. You may pass
60
+ the full path to the .dll or .so file.
61
+
62
+ == Cross compiling for mswin32
63
+
64
+ Using rake-compiler a cross compiled pkcs11_luna.gem can be build on a linux host for
65
+ the win32 platform. There are no runtime dependencies to any but the standard Windows DLLs.
66
+
67
+ Install mingw32. On a debian based system this should work:
68
+
69
+ apt-get install mingw32
70
+
71
+ On MacOS X, if you have MacPorts installed:
72
+
73
+ port install i386-mingw32-gcc
74
+
75
+ Install the rake-compiler:
76
+
77
+ gem install rake-compiler
78
+
79
+ Download and cross compile ruby for win32:
80
+
81
+ rake-compiler cross-ruby VERSION=1.8.7-p352
82
+ rake-compiler cross-ruby VERSION=1.9.2-p290
83
+
84
+ Download and cross compile pkcs11_luna for win32:
85
+
86
+ rake cross native gem LUNA_CLIENT_DIR=<luna client dir>
87
+
88
+ If everything works, there should be pkcs11_luna-VERSION-x86-mswin32.gem in the pkg
89
+ directory.
90
+
91
+
92
+ == ToDo
93
+
94
+ * implement Luna specific function calls
95
+ * implement possibility to use callbacks
96
+ * add all structs and constants
97
+
98
+ == Authors
99
+ * Lars Kanis <kanis@comcard.de>
100
+ * Jonathan Patchell
101
+
102
+ == Copying
103
+ See MIT-LICENSE included in the package.
data/test/helper.rb CHANGED
@@ -54,7 +54,13 @@ def softokn_params_string
54
54
  end
55
55
 
56
56
  def open_softokn(so_path=nil)
57
- PKCS11.open(so_path || find_softokn, :flags=>0, :pReserved=>softokn_params_string)
57
+ so = so_path || find_softokn
58
+ if $first_open
59
+ $stderr.puts "Using #{so} with params #{softokn_params_string.inspect}"
60
+ $first_open = false
61
+ end
62
+ PKCS11.open(so, :flags=>0, :pReserved=>softokn_params_string)
58
63
  end
59
64
 
60
65
  $pkcs11 = nil
66
+ $first_open = true
@@ -30,7 +30,6 @@ class TestPkcs11Thread < Minitest::Test
30
30
  th = Thread.new{
31
31
  loop do
32
32
  count += 1
33
- sleep 0.01
34
33
  end
35
34
  }
36
35
  # This should take some seconds:
@@ -38,7 +37,7 @@ class TestPkcs11Thread < Minitest::Test
38
37
  {:MODULUS_BITS=>2048, :PUBLIC_EXPONENT=>[3].pack("N"), :TOKEN=>false},
39
38
  {})
40
39
  th.kill
41
- assert_operator count, :>, 10, "The second thread should count further concurrent to the key generation"
40
+ assert_operator count, :>, 100000, "The second thread should count further concurrent to the key generation"
42
41
  end
43
42
 
44
43
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pkcs11
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Ryosuke Kutsuna
@@ -9,86 +9,107 @@ authors:
9
9
  - Lars Kanis
10
10
  autorequire:
11
11
  bindir: bin
12
- cert_chain:
13
- - |
14
- -----BEGIN CERTIFICATE-----
15
- MIIDLjCCAhagAwIBAgIBAjANBgkqhkiG9w0BAQUFADA9MQ4wDAYDVQQDDAVrYW5p
16
- czEXMBUGCgmSJomT8ixkARkWB2NvbWNhcmQxEjAQBgoJkiaJk/IsZAEZFgJkZTAe
17
- Fw0xNDAyMjYwOTMzMDBaFw0xNTAyMjYwOTMzMDBaMD0xDjAMBgNVBAMMBWthbmlz
18
- MRcwFQYKCZImiZPyLGQBGRYHY29tY2FyZDESMBAGCgmSJomT8ixkARkWAmRlMIIB
19
- IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApop+rNmg35bzRugZ21VMGqI6
20
- HGzPLO4VHYncWn/xmgPU/ZMcZdfj6MzIaZJ/czXyt4eHpBk1r8QOV3gBXnRXEjVW
21
- 9xi+EdVOkTV2/AVFKThcbTAQGiF/bT1n2M+B1GTybRzMg6hyhOJeGPqIhLfJEpxn
22
- lJi4+ENAVT4MpqHEAGB8yFoPC0GqiOHQsdHxQV3P3c2OZqG+yJey74QtwA2tLcLn
23
- Q53c63+VLGsOjODl1yPn/2ejyq8qWu6ahfTxiIlSar2UbwtaQGBDFdb2CXgEufXT
24
- L7oaPxlmj+Q2oLOfOnInd2Oxop59HoJCQPsg8f921J43NCQGA8VHK6paxIRDLQID
25
- AQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQUvgTdT7fe
26
- x17ugO3IOsjEJwW7KP4wDQYJKoZIhvcNAQEFBQADggEBAFmIAhRT0awqLQN9e4Uv
27
- ZEk+jUWv4zkb+TWiKFJXlwjPyjGbZY9gVfOwAwMibYOK/t/+57ZzW3d0L12OUwvo
28
- on84NVvYtIr1/iskJFWFkMoIquAFCdi9p68stSPMQK2XcrJJuRot29fJtropsZBa
29
- 2cpaNd/sRYdK4oep2usdKifA1lI0hIkPb3r5nLfwG2lAqBH7WZsUICHcTgR0VEbG
30
- z9Ug5qQp9Uz73xC9YdGvGiuOX53LYobHAR4MWi2xxDlHI+ER8mRz0eY2FUuNu/Wj
31
- GrqF74zpLl7/KFdHC8VmzwZS18hvDjxeLVuVI2gIGnBInqnlqv05g/l4/1pISh5j
32
- dS4=
33
- -----END CERTIFICATE-----
34
- date: 2015-01-26 00:00:00.000000000 Z
12
+ cert_chain: []
13
+ date: 2017-06-07 00:00:00.000000000 Z
35
14
  dependencies:
36
15
  - !ruby/object:Gem::Dependency
37
- name: rdoc
16
+ name: yard
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: '0.6'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '0.6'
29
+ - !ruby/object:Gem::Dependency
30
+ name: rake-compiler
38
31
  requirement: !ruby/object:Gem::Requirement
39
32
  requirements:
40
33
  - - "~>"
41
34
  - !ruby/object:Gem::Version
42
- version: '4.0'
35
+ version: '1.0'
43
36
  type: :development
44
37
  prerelease: false
45
38
  version_requirements: !ruby/object:Gem::Requirement
46
39
  requirements:
47
40
  - - "~>"
48
41
  - !ruby/object:Gem::Version
49
- version: '4.0'
42
+ version: '1.0'
50
43
  - !ruby/object:Gem::Dependency
51
- name: yard
44
+ name: rake-compiler-dock
52
45
  requirement: !ruby/object:Gem::Requirement
53
46
  requirements:
54
- - - ">="
47
+ - - "~>"
55
48
  - !ruby/object:Gem::Version
56
- version: '0.6'
49
+ version: 0.6.0
57
50
  type: :development
58
51
  prerelease: false
59
52
  version_requirements: !ruby/object:Gem::Requirement
60
53
  requirements:
61
- - - ">="
54
+ - - "~>"
62
55
  - !ruby/object:Gem::Version
63
- version: '0.6'
56
+ version: 0.6.0
64
57
  - !ruby/object:Gem::Dependency
65
- name: rake-compiler
58
+ name: minitest
66
59
  requirement: !ruby/object:Gem::Requirement
67
60
  requirements:
68
- - - ">="
61
+ - - "~>"
69
62
  - !ruby/object:Gem::Version
70
- version: '0.7'
63
+ version: '5.7'
71
64
  type: :development
72
65
  prerelease: false
73
66
  version_requirements: !ruby/object:Gem::Requirement
74
67
  requirements:
75
- - - ">="
68
+ - - "~>"
69
+ - !ruby/object:Gem::Version
70
+ version: '5.7'
71
+ - !ruby/object:Gem::Dependency
72
+ name: hoe-bundler
73
+ requirement: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - "~>"
76
+ - !ruby/object:Gem::Version
77
+ version: '1.0'
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - "~>"
83
+ - !ruby/object:Gem::Version
84
+ version: '1.0'
85
+ - !ruby/object:Gem::Dependency
86
+ name: rdoc
87
+ requirement: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - "~>"
90
+ - !ruby/object:Gem::Version
91
+ version: '4.0'
92
+ type: :development
93
+ prerelease: false
94
+ version_requirements: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - "~>"
76
97
  - !ruby/object:Gem::Version
77
- version: '0.7'
98
+ version: '4.0'
78
99
  - !ruby/object:Gem::Dependency
79
100
  name: hoe
80
101
  requirement: !ruby/object:Gem::Requirement
81
102
  requirements:
82
103
  - - "~>"
83
104
  - !ruby/object:Gem::Version
84
- version: '3.13'
105
+ version: '3.16'
85
106
  type: :development
86
107
  prerelease: false
87
108
  version_requirements: !ruby/object:Gem::Requirement
88
109
  requirements:
89
110
  - - "~>"
90
111
  - !ruby/object:Gem::Version
91
- version: '3.13'
112
+ version: '3.16'
92
113
  description: 'This module allows Ruby programs to interface with "RSA Security Inc.
93
114
  PKCS #11 Cryptographic Token Interface (Cryptoki)".'
94
115
  email:
@@ -99,20 +120,23 @@ executables: []
99
120
  extensions: []
100
121
  extra_rdoc_files:
101
122
  - History.txt
102
- - Manifest.txt
103
123
  - README.rdoc
124
+ - pkcs11_luna/Manifest.txt
125
+ - pkcs11_luna/README_LUNA.rdoc
104
126
  - pkcs11_protect_server/Manifest.txt
105
127
  - pkcs11_protect_server/README_PROTECT_SERVER.rdoc
106
128
  - ext/pk11.c
107
129
  files:
108
130
  - ".autotest"
109
131
  - ".gemtest"
132
+ - ".travis.yml"
110
133
  - ".yardopts"
134
+ - Gemfile
111
135
  - History.txt
112
136
  - MIT-LICENSE
113
- - Manifest.txt
114
137
  - README.rdoc
115
138
  - Rakefile
139
+ - appveyor.yml
116
140
  - ext/extconf.rb
117
141
  - ext/generate_constants.rb
118
142
  - ext/generate_structs.rb
@@ -136,10 +160,11 @@ files:
136
160
  - ext/pk11_thread_funcs.c
137
161
  - ext/pk11_thread_funcs.h
138
162
  - ext/pk11_version.h
139
- - lib/1.9/pkcs11_ext.so
140
163
  - lib/2.0/pkcs11_ext.so
141
164
  - lib/2.1/pkcs11_ext.so
142
165
  - lib/2.2/pkcs11_ext.so
166
+ - lib/2.3/pkcs11_ext.so
167
+ - lib/2.4/pkcs11_ext.so
143
168
  - lib/pkcs11.rb
144
169
  - lib/pkcs11/extensions.rb
145
170
  - lib/pkcs11/helper.rb
@@ -147,6 +172,8 @@ files:
147
172
  - lib/pkcs11/object.rb
148
173
  - lib/pkcs11/session.rb
149
174
  - lib/pkcs11/slot.rb
175
+ - pkcs11_luna/Manifest.txt
176
+ - pkcs11_luna/README_LUNA.rdoc
150
177
  - pkcs11_protect_server/Manifest.txt
151
178
  - pkcs11_protect_server/README_PROTECT_SERVER.rdoc
152
179
  - test/fixtures/softokn/cert8.db
@@ -174,7 +201,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
174
201
  requirements:
175
202
  - - ">="
176
203
  - !ruby/object:Gem::Version
177
- version: '0'
204
+ version: '2.0'
205
+ - - "<"
206
+ - !ruby/object:Gem::Version
207
+ version: '2.5'
178
208
  required_rubygems_version: !ruby/object:Gem::Requirement
179
209
  requirements:
180
210
  - - ">="
@@ -182,15 +212,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
212
  version: '0'
183
213
  requirements: []
184
214
  rubyforge_project:
185
- rubygems_version: 2.4.5
215
+ rubygems_version: 2.6.12
186
216
  signing_key:
187
217
  specification_version: 4
188
218
  summary: PKCS#11 binding for Ruby
189
- test_files:
190
- - test/test_pkcs11_crypt.rb
191
- - test/test_pkcs11_structs.rb
192
- - test/test_pkcs11_object.rb
193
- - test/test_pkcs11_thread.rb
194
- - test/test_pkcs11_session.rb
195
- - test/test_pkcs11_slot.rb
196
- - test/test_pkcs11.rb
219
+ test_files: []
checksums.yaml.gz.sig DELETED
@@ -1 +0,0 @@
1
- & ��r�����hZ
2
- 7>�Uc��Κ����������HO��0�t�瓨��p��==�26��Ӧ�#ge�O�M��y�����W6������G?a7ѐ�Q����9]��/����ԁ�t�ň�?�ؼpC�q��'�qg�y��yǁ.��2�Ƹ�����;�f��P�#��؉KEWd��a�j�r�I܂�9����b3|��v�Җ��T��`�F�b�ӕ���`��v$��v��n�����nZa~�K2U<
data.tar.gz.sig DELETED
@@ -1 +0,0 @@
1
- �Zz��ҙ^;jJhv��ކ��9&p$5�F��5V�.o�H��Re�d�X�>��K����U'�?�a{� ���u�2 �n$/]��� �9 �ʑ,����z�]�d���; >AA�$';t�G�=���NC&F�����*�� =�lz�S�B,cvK��-7��#17e6VU��F>��F�����#� VC��5�d C!���<v�!YvXT���m2�c�oy� ��%�� s��YEXўK�
data/Manifest.txt DELETED
@@ -1,57 +0,0 @@
1
- .autotest
2
- .gemtest
3
- .yardopts
4
- History.txt
5
- MIT-LICENSE
6
- Manifest.txt
7
- README.rdoc
8
- Rakefile
9
- ext/extconf.rb
10
- ext/generate_constants.rb
11
- ext/generate_structs.rb
12
- ext/generate_thread_funcs.rb
13
- ext/include/cryptoki.h
14
- ext/include/ct-kip.h
15
- ext/include/otp-pkcs11.h
16
- ext/include/pkcs-11v2-20a3.h
17
- ext/include/pkcs11.h
18
- ext/include/pkcs11f.h
19
- ext/include/pkcs11t.h
20
- ext/pk11.c
21
- ext/pk11.h
22
- ext/pk11_const.c
23
- ext/pk11_const_macros.h
24
- ext/pk11_struct_macros.h
25
- ext/pk11_version.h
26
- lib/pkcs11.rb
27
- lib/pkcs11/extensions.rb
28
- lib/pkcs11/helper.rb
29
- lib/pkcs11/library.rb
30
- lib/pkcs11/object.rb
31
- lib/pkcs11/session.rb
32
- lib/pkcs11/slot.rb
33
- pkcs11_protect_server/.gemtest
34
- pkcs11_protect_server/.yardopts
35
- pkcs11_protect_server/Manifest.txt
36
- pkcs11_protect_server/README_PROTECT_SERVER.rdoc
37
- pkcs11_protect_server/Rakefile
38
- pkcs11_protect_server/ext/extconf.rb
39
- pkcs11_protect_server/ext/generate_constants.rb
40
- pkcs11_protect_server/ext/generate_structs.rb
41
- pkcs11_protect_server/ext/pk11s.c
42
- pkcs11_protect_server/lib/pkcs11_protect_server.rb
43
- pkcs11_protect_server/lib/pkcs11_protect_server/extensions.rb
44
- pkcs11_protect_server/test/helper.rb
45
- pkcs11_protect_server/test/test_pkcs11_protect_server.rb
46
- pkcs11_protect_server/test/test_pkcs11_protect_server_crypt.rb
47
- test/fixtures/softokn/cert8.db
48
- test/fixtures/softokn/key3.db
49
- test/fixtures/softokn/secmod.db
50
- test/helper.rb
51
- test/test_pkcs11.rb
52
- test/test_pkcs11_crypt.rb
53
- test/test_pkcs11_object.rb
54
- test/test_pkcs11_session.rb
55
- test/test_pkcs11_slot.rb
56
- test/test_pkcs11_structs.rb
57
- test/test_pkcs11_thread.rb