mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
fix: params
This commit is contained in:
parent
f1ef7e9304
commit
1250703952
@ -47,14 +47,14 @@ export async function signCredential(
|
|||||||
publicKeyHex: string
|
publicKeyHex: string
|
||||||
): Promise<SignedCredential> {
|
): Promise<SignedCredential> {
|
||||||
try {
|
try {
|
||||||
const key = await importJWK(issuerKeyJWK, 'ES256K')
|
const key = await importJWK(issuerKeyJWK, issuerKeyJWK.alg)
|
||||||
|
|
||||||
const jws = await new SignJWT(verifiableCredential as unknown as JWTPayload)
|
const jws = await new SignJWT(verifiableCredential as unknown as JWTPayload)
|
||||||
.setProtectedHeader({ alg: 'ES256K' })
|
.setProtectedHeader({ alg: issuerKeyJWK.alg })
|
||||||
.setIssuedAt()
|
.setIssuedAt()
|
||||||
.setIssuer(publicKeyHex)
|
.setIssuer(publicKeyHex)
|
||||||
.sign(key)
|
.sign(key)
|
||||||
const header = { alg: 'ES256K' }
|
const header = { alg: issuerKeyJWK.alg }
|
||||||
|
|
||||||
return { jws, header, issuer: publicKeyHex }
|
return { jws, header, issuer: publicKeyHex }
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user