aadhaar_auth 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/LICENSE.txt +22 -0
- data/README.md +62 -0
- data/Rakefile +2 -0
- data/aadhaar_auth.gemspec +26 -0
- data/keys/Auth_Staging.cer +21 -0
- data/keys/public-may2012.p12 +0 -0
- data/lib/aadhaar_auth.rb +9 -0
- data/lib/aadhaar_auth/client.rb +135 -0
- data/lib/aadhaar_auth/config.rb +32 -0
- data/lib/aadhaar_auth/digital_signer.rb +36 -0
- data/lib/aadhaar_auth/encrypter.rb +41 -0
- data/lib/aadhaar_auth/version.rb +3 -0
- metadata +159 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Manish Kasera
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
22
|
+
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 manishk
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
# AadhaarAuth
|
2
|
+
|
3
|
+
Aadhaar Auth API v.1.6 ruby port
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'aadhaar_auth'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install aadhaar_auth
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
```ruby
|
23
|
+
c = AadhaarAuth::Client.new(:aadhaar_no => '999999990019', :name => 'Shivshankar Choudhury')
|
24
|
+
c.valid? #true/false
|
25
|
+
```
|
26
|
+
there is also a verbose mode which prints the request/response on STDOUT
|
27
|
+
```ruby
|
28
|
+
c.verbose = true
|
29
|
+
```
|
30
|
+
## Configuration
|
31
|
+
|
32
|
+
By default test credentials are used, if you want to deploy it to production, use the confugurator as below
|
33
|
+
|
34
|
+
options available
|
35
|
+
* api_version
|
36
|
+
* asa_licence_key
|
37
|
+
* public_certificate_path
|
38
|
+
* digital_signature_path
|
39
|
+
* digital_signature_pwd
|
40
|
+
* ac
|
41
|
+
* lk
|
42
|
+
* sa
|
43
|
+
* tid
|
44
|
+
* udc
|
45
|
+
|
46
|
+
set them as
|
47
|
+
```ruby
|
48
|
+
AadhaarAuth::Config.asa_licence_key = "hfjsfdGJgGJghJGHJGJGHGFBJIG"
|
49
|
+
AadhaarAuth::Config.public_certificate_path = "/tmp/Auth_Staging.cer"
|
50
|
+
AadhaarAuth::Config.digital_signature_path = "/tmp/public-may2012.p12"
|
51
|
+
```
|
52
|
+
|
53
|
+
## API Doc
|
54
|
+
Aadhaar api documentation is available [here](https://developer.uidai.gov.in/site/book/export/html/18)
|
55
|
+
|
56
|
+
## Contributing
|
57
|
+
|
58
|
+
1. Fork it ( https://github.com/[my-github-username]/aadhaar_auth/fork )
|
59
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
60
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
61
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
62
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'aadhaar_auth/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "aadhaar_auth"
|
8
|
+
spec.version = AadhaarAuth::VERSION
|
9
|
+
spec.authors = ["Manish Kasera"]
|
10
|
+
spec.email = ["manishgkasera@gmail.com"]
|
11
|
+
spec.summary = %q{Aadhaar auth api: ruby port}
|
12
|
+
spec.description = %q{Aadhaar auth api v1.6: ruby port}
|
13
|
+
spec.homepage = 'https://github.com/manishgkasera/aadhaar_auth'
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
21
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
22
|
+
|
23
|
+
spec.add_runtime_dependency "xmldsig", "0.2.8"
|
24
|
+
spec.add_runtime_dependency "nokogiri", ">= 1.5.2"
|
25
|
+
spec.add_runtime_dependency "curb", ">= 0.8.6"
|
26
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
2
|
+
MIIDfDCCAmSgAwIBAgIECmnOfzANBgkqhkiG9w0BAQUFADB2MQswCQYDVQQGEwJJ
|
3
|
+
TjESMBAGA1UECBMJS0FSTkFUQUtBMRIwEAYDVQQHEwlCYW5nYWxvcmUxDjAMBgNV
|
4
|
+
BAoTBVVJREFJMRQwEgYDVQQLEwtUZWNoIENlbnRlcjEZMBcGA1UEAxMQQXV0aCBU
|
5
|
+
ZXN0IFNlcnZlcjAeFw0xMTA5MjIwMDAwMDBaFw0xNTA5MjIwMDAwMDBaMHYxCzAJ
|
6
|
+
BgNVBAYTAklOMRIwEAYDVQQIEwlLQVJOQVRBS0ExEjAQBgNVBAcTCUJhbmdhbG9y
|
7
|
+
ZTEOMAwGA1UEChMFVUlEQUkxFDASBgNVBAsTC1RlY2ggQ2VudGVyMRkwFwYDVQQD
|
8
|
+
ExBBdXRoIFRlc3QgU2VydmVyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
|
9
|
+
AQEAxgVhHZZwTbiBMbu6zPzpNRfVp7ldubZvqPuKWT77UhR8pUUiBW7f19P+Ox6E
|
10
|
+
r6K6F/hoMWzz2k8geVEqFoRbVUVTfxxoxBkisQ82WCpbG0KkPNGyZ9i/56Aslq/b
|
11
|
+
wfSbyH6rfpAqLjFu9BXw4W+SY1zTKIjkxCjTh4FbqgzpFkGVlV3Al98ODrlS7uuy
|
12
|
+
X+qeqjvDZ3HQ+MzejrbNn6TQRBLaaqCVlkSzrzejXyEqaqliwVOVqNI3YPde7Mjl
|
13
|
+
4p6yGJ9T5Z4SGXSQXXP542kbxblcWn+inQvEmLCs3na841KflFRnFcMw27NDH1KQ
|
14
|
+
L8IZZByu56KE6BOIidcqoFF2aQIDAQABoxIwEDAOBgNVHQ8BAf8EBAMCBaAwDQYJ
|
15
|
+
KoZIhvcNAQEFBQADggEBAIFZ3r5wdZoKb8EOoP/hDnGotyxXJYgmUSmx4PNUPj0W
|
16
|
+
78eV4PTC8f9DPL2/DJUM7fvfsrO1M3R6fiTB+umrphEX9a6yX6K66KSWd8yaGouO
|
17
|
+
tX+ExkUNkEzmlS1ktKnhdSVwi0fkt8LBMjposZcz/0cPpjNFUyAyeyvSYbD2HusE
|
18
|
+
sbuMzHnSTFia5P5d32LtqD9tK7L3fS5d7NXa4Aod36JECqbKYyWInnWs3R3jFtKW
|
19
|
+
PGIA/V82oDQTvg9ey4fAvBrAUKfO3/UxF844k9cfCo1xrNxWv37wFuzuYbjA9w6Y
|
20
|
+
xiYWElRfRaEwChu+/2A2jYJ76lAOvbAyfILYNTtditM=
|
21
|
+
-----END CERTIFICATE-----
|
Binary file
|
data/lib/aadhaar_auth.rb
ADDED
@@ -0,0 +1,135 @@
|
|
1
|
+
require 'curb'
|
2
|
+
require 'aadhaar_auth/encrypter'
|
3
|
+
require 'aadhaar_auth/digital_signer'
|
4
|
+
|
5
|
+
module AadhaarAuth
|
6
|
+
class Client
|
7
|
+
attr_accessor :verbose
|
8
|
+
attr_reader :aadhaar_no, :name, :email, :phone, :gender, :time,
|
9
|
+
:encrypter, :digital_signer, :raw_response, :error_code
|
10
|
+
|
11
|
+
def initialize(person_data)
|
12
|
+
@aadhaar_no = person_data[:aadhaar_no].to_s
|
13
|
+
@name = person_data[:name]
|
14
|
+
@email = person_data[:email]
|
15
|
+
@phone = person_data[:phone]
|
16
|
+
@gender = person_data[:gender]
|
17
|
+
@time = Time.now
|
18
|
+
@encrypter = Encrypter.new
|
19
|
+
@digital_signer = DigitalSigner.new
|
20
|
+
@raw_response = nil
|
21
|
+
end
|
22
|
+
|
23
|
+
def valid?
|
24
|
+
# should be exactly 12 digits
|
25
|
+
if aadhaar_no !~ /^\d{12}$/
|
26
|
+
return(false)
|
27
|
+
end
|
28
|
+
|
29
|
+
@raw_response = Curl::Easy.http_post(url, raw_request).body_str
|
30
|
+
|
31
|
+
if verbose
|
32
|
+
puts "URL: \n#{url}"
|
33
|
+
puts "PID XML: \n#{pid_block()}"
|
34
|
+
puts "Signed request: \n#{raw_request}"
|
35
|
+
puts "Response: \n#{@raw_response}"
|
36
|
+
end
|
37
|
+
|
38
|
+
digital_signer.verify_signature(@raw_response) if Config.verify_response_signature
|
39
|
+
|
40
|
+
auth_res = Nokogiri::XML(@raw_response).children.find{|c| c.name == 'AuthRes'}
|
41
|
+
@error_code = auth_res.attributes['err'] ? auth_res.attributes['err'].value : nil
|
42
|
+
|
43
|
+
ret = auth_res.attributes['ret'] ? auth_res.attributes['ret'].value : nil
|
44
|
+
if ret && ret != ''
|
45
|
+
return ret == 'y'
|
46
|
+
end
|
47
|
+
|
48
|
+
raise ResponseError.new(["Error :#{@error_code}", pid_block, raw_request, @raw_response].join("\n\n"))
|
49
|
+
end
|
50
|
+
|
51
|
+
def url
|
52
|
+
@url ||= url = "http://auth.uidai.gov.in/#{Config.api_version}/public/#{aadhaar_no[0]}/#{aadhaar_no[1]}/#{Config.asa_licence_key}"
|
53
|
+
end
|
54
|
+
|
55
|
+
def raw_request
|
56
|
+
@raw_request ||= digital_signer.sign(req_xml)
|
57
|
+
end
|
58
|
+
|
59
|
+
def req_xml
|
60
|
+
nok = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |x|
|
61
|
+
x.Auth(
|
62
|
+
'uid' => aadhaar_no,
|
63
|
+
'ac' => Config.ac,
|
64
|
+
'lk' => Config.lk,
|
65
|
+
'sa'=> Config.sa,
|
66
|
+
'tid'=> Config.tid,
|
67
|
+
'txn'=>"AuthDemoClient:public:#{time.to_i}",
|
68
|
+
'ver'=> Config.api_version,
|
69
|
+
'xmlns:ds'=>"http://www.w3.org/2000/09/xmldsig#",
|
70
|
+
'xmlns'=>"http://www.uidai.gov.in/authentication/uid-auth-request/1.0") do
|
71
|
+
x.Uses('bio'=>'n', 'otp'=>"n", 'pa'=>"n", 'pfa'=>"n", 'pi'=>"y", 'pin'=>"n")
|
72
|
+
x.Meta('fdc'=>"NA", 'idc'=>"NA", 'lot'=>"P", 'lov' => "560094", 'pip' => "NA", 'udc'=> Config.udc)
|
73
|
+
x.Skey('ci'=> skey_ci) do
|
74
|
+
x.text(encrypter.encrypted_session_key)
|
75
|
+
end
|
76
|
+
x.Data('type' => "X") do
|
77
|
+
x.text(encrypted_data)
|
78
|
+
end
|
79
|
+
x.Hmac(encrypter.calculate_hmac(pid_block))
|
80
|
+
x['ds'].Signature do
|
81
|
+
x['ds'].SignedInfo do
|
82
|
+
x['ds'].CanonicalizationMethod('Algorithm' => "http://www.w3.org/2001/10/xml-exc-c14n#")
|
83
|
+
x['ds'].SignatureMethod('Algorithm' => "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256")
|
84
|
+
x['ds'].Reference('URI' => "") do
|
85
|
+
x['ds'].Transforms do
|
86
|
+
x['ds'].Transform('Algorithm'=>"http://www.w3.org/2000/09/xmldsig#enveloped-signature")
|
87
|
+
end
|
88
|
+
x['ds'].DigestMethod('Algorithm'=>"http://www.w3.org/2001/04/xmlenc#sha256")
|
89
|
+
x['ds'].DigestValue('')
|
90
|
+
end
|
91
|
+
end
|
92
|
+
x['ds'].SignatureValue('')
|
93
|
+
x['ds'].KeyInfo do
|
94
|
+
x['ds'].X509Data do
|
95
|
+
x['ds'].X509SubjectName(DigitalSigner.private_key_cert.subject.to_s)
|
96
|
+
x['ds'].X509Certificate(DigitalSigner.private_key_cert_val)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
nok.to_xml
|
103
|
+
end
|
104
|
+
|
105
|
+
def pid_block
|
106
|
+
@pid_block ||= begin
|
107
|
+
xml = Nokogiri::XML('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>')
|
108
|
+
Nokogiri::XML::Builder.with(xml) do |x|
|
109
|
+
x.Pid('ts' => time.strftime("%Y-%m-%dT%H:%M:%S"), 'xmlns:ns2' => 'http://www.uidai.gov.in/authentication/uid-auth-request-data/1.0') do
|
110
|
+
x.parent.namespace = x.parent.namespace_definitions.find{|ns| ns.prefix == "ns2"}
|
111
|
+
x.Demo do
|
112
|
+
info = {'ms' => "E", 'mv' => "100", 'name' => name}
|
113
|
+
info.merge!('gender' => gender) if gender
|
114
|
+
info.merge!('phone' => phone) if phone
|
115
|
+
info.merge!('email' => email) if email
|
116
|
+
x.Pi(info)
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end.to_xml
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
def encrypted_data
|
124
|
+
@encrypted_data ||= begin
|
125
|
+
Base64.encode64(encrypter.encrypt_using_session_key(pid_block))
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
def skey_ci
|
130
|
+
encrypter.public_cert.not_after.strftime('%Y%m%d')
|
131
|
+
end
|
132
|
+
|
133
|
+
class ResponseError < Exception; end
|
134
|
+
end
|
135
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module AadhaarAuth
|
2
|
+
class Config
|
3
|
+
class << self
|
4
|
+
attr_accessor :api_version,
|
5
|
+
:asa_licence_key,
|
6
|
+
:public_certificate_path,
|
7
|
+
:digital_signature_path,
|
8
|
+
:digital_signature_pwd,
|
9
|
+
:ac, :lk, :sa, :tid, :udc,
|
10
|
+
:verify_response_signature
|
11
|
+
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
Config.api_version = '1.6'
|
16
|
+
Config.asa_licence_key = 'MLTbKYcsgYMq1zgL3WMZYrnyvsarlljxpom2A-QTPc0Zud23shpnqPk'
|
17
|
+
Config.lk = 'MKHmkuz-MgLYvA54PbwZdo9eC3D5y7SVozWwpNgEPysVqLs_aJgAVOI'
|
18
|
+
|
19
|
+
keys_path = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'keys'))
|
20
|
+
Config.public_certificate_path = File.join(keys_path, 'Auth_Staging.cer')
|
21
|
+
|
22
|
+
Config.digital_signature_path = File.join(keys_path, 'public-may2012.p12')
|
23
|
+
Config.digital_signature_pwd = 'public'
|
24
|
+
|
25
|
+
Config.verify_response_signature = true
|
26
|
+
|
27
|
+
Config.ac = 'public'
|
28
|
+
Config.sa = 'public'
|
29
|
+
Config.tid = 'public'
|
30
|
+
Config.udc = '1122'
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'xmldsig'
|
2
|
+
|
3
|
+
module AadhaarAuth
|
4
|
+
class DigitalSigner
|
5
|
+
|
6
|
+
def sign(xml)
|
7
|
+
Xmldsig::SignedDocument.new(xml).sign(self.class.private_key)
|
8
|
+
end
|
9
|
+
|
10
|
+
def verify_signature(xml)
|
11
|
+
if !Xmldsig::SignedDocument.new(xml).validate(Encrypter.public_cert)
|
12
|
+
raise InvalidSignature.new("Invalid response signature")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class << self
|
17
|
+
def pkcs12
|
18
|
+
@pkcs12 ||= OpenSSL::PKCS12.new(File.read(Config.digital_signature_path), Config.digital_signature_pwd)
|
19
|
+
end
|
20
|
+
|
21
|
+
def private_key
|
22
|
+
@private_key ||= OpenSSL::PKey::RSA.new(pkcs12.key.to_s)
|
23
|
+
end
|
24
|
+
|
25
|
+
def private_key_cert
|
26
|
+
@private_key_cert ||= OpenSSL::X509::Certificate.new(pkcs12.certificate.to_s)
|
27
|
+
end
|
28
|
+
|
29
|
+
def private_key_cert_val
|
30
|
+
@private_key_cert_val ||= private_key_cert.to_s.sub(/^-----BEGIN CERTIFICATE-----\n/, '').sub(/-----END CERTIFICATE-----\n$/, '')
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
class InvalidSignature < Exception; end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module AadhaarAuth
|
2
|
+
class Encrypter
|
3
|
+
ENC_ALGO = 'AES-256-ECB'
|
4
|
+
|
5
|
+
def session_key
|
6
|
+
@session_key ||= begin
|
7
|
+
aes = OpenSSL::Cipher.new(ENC_ALGO)
|
8
|
+
aes.encrypt
|
9
|
+
aes.random_key
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def encrypted_session_key
|
14
|
+
@encrypted_session_key ||= begin
|
15
|
+
public_key = public_cert.public_key
|
16
|
+
Base64.encode64(public_key.public_encrypt(session_key))
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def encrypt_using_session_key(data)
|
21
|
+
aes = OpenSSL::Cipher.new(ENC_ALGO)
|
22
|
+
aes.encrypt
|
23
|
+
aes.key = session_key
|
24
|
+
(aes.update(data) + aes.final)
|
25
|
+
end
|
26
|
+
|
27
|
+
def calculate_hmac(data)
|
28
|
+
Base64.encode64(encrypt_using_session_key(Digest::SHA256.digest(data)))
|
29
|
+
end
|
30
|
+
|
31
|
+
def public_cert
|
32
|
+
self.class.public_cert
|
33
|
+
end
|
34
|
+
|
35
|
+
class << self
|
36
|
+
def public_cert
|
37
|
+
@public_cert ||= OpenSSL::X509::Certificate.new(File.read(Config.public_certificate_path))
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
metadata
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: aadhaar_auth
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Manish Kasera
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2015-05-22 00:00:00 +05:30
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 1
|
28
|
+
segments:
|
29
|
+
- 1
|
30
|
+
- 7
|
31
|
+
version: "1.7"
|
32
|
+
prerelease: false
|
33
|
+
type: :development
|
34
|
+
requirement: *id001
|
35
|
+
name: bundler
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ~>
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 35
|
43
|
+
segments:
|
44
|
+
- 10
|
45
|
+
- 0
|
46
|
+
version: "10.0"
|
47
|
+
prerelease: false
|
48
|
+
type: :development
|
49
|
+
requirement: *id002
|
50
|
+
name: rake
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - "="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 7
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
- 2
|
61
|
+
- 8
|
62
|
+
version: 0.2.8
|
63
|
+
prerelease: false
|
64
|
+
type: :runtime
|
65
|
+
requirement: *id003
|
66
|
+
name: xmldsig
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
hash: 7
|
74
|
+
segments:
|
75
|
+
- 1
|
76
|
+
- 5
|
77
|
+
- 2
|
78
|
+
version: 1.5.2
|
79
|
+
prerelease: false
|
80
|
+
type: :runtime
|
81
|
+
requirement: *id004
|
82
|
+
name: nokogiri
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
hash: 51
|
90
|
+
segments:
|
91
|
+
- 0
|
92
|
+
- 8
|
93
|
+
- 6
|
94
|
+
version: 0.8.6
|
95
|
+
prerelease: false
|
96
|
+
type: :runtime
|
97
|
+
requirement: *id005
|
98
|
+
name: curb
|
99
|
+
description: "Aadhaar auth api v1.6: ruby port"
|
100
|
+
email:
|
101
|
+
- manishgkasera@gmail.com
|
102
|
+
executables: []
|
103
|
+
|
104
|
+
extensions: []
|
105
|
+
|
106
|
+
extra_rdoc_files: []
|
107
|
+
|
108
|
+
files:
|
109
|
+
- .gitignore
|
110
|
+
- Gemfile
|
111
|
+
- LICENSE
|
112
|
+
- LICENSE.txt
|
113
|
+
- README.md
|
114
|
+
- Rakefile
|
115
|
+
- aadhaar_auth.gemspec
|
116
|
+
- keys/Auth_Staging.cer
|
117
|
+
- keys/public-may2012.p12
|
118
|
+
- lib/aadhaar_auth.rb
|
119
|
+
- lib/aadhaar_auth/client.rb
|
120
|
+
- lib/aadhaar_auth/config.rb
|
121
|
+
- lib/aadhaar_auth/digital_signer.rb
|
122
|
+
- lib/aadhaar_auth/encrypter.rb
|
123
|
+
- lib/aadhaar_auth/version.rb
|
124
|
+
has_rdoc: true
|
125
|
+
homepage: https://github.com/manishgkasera/aadhaar_auth
|
126
|
+
licenses: []
|
127
|
+
|
128
|
+
post_install_message:
|
129
|
+
rdoc_options: []
|
130
|
+
|
131
|
+
require_paths:
|
132
|
+
- lib
|
133
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
134
|
+
none: false
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
hash: 3
|
139
|
+
segments:
|
140
|
+
- 0
|
141
|
+
version: "0"
|
142
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
|
+
none: false
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
hash: 3
|
148
|
+
segments:
|
149
|
+
- 0
|
150
|
+
version: "0"
|
151
|
+
requirements: []
|
152
|
+
|
153
|
+
rubyforge_project:
|
154
|
+
rubygems_version: 1.5.0
|
155
|
+
signing_key:
|
156
|
+
specification_version: 3
|
157
|
+
summary: "Aadhaar auth api: ruby port"
|
158
|
+
test_files: []
|
159
|
+
|