caren-api 0.4.15 → 0.4.16

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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/caren-api.gemspec +2 -2
  3. data/lib/caren/caren.rb +5 -0
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.15
1
+ 0.4.16
data/caren-api.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{caren-api}
8
- s.version = "0.4.15"
8
+ s.version = "0.4.16"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andre Foeken"]
12
- s.date = %q{2011-11-17}
12
+ s.date = %q{2011-11-18}
13
13
  s.description = %q{You can use this gem as inspiration of the base of your connections with Caren.}
14
14
  s.email = %q{andre.foeken@nedap.com}
15
15
  s.extra_rdoc_files = [
data/lib/caren/caren.rb CHANGED
@@ -186,6 +186,11 @@ module Caren
186
186
  public_key.verify( "sha1", signature, string.to_s + timestamp.to_s )
187
187
  end
188
188
 
189
+ def create_photo_signature url_shortcut, external_or_caren_id, private_key=self.private_key
190
+ digest = OpenSSL::PKey::RSA.new(private_key).sign( "sha1", url_shortcut.to_s + external_or_caren_id.to_s )
191
+ return CGI.escape(Base64.encode64(digest))
192
+ end
193
+
189
194
  # Verify photo url signature using the caren public key
190
195
  def verify_photo_signature signature, url_shortcut, external_id, public_key=self.caren_public_key
191
196
  return false unless public_key
metadata CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 4
8
- - 15
8
+ - 16
9
9
  segments_generated: true
10
- version: 0.4.15
10
+ version: 0.4.16
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andre Foeken
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-17 00:00:00 +01:00
18
+ date: 2011-11-18 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency