certificate-transparency-client 0.4.1 → 0.5.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47620dc3af464cdf41a23e61a5e8fc6c202ecef4
4
- data.tar.gz: b3896f7606a3649d2b0b8e7dfd635dfde2ab72ce
3
+ metadata.gz: b148e845e7c72e833e0378091a24ff6783e9dc2e
4
+ data.tar.gz: b9ffaec32c0e670213f9a52d48cd152a8134ede2
5
5
  SHA512:
6
- metadata.gz: fcc2872a2084a1c6f578729438223e028cc2cbb4387b35b193d6600b75444bdb7a3235f56c8cbc3cd3d4cc7df8666fe724d818ff18798aa93bb00da3ba9d331c
7
- data.tar.gz: f852386120c2a3c7803e1aba575c6c61734d5a68132a0d41f93e09399113471d11229dffd6cbdd577db9c2c4a53f6b46a04c46413e787cd0c393b92e7ad2da12
6
+ metadata.gz: e1e6b53c49dcbbb1311027f5f33aee7686798f460a416a2adae70cd863481622aabeb2ba361b722cd2a309be4dd9732456ae98b8065c77752f3b6c2b3fb94f87
7
+ data.tar.gz: 57b496fb3c0b11473a127af8c4ef8d6b7c93659330c60f0be0b5dbccb1b0db2c7c77b410a39c6e573f6bd200124855246eb90c66e37a54dca527663346467d3b
@@ -19,7 +19,7 @@ class CertificateTransparency::Client
19
19
 
20
20
  # The public key of the log, as specified in the constructor.
21
21
  #
22
- # @return [OpenSSL::PKey]
22
+ # @return [OpenSSL::PKey::PKey]
23
23
  #
24
24
  attr_reader :public_key
25
25
 
@@ -42,15 +42,23 @@ class CertificateTransparency::Client
42
42
  end
43
43
 
44
44
  if opts[:public_key]
45
- begin
46
- @public_key = if opts[:public_key].valid_encoding? && opts[:public_key] =~ /^[A-Za-z0-9+\/]+=*$/
47
- OpenSSL::PKey::EC.new(opts[:public_key].unpack("m").first)
48
- else
49
- OpenSSL::PKey::EC.new(opts[:public_key])
45
+ pkdata = if opts[:public_key].valid_encoding? && opts[:public_key] =~ /^[A-Za-z0-9+\/]+=*$/
46
+ opts[:public_key].unpack("m").first
47
+ else
48
+ opts[:public_key]
49
+ end
50
+
51
+ @public_key = begin
52
+ OpenSSL::PKey::EC.new(pkdata)
53
+ rescue ArgumentError
54
+ begin
55
+ OpenSSL::PKey::RSA.new(pkdata)
56
+ rescue StandardError => ex
57
+ raise "Invalid public key: #{ex.message} (#{ex.class})"
50
58
  end
51
- rescue OpenSSL::PKey::ECError
59
+ rescue StandardError => ex
52
60
  raise ArgumentError,
53
- "Invalid public key"
61
+ "Invalid public key: #{ex.message} (#{ex.class})"
54
62
  end
55
63
  end
56
64
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: certificate-transparency-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Palmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-13 00:00:00.000000000 Z
11
+ date: 2015-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: certificate-transparency