Class: Saml::Kit::Cli::GenerateKeyPair
- Inherits:
-
Object
- Object
- Saml::Kit::Cli::GenerateKeyPair
- Defined in:
- lib/saml/kit/cli/generate_key_pair.rb
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#passphrase ⇒ Object
readonly
Returns the value of attribute passphrase.
Instance Method Summary collapse
-
#initialize(passphrase:, format:) ⇒ GenerateKeyPair
constructor
A new instance of GenerateKeyPair.
- #run(shell) ⇒ Object
Constructor Details
#initialize(passphrase:, format:) ⇒ GenerateKeyPair
Returns a new instance of GenerateKeyPair.
9 10 11 12 |
# File 'lib/saml/kit/cli/generate_key_pair.rb', line 9 def initialize(passphrase:, format:) @passphrase = passphrase @format = format end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
7 8 9 |
# File 'lib/saml/kit/cli/generate_key_pair.rb', line 7 def format @format end |
#passphrase ⇒ Object (readonly)
Returns the value of attribute passphrase.
7 8 9 |
# File 'lib/saml/kit/cli/generate_key_pair.rb', line 7 def passphrase @passphrase end |
Instance Method Details
#run(shell) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/saml/kit/cli/generate_key_pair.rb', line 14 def run(shell) certificate, private_key = generate if pem? shell.say certificate shell.say private_key else shell.say 'X509_CERTIFICATE=' + certificate.inspect shell.say 'PRIVATE_KEY=' + private_key.inspect end shell.say 'Private Key Passphrase:', :green shell.say passphrase.inspect end |