mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 13:38:01 -05:00
[INJIMOB-3153]: update logic to only send signature for both android and ios for es256 signature creation (#1928)
* [INJIMOB-3153]: update logic to only send signature for both android and ios for es256 signature creation Signed-off-by: Alka Prasad <prasadalka1998@gmail.com> * [INJIMOB-3153]: rename variables Signed-off-by: Alka Prasad <prasadalka1998@gmail.com> * [INJIMOB-3153]: rename variables Signed-off-by: Alka Prasad <prasadalka1998@gmail.com> --------- Signed-off-by: Alka Prasad <prasadalka1998@gmail.com>
This commit is contained in:
@@ -198,7 +198,6 @@ export async function getJWT(
|
||||
header,
|
||||
payLoad,
|
||||
);
|
||||
if (keyType == KeyTypes.ES256 && isIOS()) return signature64;
|
||||
return header64 + '.' + payLoad64 + '.' + signature64;
|
||||
} catch (error) {
|
||||
console.error('Exception Occurred While Constructing JWT ', error);
|
||||
@@ -299,8 +298,12 @@ export async function createSignatureECR1(
|
||||
{format: 'compact', fields: header},
|
||||
{key, reference: false},
|
||||
);
|
||||
const jws = await signer.update(JSON.stringify(payload)).final();
|
||||
return jws;
|
||||
const jws = await signer.update(JSON.stringify(payload), 'base64').final();
|
||||
const jwsParts = jws.split('.');
|
||||
if (jwsParts.length !== 3) {
|
||||
throw new Error('Invalid JWS format');
|
||||
}
|
||||
return jwsParts[2];
|
||||
}
|
||||
|
||||
export function replaceCharactersInB64(encodedB64: string) {
|
||||
|
||||
Reference in New Issue
Block a user