mirror of
https://github.com/bitwarden/browser
synced 2026-02-25 09:03:28 +00:00
Move into @bitwarden/key-management
This commit is contained in:
@@ -52,7 +52,6 @@ import { SearchPipe } from "./pipes/search.pipe";
|
||||
import { UserNamePipe } from "./pipes/user-name.pipe";
|
||||
import { UserTypePipe } from "./pipes/user-type.pipe";
|
||||
import { EllipsisPipe } from "./platform/pipes/ellipsis.pipe";
|
||||
import { FingerprintPipe } from "./platform/pipes/fingerprint.pipe";
|
||||
import { I18nPipe } from "./platform/pipes/i18n.pipe";
|
||||
import { PasswordStrengthComponent } from "./tools/password-strength/password-strength.component";
|
||||
import { IconComponent } from "./vault/components/icon.component";
|
||||
@@ -111,7 +110,6 @@ import { IconComponent } from "./vault/components/icon.component";
|
||||
PasswordStrengthComponent,
|
||||
UserTypePipe,
|
||||
IfFeatureDirective,
|
||||
FingerprintPipe,
|
||||
AddAccountCreditDialogComponent,
|
||||
InvoicesComponent,
|
||||
NoInvoicesComponent,
|
||||
@@ -146,7 +144,6 @@ import { IconComponent } from "./vault/components/icon.component";
|
||||
PasswordStrengthComponent,
|
||||
UserTypePipe,
|
||||
IfFeatureDirective,
|
||||
FingerprintPipe,
|
||||
AddAccountCreditDialogComponent,
|
||||
InvoicesComponent,
|
||||
NoInvoicesComponent,
|
||||
@@ -161,7 +158,6 @@ import { IconComponent } from "./vault/components/icon.component";
|
||||
SearchPipe,
|
||||
UserNamePipe,
|
||||
UserTypePipe,
|
||||
FingerprintPipe,
|
||||
PluralizePipe,
|
||||
],
|
||||
})
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
import { Pipe } from "@angular/core";
|
||||
|
||||
import { Utils } from "@bitwarden/common/platform/misc/utils";
|
||||
import { KeyService } from "@bitwarden/key-management";
|
||||
|
||||
@Pipe({
|
||||
name: "fingerprint",
|
||||
})
|
||||
export class FingerprintPipe {
|
||||
constructor(private keyService: KeyService) {}
|
||||
|
||||
async transform(publicKey: string | Uint8Array, fingerprintMaterial: string): Promise<string> {
|
||||
try {
|
||||
if (typeof publicKey === "string") {
|
||||
publicKey = Utils.fromB64ToArray(publicKey);
|
||||
}
|
||||
|
||||
const fingerprint = await this.keyService.getFingerprint(fingerprintMaterial, publicKey);
|
||||
|
||||
if (fingerprint != null) {
|
||||
return fingerprint.join("-");
|
||||
}
|
||||
|
||||
return "";
|
||||
} catch {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user