netpgp 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,25 @@
1
+ require_relative 'libopenssl'
2
+ require_relative 'libc'
3
+
4
+ module LibNetPGP
5
+
6
+ # BIGNUM* to hexadecimal string
7
+ def self.bn2hex(bn)
8
+ str, ptr = LibOpenSSL::BN_bn2hex(bn)
9
+ LibC::free(ptr)
10
+ str
11
+ end
12
+
13
+ # Ruby Fixnum to BIGNUM*
14
+ def self.num2bn(num)
15
+ bn_ptr = FFI::MemoryPointer.new(:pointer)
16
+ hex = num.to_s(16)
17
+ ret = LibOpenSSL::BN_hex2bn(bn_ptr, hex)
18
+ raise 'Fixnum to BIGNUM conversion failed' if ret == 0
19
+ bn = bn_ptr.get_pointer(0)
20
+ bn_ptr.free
21
+ bn
22
+ end
23
+
24
+ end
25
+
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: netpgp
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ribose Inc.
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-07-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ffi
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 3.5.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 3.5.0
41
+ description: Uses ruby-ffi to support PGP/GnuPG functionality. Requires libnetpgp.so.
42
+ email:
43
+ - open.source@ribose.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - lib/netpgp.rb
49
+ - lib/netpgp/highlevel.rb
50
+ - lib/netpgp/highlevel/constants.rb
51
+ - lib/netpgp/highlevel/keyring.rb
52
+ - lib/netpgp/highlevel/publickey.rb
53
+ - lib/netpgp/highlevel/secretkey.rb
54
+ - lib/netpgp/highlevel/utils.rb
55
+ - lib/netpgp/lowlevel.rb
56
+ - lib/netpgp/lowlevel/constants.rb
57
+ - lib/netpgp/lowlevel/dynarray.rb
58
+ - lib/netpgp/lowlevel/enums.rb
59
+ - lib/netpgp/lowlevel/libc.rb
60
+ - lib/netpgp/lowlevel/libnetpgp.rb
61
+ - lib/netpgp/lowlevel/libopenssl.rb
62
+ - lib/netpgp/lowlevel/structs.rb
63
+ - lib/netpgp/lowlevel/utils.rb
64
+ homepage:
65
+ licenses:
66
+ - MIT
67
+ metadata: {}
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project:
84
+ rubygems_version: 2.5.2
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: An interface to libnetpgp.so
88
+ test_files: []