Class: String
Overview
rubocop:disable Documentation
Constant Summary
Constants included from CertMunger
Instance Method Summary collapse
-
#to_cert ⇒ Object
Returns an X509 certificate after parsing the value of this object.
-
#to_cert! ⇒ Object
Similar to #to_cert, but raises an error unless the string can be explicitly parsed to an X509 certifcate.
Methods included from CertMunger
Instance Method Details
#to_cert ⇒ Object
Returns an X509 certificate after parsing the value of this object. Returns false if an X509 certificate cannot be created.
6 7 8 9 10 11 12 13 14 |
# File 'lib/cert_munger/string.rb', line 6 def to_cert begin new_cert = self.class.send(:to_cert, self) rescue StandardError new_cert = false end new_cert end |
#to_cert! ⇒ Object
Similar to #to_cert, but raises an error unless the string can be explicitly parsed to an X509 certifcate.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/cert_munger/string.rb', line 18 def to_cert! begin new_cert = self.class.send(:to_cert, self) rescue StandardError raise UnparsableCertError, "Could not force conversion to X509:\n#{inspect}" end new_cert end |