bendiken-cheapid 0.0.0 → 0.0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +4 -36
- data/bin/cheapid +11 -1
- data/lib/cheapid.rb +4 -0
- data/lib/cheapid/bearer.rb +24 -0
- data/lib/cheapid/card.rb +28 -0
- data/lib/cheapid/issuer.rb +15 -0
- data/lib/cheapid/version.rb +1 -1
- metadata +35 -13
data/Rakefile
CHANGED
@@ -1,37 +1,5 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
$:.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'lib')))
|
1
3
|
require 'rubygems'
|
2
|
-
require '
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = "cheapid"
|
8
|
-
gem.summary = "The CheapID reference implementation."
|
9
|
-
gem.email = "arto.bendiken@gmail.com"
|
10
|
-
gem.homepage = "http://github.com/bendiken/cheapid"
|
11
|
-
gem.description = "This is a pure-Ruby implementation of the CheapID Digital Identity Card Specification."
|
12
|
-
gem.authors = ["Arto Bendiken", "Vinay Gupta"]
|
13
|
-
gem.executables = ['cheapid']
|
14
|
-
gem.add_dependency 'openpgp'
|
15
|
-
end
|
16
|
-
rescue LoadError
|
17
|
-
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install bendiken-jeweler -s http://gems.github.com"
|
18
|
-
end
|
19
|
-
|
20
|
-
require 'rake/testtask'
|
21
|
-
Rake::TestTask.new(:test) do |test|
|
22
|
-
test.libs << 'lib' << 'test'
|
23
|
-
test.pattern = 'test/**/*_test.rb'
|
24
|
-
test.verbose = true
|
25
|
-
end
|
26
|
-
|
27
|
-
task :default => :test
|
28
|
-
|
29
|
-
require 'rake/rdoctask'
|
30
|
-
Rake::RDocTask.new do |rdoc|
|
31
|
-
version = File.exist?('VERSION') ? File.read('VERSION').chomp : ''
|
32
|
-
|
33
|
-
rdoc.rdoc_dir = 'doc/rdoc'
|
34
|
-
rdoc.title = "CheapID #{version}"
|
35
|
-
rdoc.rdoc_files.include('README*')
|
36
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
37
|
-
end
|
4
|
+
require 'rakefile' # http://github.com/bendiken/rakefile
|
5
|
+
require 'cheapid'
|
data/bin/cheapid
CHANGED
data/lib/cheapid.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
module CheapID
|
2
|
+
##
|
3
|
+
# CheapID card bearer.
|
4
|
+
class Bearer
|
5
|
+
attr_accessor :key
|
6
|
+
attr_accessor :id
|
7
|
+
attr_accessor :name
|
8
|
+
attr_accessor :photo
|
9
|
+
|
10
|
+
def initialize(options = {})
|
11
|
+
options.each { |k, v| send("#{k}=", v) }
|
12
|
+
end
|
13
|
+
|
14
|
+
# TODO
|
15
|
+
|
16
|
+
class Photograph
|
17
|
+
# TODO
|
18
|
+
end
|
19
|
+
|
20
|
+
class Fingerprint
|
21
|
+
# TODO
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/cheapid/card.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
module CheapID
|
2
|
+
##
|
3
|
+
# CheapID card.
|
4
|
+
class Card
|
5
|
+
GPG = OpenPGP::GnuPG.new(:homedir => ENV['GNUPGHOME'] || '.gnupg')
|
6
|
+
|
7
|
+
attr_accessor :key
|
8
|
+
attr_accessor :id
|
9
|
+
attr_accessor :issuer
|
10
|
+
attr_accessor :bearer
|
11
|
+
|
12
|
+
def initialize(options = {})
|
13
|
+
options.each { |k, v| send("#{k}=", v) }
|
14
|
+
@id = UUID.timestamp_create unless options[:id]
|
15
|
+
end
|
16
|
+
|
17
|
+
def generate
|
18
|
+
key = GPG.gen_key({
|
19
|
+
:key_type => 'DSA',
|
20
|
+
:key_length => 1024,
|
21
|
+
:subkey_type => 'ELG-E',
|
22
|
+
:subkey_length => 1024,
|
23
|
+
:name => 'CheapID',
|
24
|
+
:comment => id.to_s,
|
25
|
+
})
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/cheapid/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bendiken-cheapid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.0
|
4
|
+
version: 0.0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arto Bendiken
|
@@ -10,9 +10,19 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-04-
|
13
|
+
date: 2009-04-20 00:00:00 -07:00
|
14
14
|
default_executable: cheapid
|
15
15
|
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: rakefile
|
18
|
+
type: :development
|
19
|
+
version_requirement:
|
20
|
+
version_requirements: !ruby/object:Gem::Requirement
|
21
|
+
requirements:
|
22
|
+
- - ">="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: "0"
|
25
|
+
version:
|
16
26
|
- !ruby/object:Gem::Dependency
|
17
27
|
name: openpgp
|
18
28
|
type: :runtime
|
@@ -21,17 +31,26 @@ dependencies:
|
|
21
31
|
requirements:
|
22
32
|
- - ">="
|
23
33
|
- !ruby/object:Gem::Version
|
24
|
-
version:
|
34
|
+
version: 0.0.1
|
35
|
+
version:
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: uuidtools
|
38
|
+
type: :runtime
|
39
|
+
version_requirement:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 1.0.7
|
25
45
|
version:
|
26
|
-
description: This is a
|
46
|
+
description: This is a Ruby implementation of the CheapID Digital Identity Card Specification.
|
27
47
|
email: arto.bendiken@gmail.com
|
28
48
|
executables:
|
29
49
|
- cheapid
|
30
50
|
extensions: []
|
31
51
|
|
32
|
-
extra_rdoc_files:
|
33
|
-
|
34
|
-
- README
|
52
|
+
extra_rdoc_files: []
|
53
|
+
|
35
54
|
files:
|
36
55
|
- LICENSE
|
37
56
|
- README
|
@@ -39,19 +58,22 @@ files:
|
|
39
58
|
- VERSION
|
40
59
|
- bin/cheapid
|
41
60
|
- lib/cheapid.rb
|
61
|
+
- lib/cheapid/bearer.rb
|
62
|
+
- lib/cheapid/card.rb
|
63
|
+
- lib/cheapid/issuer.rb
|
42
64
|
- lib/cheapid/version.rb
|
43
|
-
has_rdoc:
|
65
|
+
has_rdoc: false
|
44
66
|
homepage: http://github.com/bendiken/cheapid
|
45
67
|
post_install_message:
|
46
|
-
rdoc_options:
|
47
|
-
|
68
|
+
rdoc_options: []
|
69
|
+
|
48
70
|
require_paths:
|
49
71
|
- lib
|
50
72
|
required_ruby_version: !ruby/object:Gem::Requirement
|
51
73
|
requirements:
|
52
74
|
- - ">="
|
53
75
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
76
|
+
version: 1.8.2
|
55
77
|
version:
|
56
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
79
|
requirements:
|
@@ -61,10 +83,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
83
|
version:
|
62
84
|
requirements: []
|
63
85
|
|
64
|
-
rubyforge_project:
|
86
|
+
rubyforge_project: cheapid
|
65
87
|
rubygems_version: 1.2.0
|
66
88
|
signing_key:
|
67
|
-
specification_version:
|
89
|
+
specification_version: 2
|
68
90
|
summary: The CheapID reference implementation.
|
69
91
|
test_files: []
|
70
92
|
|