win32-certstore 0.2.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/win32/certstore/store_base.rb +8 -7
- data/lib/win32/certstore/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7498d33d838e240261d6629228c9e5f4135cbc8cfef53dd6eb2c25fd15cfa04f
|
4
|
+
data.tar.gz: 7ebbfe860ed3109d18bf6cedb18040fec935a82985348317a9513e6803b80f1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bcf63bbce574b4c92224c1228b7abd68a9e15bd527ffaafd3750f14bb106a499d03eabef6fd134ee603fa790230c12161f0a64ed7e6a072a3f4135da1cfe8db
|
7
|
+
data.tar.gz: e58963b69cc9e20d7b31316e2a1cc2b00484489ea85a8796115555bc2dd40875f55a2327bcddd067c8c8e985096228b2835f3709233aa04a23174027dc8015e7
|
@@ -63,16 +63,17 @@ module Win32
|
|
63
63
|
# @raise [SystemCallError] when Crypt API would not be able to perform some action
|
64
64
|
#
|
65
65
|
def cert_add_pfx(certstore_handler, path, password = "")
|
66
|
+
cert_added = false
|
66
67
|
# Imports a PFX BLOB and returns the handle of a store
|
67
68
|
pfx_cert_store = PFXImportCertStore(CRYPT_DATA_BLOB.new(File.binread(path)), wstring(password), 0)
|
68
69
|
raise if pfx_cert_store.null?
|
69
|
-
# Find the certificate
|
70
|
-
cert_context =
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
70
|
+
# Find all the certificate contexts in certificate store and add them ino the store
|
71
|
+
while (cert_context = CertEnumCertificatesInStore(pfx_cert_store, cert_context)) && (not cert_context.null?)
|
72
|
+
# Add certificate context to the certificate store
|
73
|
+
args = add_certcontxt_args(certstore_handler, cert_context)
|
74
|
+
cert_added = CertAddCertificateContextToStore(*args)
|
75
|
+
raise unless cert_added
|
76
|
+
end
|
76
77
|
cert_added
|
77
78
|
rescue
|
78
79
|
lookup_error("Add a PFX")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: win32-certstore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|