Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions common/src/utils/passports/genMockIdDoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,7 @@ function sign(
const msgHash = hash(hashAlgorithm, eContent, 'hex');

const signature = keyPair.sign(msgHash, 'hex');
// @ts-ignore-error toDer gives number[] what is fine for Buffer.from
const signatureBytes = Array.from(Buffer.from(signature.toDER(), 'hex'));

const signatureBytes = Array.from(signature.toDER() as number[]);
return signatureBytes;
} else {
const privKey = forge.pki.privateKeyFromPem(privateKeyPem);
Expand Down
4 changes: 1 addition & 3 deletions common/src/utils/passports/genMockPassportData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,7 @@ function sign(
const msgHash = hash(hashAlgorithm, eContent, 'hex');

const signature = keyPair.sign(msgHash, 'hex');
// @ts-ignore-error this seems wrong
const signatureBytes = Array.from(Buffer.from(signature.toDER(), 'hex'));

const signatureBytes = Array.from(signature.toDER() as number[]);
return signatureBytes;
} else {
const privKey = actualForge.pki.privateKeyFromPem(privateKeyPem);
Expand Down
Loading