| Total Complexity | 4 |
| Total Lines | 18 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | # frozen_string_literal: true |
||
| 12 | class KeyPair |
||
| 13 | attr_accessor :type |
||
| 14 | attr_accessor :public_key |
||
| 15 | attr_accessor :private_key |
||
| 16 | attr_accessor :passphrase |
||
| 17 | attr_accessor :comment |
||
| 18 | |||
| 19 | def compute_private_key |
||
| 20 | klass = ::AMA::Chef::SSHPrivateKeys::Model::PrivateKey |
||
| 21 | klass.new(private_key, passphrase) |
||
| 22 | end |
||
| 23 | |||
| 24 | def compute_public_key |
||
| 25 | return nil unless public_key && type |
||
| 26 | klass = ::AMA::Chef::SSHPrivateKeys::Model::PublicKey |
||
| 27 | klass.new(type, public_key, comment) |
||
| 28 | end |
||
| 29 | end |
||
| 30 | end |
||
| 34 |