Class: OCI::Auth::Signers::EphemeralRPSessionKeySupplier
- Inherits:
-
Object
- Object
- OCI::Auth::Signers::EphemeralRPSessionKeySupplier
- Defined in:
- lib/oci/auth/signers/ephemeral_resource_principals_signer.rb
Overview
EphemeralRPSessionKeySupplier for containing key info
Instance Attribute Summary collapse
-
#session_key ⇒ Object
Returns the value of attribute session_key.
Instance Method Summary collapse
-
#initialize(private_key, private_key_passphrase) ⇒ EphemeralRPSessionKeySupplier
constructor
A new instance of EphemeralRPSessionKeySupplier.
- #refresh ⇒ Object
Constructor Details
#initialize(private_key, private_key_passphrase) ⇒ EphemeralRPSessionKeySupplier
Returns a new instance of EphemeralRPSessionKeySupplier.
113 114 115 116 117 118 119 |
# File 'lib/oci/auth/signers/ephemeral_resource_principals_signer.rb', line 113 def initialize(private_key, private_key_passphrase) raise 'Missing Resource Principal Private Key' if private_key.nil? @private_key = private_key @private_key_passphrase = private_key_passphrase refresh end |
Instance Attribute Details
#session_key ⇒ Object
Returns the value of attribute session_key.
111 112 113 |
# File 'lib/oci/auth/signers/ephemeral_resource_principals_signer.rb', line 111 def session_key @session_key end |
Instance Method Details
#refresh ⇒ Object
121 122 123 124 125 126 127 |
# File 'lib/oci/auth/signers/ephemeral_resource_principals_signer.rb', line 121 def refresh @session_key = if File.exist?(File.(@private_key)) OCI::Auth::Util.load_private_key_from_file(File.(@private_key), @private_key_passphrase) else OCI::Auth::Util.load_private_key(@private_key, @private_key_passphrase) end end |