win32-certstore 0.6.12 → 0.6.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4a48182fe9aada5c09a9e0205bc5a3a53fd1b50da8fa3a5abfd649adce8fac0
4
- data.tar.gz: 2803b6ddc28e7575f2c9f3709c42e8509c42cef7c5b6ca9e85884dd51be14dd9
3
+ metadata.gz: 8cf571ee12470bc199074583c729786b1f2464ccdda3d9ea5e8df55ba6f4c59b
4
+ data.tar.gz: 32aab9c95c7dc1f622b5201f25097797a993cf4eb38028425b18205249dc226c
5
5
  SHA512:
6
- metadata.gz: b4569f5dcf1f73d12dd9d82515b2ee0f2d270488118c0c0f0b7f4f079ba7c65cc8dcf7e1321221c68f4465c4858195c752a78c19de3345e795b618ecab616e4f
7
- data.tar.gz: c0d0e669883c027786d41eea3eea9b85c66bc7391675f63a60c8f5229115b73a2e617268a415d741d164a3621688c98902871d1eb764e4c07c2b5ef88a4f3aa8
6
+ metadata.gz: 3bfd9466224de7a129b0bb178e1dbf6651f2ca5bd55cc4d1a2fb4523789d6e277443791f79b71428b098ae15adf785b1dcb50fe10bada13614e087801d44b817
7
+ data.tar.gz: 41da6d47e21d80fdad28eaa1d5c7cd800a9a2e11d7eb8c92acc9570254ed7d3b0d00c790c13be3b1081aec2d83a26b05b34e8b3ee2c3070424ce287823562c3f
@@ -43,7 +43,7 @@ module Win32
43
43
 
44
44
  # Validate thumbprint
45
45
  def validate_thumbprint(cert_thumbprint)
46
- if cert_thumbprint.nil? || cert_thumbprint.empty? || cert_thumbprint.strip.empty?
46
+ if cert_thumbprint.nil? || cert_thumbprint.empty? || cert_thumbprint.strip.empty? || cert_thumbprint.length < 40
47
47
  raise ArgumentError, "Invalid certificate thumbprint."
48
48
  end
49
49
  end
@@ -26,6 +26,10 @@ module Win32
26
26
  <<-EOH
27
27
  $cert = Get-ChildItem Cert:\\#{store_location}\\#{store_name} -Recurse | Where-Object { $_.Thumbprint -eq "#{thumbprint}" }
28
28
 
29
+ if ([string]::IsNullOrEmpty($cert)){
30
+ return "Certificate Not Found"
31
+ }
32
+
29
33
  $certdata = [System.Convert]::ToBase64String($cert.RawData, 'InsertLineBreaks')
30
34
  $content = $null
31
35
  if($null -ne $cert)
@@ -1,6 +1,6 @@
1
1
  module Win32
2
2
  class Certstore
3
- VERSION = "0.6.12".freeze
3
+ VERSION = "0.6.13".freeze
4
4
  MAJOR, MINOR, TINY = VERSION.split(".")
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: win32-certstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.12
4
+ version: 0.6.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Software