Class: Gitlab::Ci::SecureFiles::Cer
- Inherits:
-
Object
- Object
- Gitlab::Ci::SecureFiles::Cer
- Includes:
- Utils::StrongMemoize
- Defined in:
- lib/gitlab/ci/secure_files/cer.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
- #certificate_data ⇒ Object
-
#initialize(filedata) ⇒ Cer
constructor
A new instance of Cer.
- #metadata ⇒ Object
Constructor Details
#initialize(filedata) ⇒ Cer
Returns a new instance of Cer.
11 12 13 14 |
# File 'lib/gitlab/ci/secure_files/cer.rb', line 11 def initialize(filedata) @filedata = filedata @error = nil end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
9 10 11 |
# File 'lib/gitlab/ci/secure_files/cer.rb', line 9 def error @error end |
Instance Method Details
#certificate_data ⇒ Object
16 17 18 19 20 21 |
# File 'lib/gitlab/ci/secure_files/cer.rb', line 16 def certificate_data OpenSSL::X509::Certificate.new(@filedata) rescue OpenSSL::X509::CertificateError => err @error = err.to_s nil end |
#metadata ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/gitlab/ci/secure_files/cer.rb', line 24 def return {} unless certificate_data { issuer: issuer, subject: subject, id: id, expires_at: expires_at } end |