cryptopro 0.0.1 → 0.0.2
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.
File without changes
|
@@ -15,5 +15,5 @@ h1. Использование
|
|
15
15
|
|
16
16
|
Cryptopro::Signature.verify(:message => "message", :signature => "signature", :certificate => "certificate")
|
17
17
|
|
18
|
-
Copyright (c) 2011 divineforest, evrone
|
18
|
+
Copyright (c) 2011 divineforest, evrone.com
|
19
19
|
This project rocks and uses MIT-LICENSE.
|
data/cryptopro.gemspec
CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["divineforest"]
|
10
10
|
# s.email = ["TODO: Write your email address"]
|
11
|
-
s.homepage = ""
|
11
|
+
s.homepage = "http://github.com/divineforest/cryptopro"
|
12
12
|
s.summary = %q{CryptoPro ruby-wrapper for linux}
|
13
13
|
# s.description = %q{TODO: Write a gem description}
|
14
14
|
|
data/lib/cryptopro/signature.rb
CHANGED
@@ -13,9 +13,9 @@ module Cryptopro
|
|
13
13
|
|
14
14
|
# Options: message, signature, certificate
|
15
15
|
def self.verify(options)
|
16
|
-
raise "Message required" if (options[:message].nil? || options[:message]
|
17
|
-
raise "Signature required" if (options[:signature].nil? || options[:signature]
|
18
|
-
raise "Certificate required" if (options[:certificate].nil? || options[:certificate]
|
16
|
+
raise "Message required" if (options[:message].nil? || options[:message].empty?)
|
17
|
+
raise "Signature required" if (options[:signature].nil? || options[:signature].empty?)
|
18
|
+
raise "Certificate required" if (options[:certificate].nil? || options[:certificate].empty?)
|
19
19
|
|
20
20
|
tmp_dir = create_temp_dir
|
21
21
|
create_temp_files(tmp_dir, options)
|
@@ -51,7 +51,7 @@ module Cryptopro
|
|
51
51
|
# cryptcp -vsignf -dir /home/user/signs -f certificate.cer message.txt
|
52
52
|
# /home/user/signs -- папка с подписью, имя которой соответствуют имени сообщения, но с расширением .sgn
|
53
53
|
def self.execute(dir)
|
54
|
-
|
54
|
+
Cocaine::CommandLine.path = ["/opt/cprocsp/bin/amd64", "/opt/cprocsp/bin/ia32"]
|
55
55
|
line = Cocaine::CommandLine.new("cryptcp", "-vsignf -dir :signatures_dir -f :certificate -nochain :message",
|
56
56
|
:signatures_dir => dir,
|
57
57
|
:certificate => "#{dir}/#{CERTIFICATE_FILE_NAME}",
|
@@ -63,7 +63,7 @@ module Cryptopro
|
|
63
63
|
rescue Cocaine::ExitStatusError
|
64
64
|
false
|
65
65
|
rescue Cocaine::CommandNotFoundError => e
|
66
|
-
raise "
|
66
|
+
raise "Command cryptcp was not found"
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
data/lib/cryptopro/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cryptopro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- divineforest
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-11-02 00:00:00 +03:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -43,15 +43,15 @@ extra_rdoc_files: []
|
|
43
43
|
files:
|
44
44
|
- .gitignore
|
45
45
|
- Gemfile
|
46
|
+
- MIT-LICENSE
|
47
|
+
- README.textile
|
46
48
|
- Rakefile
|
47
49
|
- cryptopro.gemspec
|
48
50
|
- lib/cryptopro.rb
|
49
|
-
- lib/cryptopro/MIT-LICENSE
|
50
|
-
- lib/cryptopro/README.textile
|
51
51
|
- lib/cryptopro/signature.rb
|
52
52
|
- lib/cryptopro/version.rb
|
53
53
|
has_rdoc: true
|
54
|
-
homepage:
|
54
|
+
homepage: http://github.com/divineforest/cryptopro
|
55
55
|
licenses: []
|
56
56
|
|
57
57
|
post_install_message:
|