From 4dcbc448ff6da6966d0f11f9e61c8f0bd34377aa Mon Sep 17 00:00:00 2001 From: az Date: Sat, 10 Sep 2022 16:48:34 +0200 Subject: [PATCH] add missing class SshKeyPair --- .../provs/framework/ubuntu/keys/SshKeyPair.kt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/keys/SshKeyPair.kt diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/keys/SshKeyPair.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/keys/SshKeyPair.kt new file mode 100644 index 0000000..3e08a65 --- /dev/null +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/keys/SshKeyPair.kt @@ -0,0 +1,15 @@ +package org.domaindrivenarchitecture.provs.framework.ubuntu.keys + +import org.domaindrivenarchitecture.provs.framework.core.Secret + +class SshKeyPair(publicKey: Secret, privateKey: Secret) : KeyPair(publicKey, privateKey) { + + val keyType = publicKey.plain().substringBefore(" ") + + val sshAlgorithmName = + if (keyType.startsWith("ssh-")) { + keyType.removePrefix("ssh-") + } else { + "unknownKeyType" + } +} \ No newline at end of file