Skip to content

Commit

Permalink
polyfill buffer in handleCertificate for mobile app
Browse files Browse the repository at this point in the history
  • Loading branch information
0xturboblitz committed Sep 19, 2024
1 parent cb9722c commit 11a7c40
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions common/src/utils/certificates/handleCertificate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import { parseRsaPublicKey, parseRsaPssPublicKey, parseECParameters } from './pu
import { PublicKeyDetailsRSAPSS } from './dataStructure';
import { getNamedCurve } from './curves';

if (typeof global.Buffer === 'undefined') {
global.Buffer = require('buffer').Buffer;
}

export function parseCertificate(pem: string) {
const cert = getCertificateFromPem(pem);
let { signatureAlgorithm, hashFunction } = getSignatureAlgorithmDetails(cert.signatureAlgorithm.algorithmId);
Expand Down

0 comments on commit 11a7c40

Please sign in to comment.