Class: Legion::Crypt::Spiffe::X509Svid
- Inherits:
-
Struct
- Object
- Struct
- Legion::Crypt::Spiffe::X509Svid
- Defined in:
- lib/legion/crypt/spiffe.rb
Overview
Parsed X.509 SVID (SPIFFE Verifiable Identity Document).
Instance Attribute Summary collapse
-
#bundle_pem ⇒ Object
Returns the value of attribute bundle_pem.
-
#cert_pem ⇒ Object
Returns the value of attribute cert_pem.
-
#expiry ⇒ Object
Returns the value of attribute expiry.
-
#key_pem ⇒ Object
Returns the value of attribute key_pem.
-
#source ⇒ Object
Returns the value of attribute source.
-
#spiffe_id ⇒ Object
Returns the value of attribute spiffe_id.
Instance Method Summary collapse
- #expired? ⇒ Boolean
-
#ttl ⇒ Object
Seconds remaining until expiry (negative if already expired).
- #valid? ⇒ Boolean
Instance Attribute Details
#bundle_pem ⇒ Object
Returns the value of attribute bundle_pem
33 34 35 |
# File 'lib/legion/crypt/spiffe.rb', line 33 def bundle_pem @bundle_pem end |
#cert_pem ⇒ Object
Returns the value of attribute cert_pem
33 34 35 |
# File 'lib/legion/crypt/spiffe.rb', line 33 def cert_pem @cert_pem end |
#expiry ⇒ Object
Returns the value of attribute expiry
33 34 35 |
# File 'lib/legion/crypt/spiffe.rb', line 33 def expiry @expiry end |
#key_pem ⇒ Object
Returns the value of attribute key_pem
33 34 35 |
# File 'lib/legion/crypt/spiffe.rb', line 33 def key_pem @key_pem end |
#source ⇒ Object
Returns the value of attribute source
33 34 35 |
# File 'lib/legion/crypt/spiffe.rb', line 33 def source @source end |
#spiffe_id ⇒ Object
Returns the value of attribute spiffe_id
33 34 35 |
# File 'lib/legion/crypt/spiffe.rb', line 33 def spiffe_id @spiffe_id end |
Instance Method Details
#expired? ⇒ Boolean
34 35 36 |
# File 'lib/legion/crypt/spiffe.rb', line 34 def expired? Time.now >= expiry end |
#ttl ⇒ Object
Seconds remaining until expiry (negative if already expired).
43 44 45 |
# File 'lib/legion/crypt/spiffe.rb', line 43 def ttl expiry - Time.now end |
#valid? ⇒ Boolean
38 39 40 |
# File 'lib/legion/crypt/spiffe.rb', line 38 def valid? !cert_pem.nil? && !key_pem.nil? && !expired? end |