mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-07 20:53:54 -05:00
[INJIMOB-3546] fix es256 based kb-jwt signing for ios ovp (#2085)
Signed-off-by: Abhishek Paul <paul.apaul.abhishek.ap@gmail.com>
This commit is contained in:
@@ -182,8 +182,17 @@ export const openID4VPServices = () => {
|
||||
const header = JSON.parse(atob(unsignedKBJWT.split('.')[0]));
|
||||
const alg = header.alg;
|
||||
const keyType = JWT_ALG_TO_KEY_TYPE[alg];
|
||||
|
||||
let privateKey: string;
|
||||
|
||||
if (keyType === KeyTypes.ED25519) {
|
||||
privateKey = context.privateKey;
|
||||
} else {
|
||||
const keypair = await fetchKeyPair(keyType);
|
||||
privateKey = keypair.privateKey;
|
||||
}
|
||||
const signature = await createSignature(
|
||||
context.privateKey,
|
||||
privateKey,
|
||||
unsignedKBJWT,
|
||||
keyType,
|
||||
);
|
||||
@@ -203,4 +212,3 @@ export const openID4VPServices = () => {
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user