mirror of
https://github.com/signalapp/libsignal.git
synced 2026-04-25 17:25:18 +02:00
This allows the file to be checked by tsc, which would have caught some of the missing type aliases sooner (now added to Native.ts.in). Strictly speaking the behavior is slightly different: we have returned to exporting many items individually instead of collecting them on a single object. Co-authored-by: Alex Bakon <akonradi@signal.org>
35 lines
923 B
TypeScript
35 lines
923 B
TypeScript
//
|
|
// Copyright 2020-2022 Signal Messenger, LLC.
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
//
|
|
|
|
import ByteArray from '../internal/ByteArray.js';
|
|
import * as Native from '../../Native.js';
|
|
import UuidCiphertext from '../groups/UuidCiphertext.js';
|
|
|
|
export default class AuthCredentialPresentation extends ByteArray {
|
|
private readonly __type?: never;
|
|
|
|
constructor(contents: Uint8Array) {
|
|
super(contents, Native.AuthCredentialPresentation_CheckValidContents);
|
|
}
|
|
|
|
getUuidCiphertext(): UuidCiphertext {
|
|
return new UuidCiphertext(
|
|
Native.AuthCredentialPresentation_GetUuidCiphertext(this.contents)
|
|
);
|
|
}
|
|
|
|
getPniCiphertext(): UuidCiphertext {
|
|
return new UuidCiphertext(
|
|
Native.AuthCredentialPresentation_GetPniCiphertext(this.contents)
|
|
);
|
|
}
|
|
|
|
getRedemptionTime(): Date {
|
|
return new Date(
|
|
1000 * Native.AuthCredentialPresentation_GetRedemptionTime(this.contents)
|
|
);
|
|
}
|
|
}
|