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