Skip to content

Commit

Permalink
Merge pull request #193 from wwWallet/generate-proof-param-order
Browse files Browse the repository at this point in the history
Flip parameter order of generateOpenid4vciProof to match sibling functions
  • Loading branch information
emlun authored Mar 27, 2024
2 parents fd02c13 + df5fbfc commit f837907
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/services/LocalStorageKeystore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export interface LocalStorageKeystore {

createIdToken(nonce: string, audience: string): Promise<{ id_token: string; }>,
signJwtPresentation(nonce: string, audience: string, verifiableCredentials: any[]): Promise<{ vpjwt: string }>,
generateOpenid4vciProof(audience: string, nonce: string): Promise<{ proof_jwt: string }>,
generateOpenid4vciProof(nonce: string, audience: string): Promise<{ proof_jwt: string }>,
}

export function useLocalStorageKeystore(): LocalStorageKeystore {
Expand Down Expand Up @@ -812,7 +812,7 @@ export function useLocalStorageKeystore(): LocalStorageKeystore {
return { vpjwt: jws };
},

generateOpenid4vciProof: async (audience: string, nonce: string): Promise<{ proof_jwt: string }> => {
generateOpenid4vciProof: async (nonce: string, audience: string): Promise<{ proof_jwt: string }> => {
const [{ alg, did, wrappedPrivateKey }, sessionKey] = await openPrivateData();
const privateKey = await unwrapPrivateKey(wrappedPrivateKey, sessionKey);
const header = {
Expand Down
2 changes: 1 addition & 1 deletion src/services/SigningRequestHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function SigningRequestHandlerService(): SigningRequestHandlers {
},

handleGenerateOpenid4vciProofSigningRequest: async (socket, keystore, { message_id, audience, nonce }) => {
const { proof_jwt } = await keystore.generateOpenid4vciProof(audience, nonce)
const { proof_jwt } = await keystore.generateOpenid4vciProof(nonce, audience)
console.log("proof jwt = ", proof_jwt);
const outgoingMessage: ClientSocketMessage = {
message_id: message_id,
Expand Down
2 changes: 1 addition & 1 deletion src/types/shared.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export enum SignatureAction {
}

export type WalletKeystoreRequest = (
{ action: SignatureAction.generateOpenid4vciProof, audience: string, nonce: string }
{ action: SignatureAction.generateOpenid4vciProof, nonce: string, audience: string }
| { action: SignatureAction.createIdToken, nonce: string, audience: string }
| { action: SignatureAction.signJwtPresentation, nonce: string, audience: string, verifiableCredentials: any[] }
);
Expand Down

0 comments on commit f837907

Please sign in to comment.