keyczar_ruby 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,4 @@
1
- A ruby interface to the keyczar crypto library. Provides basic encrypt,
2
- decrypt, sign and verify methods.
3
-
4
- This is just a wrapper around the c++ version of keyczar. You will need
5
- keyczar-cpp in order to use it. Find keyczar-cpp here:
6
-
7
- http://code.google.com/p/keyczar/downloads/list
1
+ A ruby interface to the keyczar crypto library. Provides basic encrypt, decrypt, sign and verify methods. This is just a wrapper around the c++ version of keyczar. You will need keyczar-cpp in order to use it. Find keyczar-cpp here: http://code.google.com/p/keyczar/downloads/list
8
2
 
9
3
  For now, we assume that keyczar-cpp was installed with the prefix
10
4
  /usr/local. You should be able to install it with these commands:
@@ -26,6 +20,9 @@ Methods:
26
20
  The first 3 return empty string on error. #encrypt and #sign results are
27
21
  base64 encoded.
28
22
 
23
+ The first 3 return nil when passed nil.
24
+ The 4th returns false when passed a nil for either text or signature.
25
+
29
26
  == Installation
30
27
 
31
28
  Simple:
@@ -62,6 +62,7 @@ extern "C" {
62
62
  keyczar::Crypter* crypter;
63
63
  Data_Get_Struct(self, keyczar::Crypter, crypter);
64
64
 
65
+ Check_Type(plaintext, T_STRING);
65
66
  std::string cryptext=crypter->Encrypt(RSTRING_PTR(plaintext));
66
67
 
67
68
  return rb_str_new2(cryptext.c_str());
@@ -71,8 +72,8 @@ extern "C" {
71
72
  keyczar::Crypter* crypter;
72
73
  Data_Get_Struct(self, keyczar::Crypter, crypter);
73
74
 
75
+ Check_Type(cryptext, T_STRING);
74
76
  std::string plaintext=crypter->Decrypt(RSTRING_PTR(cryptext));
75
-
76
77
  return rb_str_new2(plaintext.c_str());
77
78
  }
78
79
 
@@ -80,6 +81,7 @@ extern "C" {
80
81
  keyczar::Signer* signer;
81
82
  Data_Get_Struct(self, keyczar::Signer, signer);
82
83
 
84
+ Check_Type(text, T_STRING);
83
85
  std::string signature=signer->Sign(RSTRING_PTR(text));
84
86
 
85
87
  return rb_str_new2(signature.c_str());
@@ -89,8 +91,10 @@ extern "C" {
89
91
  keyczar::Signer* signer;
90
92
  Data_Get_Struct(self, keyczar::Signer, signer);
91
93
 
94
+ Check_Type(text, T_STRING);
95
+ Check_Type(signature, T_STRING);
92
96
  bool result=signer->Verify(RSTRING_PTR(text), RSTRING_PTR(signature));
93
97
 
94
98
  return result ? Qtrue : Qfalse;
95
99
  }
96
- }
100
+ }
@@ -19,7 +19,7 @@ $keyczar_ruby_gemspec = Gem::Specification.new do |s|
19
19
  s.rubygems_version = %q{1.8.9}
20
20
  s.summary = %q{ruby wrapper for keyczar crypto library}
21
21
 
22
- s.add_development_dependency(%q<bundler>, ["~> 1.1.2"])
22
+ s.add_development_dependency(%q<bundler>, ["~> 1.2.0"])
23
23
  s.add_development_dependency(%q<rspec>, ["~> 2.7.0"])
24
24
  s.add_development_dependency(%q<rr>, [">= 0"])
25
25
  s.add_development_dependency(%q<rake>, ["~> 0.9.2"])
@@ -1,3 +1,3 @@
1
1
  module Keyczar
2
- VERSION = "0.0.3"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: keyczar_ruby
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.1.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - TrueCar SF Dev Team
@@ -10,8 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-08-31 00:00:00 -07:00
14
- default_executable:
13
+ date: 2012-08-31 00:00:00 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: bundler
@@ -21,7 +20,7 @@ dependencies:
21
20
  requirements:
22
21
  - - ~>
23
22
  - !ruby/object:Gem::Version
24
- version: 1.1.2
23
+ version: 1.2.0
25
24
  type: :development
26
25
  version_requirements: *id001
27
26
  - !ruby/object:Gem::Dependency
@@ -85,7 +84,6 @@ files:
85
84
  - ext/keyczar_ruby/keyczar_ruby.cc
86
85
  - keyczar_ruby.gemspec
87
86
  - lib/keyczar_ruby/version.rb
88
- has_rdoc: true
89
87
  homepage:
90
88
  licenses: []
91
89
 
@@ -109,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
107
  requirements: []
110
108
 
111
109
  rubyforge_project:
112
- rubygems_version: 1.5.2
110
+ rubygems_version: 1.8.24
113
111
  signing_key:
114
112
  specification_version: 3
115
113
  summary: ruby wrapper for keyczar crypto library