Class: Gitlab::Ci::SecureFiles::P12
- Inherits:
-
Object
- Object
- Gitlab::Ci::SecureFiles::P12
- Includes:
- Utils::StrongMemoize
- Defined in:
- lib/gitlab/ci/secure_files/p12.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
- #certificate_data ⇒ Object
-
#initialize(filedata, password = nil) ⇒ P12
constructor
A new instance of P12.
- #metadata ⇒ Object
Constructor Details
#initialize(filedata, password = nil) ⇒ P12
Returns a new instance of P12.
11 12 13 14 |
# File 'lib/gitlab/ci/secure_files/p12.rb', line 11 def initialize(filedata, password = nil) @filedata = filedata @password = password end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
9 10 11 |
# File 'lib/gitlab/ci/secure_files/p12.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/p12.rb', line 16 def certificate_data OpenSSL::PKCS12.new(@filedata, @password).certificate rescue OpenSSL::PKCS12::PKCS12Error => 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/p12.rb', line 24 def return {} unless certificate_data { issuer: issuer, subject: subject, id: serial, expires_at: expires_at } end |