Compute provisioning URL in separate function

This commit is contained in:
Evan Hahn 2021-06-07 11:27:02 -05:00 committed by GitHub
parent 6e2d0ff2ae
commit eaf4036fc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 45 additions and 7 deletions

View file

@ -0,0 +1,15 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { arrayBufferToBase64 } from '../Crypto';
export function getProvisioningUrl(
uuid: string,
publicKey: ArrayBuffer
): string {
const params = new URLSearchParams({
uuid,
pub_key: arrayBufferToBase64(publicKey),
});
return `tsdevice:/?${params.toString()}`;
}