This commit is contained in:
turnoffthiscomputer
2024-12-14 12:29:09 +01:00
parent c5c4dd157e
commit 1e0ec4a053
5 changed files with 25 additions and 9 deletions

View File

@@ -94,6 +94,20 @@ export const getCircuitName = (
keyLength
);
};
export const getCircuitNameOld = (circuitMode: Mode, signatureAlgorithm: string, hashFunction: string) => {
const circuit = circuitNameFromMode[circuitMode];
if (circuit == 'vc_and_disclose') {
return 'vc_and_disclose';
}
else if (signatureAlgorithm === 'ecdsa') {
return circuit + "_" + signatureAlgorithm + "_secp256r1_" + hashFunction;
}
else {
return circuit + "_" + signatureAlgorithm + "_65537_" + hashFunction;
}
}
export function getSignatureAlgorithmDetails(oid: string): {
signatureAlgorithm: string;

View File

@@ -1,6 +1,6 @@
{
"name": "@openpassport/core",
"version": "0.0.11",
"version": "0.0.12",
"main": "dist/sdk/core/index.js",
"types": "dist/sdk/core/index.d.ts",
"license": "MIT",

View File

@@ -18,7 +18,7 @@ import {
vkey_dsc_rsapss_65537_sha256,
vkey_vc_and_disclose,
} from '../../../common/src/constants/vkey';
import { getCircuitName } from '../../../common/src/utils/certificates/handleCertificate';
import { getCircuitNameOld } from '../../../common/src/utils/certificates/handleCertificate';
import { Mode } from 'fs';
export function getCurrentDateFormatted() {
@@ -35,7 +35,7 @@ export function getVkeyFromArtifacts(
if (circuit === 'vc_and_disclose') {
circuitName = circuit;
} else {
circuitName = getCircuitName(circuit, signatureAlgorithm, hashFunction);
circuitName = getCircuitNameOld(circuit, signatureAlgorithm, hashFunction);
}
// console.log('\x1b[90m%s\x1b[0m', 'circuit name:', circuitName);
switch (circuitName) {

View File

@@ -1,6 +1,6 @@
{
"name": "@openpassport/qrcode",
"version": "0.0.14",
"version": "0.0.15",
"main": "dist/sdk/qrcode/index.js",
"types": "dist/sdk/qrcode/index.d.ts",
"license": "MIT",
@@ -10,7 +10,7 @@
},
"author": "turnoffthiscomputer",
"dependencies": {
"@openpassport/core": "0.0.11",
"@openpassport/core": "0.0.12",
"@types/react": "^18.3.4",
"@types/react-dom": "^18.3.0",
"@types/uuid": "^10.0.0",

View File

@@ -1,17 +1,19 @@
'use client';
import { OpenPassportQRcode } from '@openpassport/qrcode';
// import { OpenPassportQRcode } from '../../../../../qrcode/index';
import { OpenPassportVerifier } from '@openpassport/core';
import { v4 as uuidv4 } from 'uuid';
import { OpenPassportVerifier, OpenPassportDynamicAttestation } from '@openpassport/core';
// import { OpenPassportVerifier, OpenPassportDynamicAttestation } from '@openpassport/core';
// import { OpenPassportVerifier, OpenPassportDynamicAttestation } from '@openpassport/core';
export default function Prove() {
const userId = uuidv4();
const scope = 'scope';
const openPassportVerifier: OpenPassportVerifier = new OpenPassportVerifier('prove_onchain', scope)
const openPassportVerifier: OpenPassportVerifier = new OpenPassportVerifier('prove_offchain', scope)
.enableOFACCheck()
.excludeCountries('Iran (Islamic Republic of)');
.excludeCountries('Iran (Islamic Republic of)').setMinimumAge(55).allowMockPassports();
return (
<div className="h-screen w-full bg-white flex flex-col items-center justify-center gap-4">