Files
libsignal/node/ts/zkgroup/calllinks/CreateCallLinkCredentialPresentation.ts
2026-03-16 18:55:17 -07:00

37 lines
969 B
TypeScript

//
// Copyright 2023 Signal Messenger, LLC.
// SPDX-License-Identifier: AGPL-3.0-only
//
import ByteArray from '../internal/ByteArray.js';
import * as Native from '../../Native.js';
import CallLinkPublicParams from './CallLinkPublicParams.js';
import GenericServerSecretParams from '../GenericServerSecretParams.js';
export default class CreateCallLinkCredentialPresentation extends ByteArray {
private readonly __type?: never;
constructor(contents: Uint8Array<ArrayBuffer>) {
super(
contents,
Native.CreateCallLinkCredentialPresentation_CheckValidContents
);
}
verify(
roomId: Uint8Array<ArrayBuffer>,
serverParams: GenericServerSecretParams,
callLinkParams: CallLinkPublicParams,
now: Date = new Date()
): void {
Native.CreateCallLinkCredentialPresentation_Verify(
this.contents,
roomId,
Math.floor(now.getTime() / 1000),
serverParams.contents,
callLinkParams.contents
);
}
}