diff --git a/libs/importer/src/importers/onepassword/onepassword-1pux-importer.ts b/libs/importer/src/importers/onepassword/onepassword-1pux-importer.ts index 34af24fe228..334da0cd473 100644 --- a/libs/importer/src/importers/onepassword/onepassword-1pux-importer.ts +++ b/libs/importer/src/importers/onepassword/onepassword-1pux-importer.ts @@ -6,6 +6,7 @@ import { IdentityView } from "@bitwarden/common/vault/models/view/identity.view" import { LoginView } from "@bitwarden/common/vault/models/view/login.view"; import { PasswordHistoryView } from "@bitwarden/common/vault/models/view/password-history.view"; import { SecureNoteView } from "@bitwarden/common/vault/models/view/secure-note.view"; +import { SSHKeyView } from "@bitwarden/common/vault/models/view/ssh-key.view"; import { ImportResult } from "../../models/import-result"; import { BaseImporter } from "../base-importer"; @@ -78,6 +79,10 @@ export class OnePassword1PuxImporter extends BaseImporter implements Importer { cipher.type = CipherType.Identity; cipher.identity = new IdentityView(); break; + case CategoryEnum.SSH_Key: + cipher.type = CipherType.SSHKey; + cipher.sshKey = new SSHKeyView(); + break; default: break; } @@ -314,6 +319,14 @@ export class OnePassword1PuxImporter extends BaseImporter implements Importer { default: break; } + } else if (cipher.type === CipherType.SSHKey) { + if (valueKey === "sshKey") { + const { privateKey, metadata } = field.value.sshKey; + cipher.sshKey.privateKey = privateKey; + cipher.sshKey.publicKey = metadata.publicKey; + cipher.sshKey.keyFingerprint = metadata.fingerprint; + return; + } } if (valueKey === "email") {