Update libsignal to v0.59.0, add support for mock server test with libsignal

Co-authored-by: trevor-signal <trevor@signal.org>
Co-authored-by: Fedor Indutny <indutny@signal.org>
This commit is contained in:
andrew-signal 2024-10-21 15:27:58 -04:00 committed by GitHub
parent 4d3c6beed9
commit 9c99796937
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 371 additions and 23 deletions

11
ts/util/pemToDer.ts Normal file
View file

@ -0,0 +1,11 @@
// Copyright 2024 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
export function pemToDer(pem: string): Buffer {
const pemContent = pem
.replace(/-----BEGIN [^-]+-----/, '')
.replace(/-----END [^-]+-----/, '')
.replace(/\s+/g, '');
const derBuffer = Buffer.from(pemContent, 'base64');
return derBuffer;
}