gpgme 1.0.8 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/examples/genkey.rb +1 -1
  2. data/examples/keylist.rb +2 -1
  3. data/examples/roundtrip.rb +7 -4
  4. data/examples/sign.rb +5 -3
  5. data/examples/verify.rb +4 -2
  6. data/ext/gpgme/extconf.rb +58 -0
  7. data/ext/gpgme/gpgme-1.3.1.tar.bz2 +0 -0
  8. data/{gpgme_n.c → ext/gpgme/gpgme_n.c} +8 -8
  9. data/ext/gpgme/libassuan-2.0.2.tar.bz2 +0 -0
  10. data/ext/gpgme/libgpg-error-1.10.tar.bz2 +0 -0
  11. data/lib/gpgme.rb +88 -1541
  12. data/lib/gpgme/compat.rb +2 -0
  13. data/lib/gpgme/constants.rb +23 -0
  14. data/lib/gpgme/crypto.rb +357 -0
  15. data/lib/gpgme/ctx.rb +462 -0
  16. data/lib/gpgme/data.rb +177 -0
  17. data/lib/gpgme/engine.rb +76 -0
  18. data/lib/gpgme/error.rb +66 -0
  19. data/lib/gpgme/io_callbacks.rb +21 -0
  20. data/lib/gpgme/key.rb +242 -0
  21. data/lib/gpgme/key_common.rb +43 -0
  22. data/lib/gpgme/key_sig.rb +35 -0
  23. data/lib/gpgme/misc.rb +66 -0
  24. data/lib/gpgme/signature.rb +85 -0
  25. data/lib/gpgme/sub_key.rb +58 -0
  26. data/lib/gpgme/user_id.rb +20 -0
  27. data/lib/gpgme/version.rb +3 -0
  28. data/test/crypto_test.rb +242 -0
  29. data/test/ctx_test.rb +426 -0
  30. data/test/data_test.rb +116 -0
  31. data/test/files/testkey_pub.gpg +52 -0
  32. data/test/files/testkey_sec.gpg +54 -0
  33. data/test/gpgme_test.rb +12 -0
  34. data/test/key_test.rb +201 -0
  35. data/test/signature_test.rb +48 -0
  36. data/test/sub_key_test.rb +45 -0
  37. data/test/support/resources.rb +516 -0
  38. data/test/test_helper.rb +83 -0
  39. metadata +144 -65
  40. data.tar.gz.sig +0 -3
  41. data/COPYING +0 -340
  42. data/COPYING.LESSER +0 -510
  43. data/Makefile +0 -172
  44. data/Manifest.txt +0 -18
  45. data/README +0 -86
  46. data/Rakefile +0 -17
  47. data/THANKS +0 -15
  48. data/extconf.rb +0 -26
  49. metadata.gz.sig +0 -0
