pkcs7-cryptographer 0.2.1 → 0.2.2

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
  SHA256:
3
- metadata.gz: a33a97c4086f5f9780f1098df7d5983802301bcd6566b42030572871450cd304
4
- data.tar.gz: d6257773adc3d2c0fd25383ad1b243c04317d091fee682e477b8dc384201dfec
3
+ metadata.gz: cf8d46e30794182b24393965b11655facc02bd6597a0856e59516b5b185f2ea1
4
+ data.tar.gz: 0564d998860e51680e422ae8c87768145458a44ae891e6683754436db7fcb38f
5
5
  SHA512:
6
- metadata.gz: 7a58da6fe867dfe729490b054a6ba53d1a07a5ccfde2812acdbd2d892af10e4f29f7345741b2c9f51bcf4af400d8f7cb19392b95d27a981850afdc47d76c816f
7
- data.tar.gz: 7a30d3664b52f8789fc118d9b8b5b00a74187dec24db6edff6b850fddeee31e0058ce008d56734c2a8e1b9e7a081780fb99dfcfc21f15e50cef0f3857a0d6c73
6
+ metadata.gz: 1cce85246daad30252c7db7fa69a48c430069ebb06f7a4c27a410363f64d0182abcd46fd256960e6b13e01642ea581a5d1688d2e4ccd52635810c12e7628520d
7
+ data.tar.gz: 3a6c09eeb65e4a7fa3d406cc98d9673ccbc253dace154a2ef90ae612bc6c3129f29fe12f03cac7a643887efcd475557229c56bdf8cf93261de6edfd1e78fa4f7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pkcs7-cryptographer (0.2.1)
4
+ pkcs7-cryptographer (0.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -118,7 +118,6 @@ Read the following examples to get a better undertanding:
118
118
 
119
119
  # Client PKI data
120
120
  CLIENT_CERTIFICATE = read_file("client.crt")
121
- CLIENT_KEY = read_file("client.key")
122
121
 
123
122
  CA_STORE = OpenSSL::X509::Store.new
124
123
  CA_STORE.add_cert(OpenSSL::X509::Certificate.new(CA_CERTIFICATE))
@@ -130,9 +129,7 @@ Read the following examples to get a better undertanding:
130
129
  )
131
130
 
132
131
  client_entity = PKCS7::Cryptographer::Entity.new(
133
- key: CLIENT_KEY,
134
132
  certificate: CLIENT_CERTIFICATE,
135
- ca_store: CA_STORE
136
133
  )
137
134
 
138
135
  # SEND MESSAGE TO THE CLIENT
@@ -17,8 +17,12 @@ module PKCS7
17
17
 
18
18
  # PUBLIC METHODS
19
19
  # ------------------------------------------------------------------------
20
- def initialize(key:, certificate:, ca_store: OpenSSL::X509::Store.new)
21
- @key = rsa_key(key)
20
+ def initialize(
21
+ certificate:,
22
+ key: nil,
23
+ ca_store: OpenSSL::X509::Store.new
24
+ )
25
+ @key = key ? rsa_key(key) : nil
22
26
  @certificate = x509_certificate(certificate)
23
27
  @cryptographer = PKCS7::Cryptographer.new
24
28
  @ca_store = ca_store
@@ -57,7 +61,7 @@ module PKCS7
57
61
 
58
62
  def perform_safely(entity)
59
63
  return false unless trustable_entity?(entity)
60
-
64
+ return false unless @key.present?
61
65
  yield
62
66
  end
63
67
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module PKCS7
4
4
  class Cryptographer
5
- VERSION = "0.2.1"
5
+ VERSION = "0.2.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pkcs7-cryptographer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Munera Sanchez