lib/r509/cert/extensions/ocsp_no_check.rb in r509-0.10.0 vs lib/r509/cert/extensions/ocsp_no_check.rb in r509-1.0
- old
+ new
@@ -16,21 +16,20 @@
# lifetime and renew it frequently.
#
# You can use this extension to parse an existing extension for easy access
# to the contents or create a new one.
class OCSPNoCheck < OpenSSL::X509::Extension
-
# friendly name for OCSP No Check
OID = "noCheck"
Extensions.register_class(self)
# This method takes a hash or an existing Extension object to parse
#
# @option arg :ocsp_no_check [Any] Pass any value. It's irrelevant.
# @option arg :critical [Boolean] (false)
def initialize(arg)
- if not R509::Cert::Extensions.is_extension?(arg)
+ unless R509::Cert::Extensions.is_extension?(arg)
arg = build_extension(arg)
end
super(arg)
end
@@ -43,13 +42,14 @@
def to_yaml
self.to_h.to_yaml
end
private
+
def build_extension(arg)
ef = OpenSSL::X509::ExtensionFactory.new
critical = R509::Cert::Extensions.calculate_critical(arg[:critical], false)
- return ef.create_extension("noCheck","yes",critical)
+ ef.create_extension("noCheck", "yes", critical)
end
end
end
end
end