data/Makefile DELETED
@@ -1,172 +0,0 @@
1
-
2
- SHELL = /bin/sh
3
-
4
- #### Start of system configuration section. ####
5
-
6
- srcdir = .
7
- topdir = /usr/lib/ruby/1.8/x86_64-linux
8
- hdrdir = $(topdir)
9
- VPATH = $(srcdir):$(topdir):$(hdrdir)
10
- exec_prefix = $(prefix)
11
- prefix = $(DESTDIR)/usr
12
- sharedstatedir = $(prefix)/com
13
- mandir = $(prefix)/share/man
14
- psdir = $(docdir)
15
- oldincludedir = $(DESTDIR)/usr/include
16
- localedir = $(datarootdir)/locale
17
- bindir = $(exec_prefix)/bin
18
- libexecdir = $(prefix)/lib/ruby1.8
19
- sitedir = $(DESTDIR)/usr/local/lib/site_ruby
20
- htmldir = $(docdir)
21
- vendorarchdir = $(vendorlibdir)/$(sitearch)
22
- includedir = $(prefix)/include
23
- infodir = $(prefix)/share/info
24
- vendorlibdir = $(vendordir)/$(ruby_version)
25
- sysconfdir = $(DESTDIR)/etc
26
- libdir = $(exec_prefix)/lib
27
- sbindir = $(exec_prefix)/sbin
28
- rubylibdir = $(libdir)/ruby/$(ruby_version)
29
- docdir = $(datarootdir)/doc/$(PACKAGE)
30
- dvidir = $(docdir)
31
- vendordir = $(libdir)/ruby/vendor_ruby
32
- datarootdir = $(prefix)/share
33
- pdfdir = $(docdir)
34
- archdir = $(rubylibdir)/$(arch)
35
- sitearchdir = $(sitelibdir)/$(sitearch)
36
- datadir = $(datarootdir)
37
- localstatedir = $(DESTDIR)/var
38
- sitelibdir = $(sitedir)/$(ruby_version)
39
-
40
- CC = cc
41
- LIBRUBY = $(LIBRUBY_SO)
42
- LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
43
- LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
44
- LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
45
-
46
- RUBY_EXTCONF_H =
47
- CFLAGS = -fPIC -fno-strict-aliasing -g -g -O2 -fPIC $(cflags)
48
- INCFLAGS = -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I.
49
- DEFS =
50
- CPPFLAGS = -DHAVE_GPGME_OP_EXPORT_KEYS
51
- CXXFLAGS = $(CFLAGS)
52
- ldflags = -L. -rdynamic -Wl,-export-dynamic
53
- dldflags =
54
- archflag =
55
- DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
56
- LDSHARED = $(CC) -shared
57
- AR = ar
58
- EXEEXT =
59
-
60
- RUBY_INSTALL_NAME = ruby1.8
61
- RUBY_SO_NAME = ruby1.8
62
- arch = x86_64-linux
63
- sitearch = x86_64-linux
64
- ruby_version = 1.8
65
- ruby = /usr/bin/ruby1.8
66
- RUBY = $(ruby)
67
- RM = rm -f
68
- MAKEDIRS = mkdir -p
69
- INSTALL = /usr/bin/install -c
70
- INSTALL_PROG = $(INSTALL) -m 0755
71
- INSTALL_DATA = $(INSTALL) -m 644
72
- COPY = cp
73
-
74
- #### End of system configuration section. ####
75
-
76
- preload =
77
-
78
- libpath = . $(libdir)
79
- LIBPATH = -L. -L$(libdir)
80
- DEFFILE =
81
-
82
- CLEANFILES = mkmf.log
83
- DISTCLEANFILES =
84
-
85
- extout =
86
- extout_prefix =
87
- target_prefix =
88
- LOCAL_LIBS =
89
- LIBS = $(LIBRUBYARG_SHARED) -lgpgme -lgpg-error -lpthread -lrt -ldl -lcrypt -lm -lc
90
- SRCS = gpgme_n.c
91
- OBJS = gpgme_n.o
92
- TARGET = gpgme_n
93
- DLLIB = $(TARGET).so
94
- EXTSTATIC =
95
- STATIC_LIB =
96
-
97
- BINDIR = $(bindir)
98
- RUBYCOMMONDIR = $(sitedir)$(target_prefix)
99
- RUBYLIBDIR = $(sitelibdir)$(target_prefix)
100
- RUBYARCHDIR = $(sitearchdir)$(target_prefix)
101
-
102
- TARGET_SO = $(DLLIB)
103
- CLEANLIBS = $(TARGET).so $(TARGET).il? $(TARGET).tds $(TARGET).map
104
- CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
105
-
106
- all: $(DLLIB)
107
- static: $(STATIC_LIB)
108
-
109
- clean:
110
- @-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
111
-
112
- distclean: clean
113
- @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
114
- @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
115
-
116
- realclean: distclean
117
- install: install-so install-rb
118
-
119
- install-so: $(RUBYARCHDIR)
120
- install-so: $(RUBYARCHDIR)/$(DLLIB)
121
- $(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
122
- $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
123
- install-rb: pre-install-rb install-rb-default
124
- install-rb-default: pre-install-rb-default
125
- pre-install-rb: Makefile
126
- pre-install-rb-default: Makefile
127
- pre-install-rb-default: $(RUBYLIBDIR)
128
- install-rb-default: $(RUBYLIBDIR)/gpgme.rb
129
- $(RUBYLIBDIR)/gpgme.rb: $(srcdir)/lib/gpgme.rb $(RUBYLIBDIR)
130
- $(INSTALL_DATA) $(srcdir)/lib/gpgme.rb $(@D)
131
- pre-install-rb-default: $(RUBYLIBDIR)/gpgme
132
- install-rb-default: $(RUBYLIBDIR)/gpgme/compat.rb
133
- $(RUBYLIBDIR)/gpgme/compat.rb: $(srcdir)/lib/gpgme/compat.rb $(RUBYLIBDIR)/gpgme
134
- $(INSTALL_DATA) $(srcdir)/lib/gpgme/compat.rb $(@D)
135
- install-rb-default: $(RUBYLIBDIR)/gpgme/constants.rb
136
- $(RUBYLIBDIR)/gpgme/constants.rb: $(srcdir)/lib/gpgme/constants.rb $(RUBYLIBDIR)/gpgme
137
- $(INSTALL_DATA) $(srcdir)/lib/gpgme/constants.rb $(@D)
138
- $(RUBYARCHDIR):
139
- $(MAKEDIRS) $@
140
- $(RUBYLIBDIR):
141
- $(MAKEDIRS) $@
142
- $(RUBYLIBDIR)/gpgme:
143
- $(MAKEDIRS) $@
144
-
145
- site-install: site-install-so site-install-rb
146
- site-install-so: install-so
147
- site-install-rb: install-rb
148
-
149
- .SUFFIXES: .c .m .cc .cxx .cpp .C .o
150
-
151
- .cc.o:
152
- $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
153
-
154
- .cxx.o:
155
- $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
156
-
157
- .cpp.o:
158
- $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
159
-
160
- .C.o:
161
- $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
162
-
163
- .c.o:
164
- $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
165
-
166
- $(DLLIB): $(OBJS) Makefile
167
- @-$(RM) $@
168
- $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
169
-
170
-
171
-
172
- $(OBJS): ruby.h defines.h
@@ -1,18 +0,0 @@
1
- COPYING
2
- COPYING.LESSER
3
- Makefile
4
- Manifest.txt
5
- README
6
- Rakefile
7
- THANKS
8
- examples/edit.rb
9
- examples/genkey.rb
10
- examples/keylist.rb
11
- examples/roundtrip.rb
12
- examples/sign.rb
13
- examples/verify.rb
14
- extconf.rb
15
- gpgme_n.c
16
- lib/gpgme.rb
17
- lib/gpgme/compat.rb
18
- lib/gpgme/constants.rb
data/README DELETED
@@ -1,86 +0,0 @@
1
- = Ruby-GPGME
2
-
3
- * http://rubyforge.org/projects/ruby-gpgme/
4
-
5
- == Description
6
-
7
- Ruby-GPGME is a Ruby language binding of GPGME (GnuPG Made Easy).
8
-
9
- GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG
10
- easier for applications. It provides a High-Level Crypto API for
11
- encryption, decryption, signing, signature verification and key
12
- management.
13
-
14
- == Requirements
15
-
16
- * Ruby 1.8 or later
17
- * GPGME 1.1.2 or later
18
- * gpg-agent (optional, but recommended)
19
-
20
- == Installation
21
-
22
- $ gem install ruby-gpgme
23
-
24
- or
25
-
26
- $ ruby extconf.rb
27
- $ make
28
- $ make install
29
-
30
- == Examples
31
-
32
- examples/genkey.rb Generate a key pair in your keyring.
33
- examples/keylist.rb List your keyring like gpg --list-keys.
34
- examples/roundtrip.rb Encrypt a plain text and then decrypt it.
35
- examples/sign.rb Create a clear text signature.
36
- examples/verify.rb Verify a clear text signature given from stdin.
37
-
38
- == API
39
-
40
- Ruby-GPGME provides three levels of API. The highest level API is
41
- close to the command line interface of GnuPG. The mid level API looks
42
- object-oriented (or rubyish). The lowest level API is close to the C
43
- interface of GPGME.
44
-
45
- === The highest level API
46
-
47
- For example, to create a cleartext signature of the plaintext from
48
- stdin and write the result to stdout can be written as follows.
49
-
50
- $ ruby -rgpgme -e 'GPGME.clearsign($stdin, $stdout)'
51
-
52
- === The mid level API
53
-
54
- The same example can be rewritten in the mid level API as follows.
55
-
56
- $ ruby -rgpgme -e <<End
57
- ctx = GPGME::Ctx.new
58
- plain = GPGME::Data.from_io($stdin)
59
- sig = GPGME::Data.from_io($stdout)
60
- ctx.sign(plain, sig, GPGME::SIG_MODE_CLEAR)
61
- End
62
-
63
- === The lowest level API
64
-
65
- The same example can be rewritten in the lowest level API as follows.
66
-
67
- $ ruby -rgpgme -e <<End
68
- ret = Array.new
69
- GPGME::gpgme_new(ret)
70
- ctx = ret.shift
71
- GPGME::gpgme_data_new_from_fd(ret, 0)
72
- plain = ret.shift
73
- GPGME::gpgme_data_new_from_fd(ret, 1)
74
- sig = ret.shift
75
- GPGME::gpgme_op_sign(ctx, plain, sig, GPGME::SIG_MODE_CLEAR)
76
- End
77
-
78
- As you see, it's much harder to write a program in this API than the
79
- highest level API. However, if you are already familier with the C
80
- interface of GPGME and want to control detailed behavior of GPGME, it
81
- might be useful.
82
-
83
- == License
84
-
85
- The library itself is licensed under LGPLv2.1+. See the file
86
- COPYING.LESSER and each file for copyright and warranty information.
data/Rakefile DELETED
@@ -1,17 +0,0 @@
1
- # -*- ruby -*-
2
-
3
- require 'rubygems'
4
- require 'hoe'
5
-
6
- Hoe.spec("gpgme") do
7
- self.rubyforge_name = "ruby-gpgme"
8
- self.author = ['Daiki Ueno']
9
- self.email = 'ueno@unixuser.org'
10
- self.readme_file = "README"
11
- self.spec_extras = {
12
- "extensions" => ["extconf.rb"],
13
- }
14
- self.need_tar = false
15
- self.need_tar_gz = true
16
- self.source_prefix = 'ruby-'
17
- end
data/THANKS DELETED
@@ -1,15 +0,0 @@
1
- Ruby-GPGME was originally written by Daiki Ueno. Other people
2
- contributed by reporting problems, suggesting various improvements or
3
- submitting actual code. Here is a list of those people. Help us keep
4
- it complete and free of errors.
5
-
6
-
7
-
8
- Carl Corliss
9
- Jérémie Pierson
10
- Kouhei Sutou
11
- Kris Nuttycombe
12
- Marc Dequènes
13
- Rob Pitt
14
- Rory McKinley
15
- Sam Hall
data/extconf.rb DELETED
@@ -1,26 +0,0 @@
1
- require 'mkmf'
2
-
3
- unless find_executable('gpgme-config')
4
- $stderr.puts("gpgme-config not found")
5
- exit(1)
6
- end
7
-
8
- $CFLAGS += ' ' << `gpgme-config --cflags`.chomp
9
- $libs += ' ' << `gpgme-config --libs`.chomp
10
-
11
- checking_for('gpgme >= 1.1.3') do
12
- if try_run(<<'End')
13
- #include <gpgme.h>
14
- #include <stdlib.h>
15
- int main (void) {
16
- return gpgme_check_version ("1.1.3") == NULL;
17
- }
18
- End
19
- true
20
- else
21
- $CFLAGS += ' -DRUBY_GPGME_NEED_WORKAROUND_KEYLIST_NEXT'
22
- false
23
- end
24
- end
25
- have_func('gpgme_op_export_keys')
26
- create_makefile ('gpgme_n')
metadata.gz.sig DELETED
Binary file