Class: Legion::Crypt::Spiffe::X509Svid

Inherits:
Struct
  • Object
show all
Defined in:
lib/legion/crypt/spiffe.rb

Overview

Parsed X.509 SVID (SPIFFE Verifiable Identity Document).

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bundle_pemObject

Returns the value of attribute bundle_pem

Returns:

  • (Object)

    the current value of bundle_pem



33
34
35
# File 'lib/legion/crypt/spiffe.rb', line 33

def bundle_pem
  @bundle_pem
end

#cert_pemObject

Returns the value of attribute cert_pem

Returns:

  • (Object)

    the current value of cert_pem



33
34
35
# File 'lib/legion/crypt/spiffe.rb', line 33

def cert_pem
  @cert_pem
end

#expiryObject

Returns the value of attribute expiry

Returns:

  • (Object)

    the current value of expiry



33
34
35
# File 'lib/legion/crypt/spiffe.rb', line 33

def expiry
  @expiry
end

#key_pemObject

Returns the value of attribute key_pem

Returns:

  • (Object)

    the current value of key_pem



33
34
35
# File 'lib/legion/crypt/spiffe.rb', line 33

def key_pem
  @key_pem
end

#sourceObject

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



33
34
35
# File 'lib/legion/crypt/spiffe.rb', line 33

def source
  @source
end

#spiffe_idObject

Returns the value of attribute spiffe_id

Returns:

  • (Object)

    the current value of spiffe_id



33
34
35
# File 'lib/legion/crypt/spiffe.rb', line 33

def spiffe_id
  @spiffe_id
end

Instance Method Details

#expired?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/legion/crypt/spiffe.rb', line 34

def expired?
  Time.now >= expiry
end

#ttlObject

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

Returns:

  • (Boolean)


38
39
40
# File 'lib/legion/crypt/spiffe.rb', line 38

def valid?
  !cert_pem.nil? && !key_pem.nil? && !expired?
end