2021-06-07 16:27:02 +00:00
|
|
|
// Copyright 2021 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import { arrayBufferToBase64 } from '../Crypto';
|
|
|
|
|
|
|
|
export function getProvisioningUrl(
|
|
|
|
uuid: string,
|
|
|
|
publicKey: ArrayBuffer
|
|
|
|
): string {
|
2021-09-09 22:08:19 +00:00
|
|
|
const url = new URL('sgnl://linkdevice');
|
|
|
|
url.searchParams.set('uuid', uuid);
|
|
|
|
url.searchParams.set('pub_key', arrayBufferToBase64(publicKey));
|
|
|
|
return url.toString();
|
2021-06-07 16:27:02 +00:00
|
|
|
}
|