UNPKG

@sphereon/ssi-sdk-ext.did-resolver-key

Version:

Sphereon did:key resolver with BBS+/BLS and EBSI support.

23 lines 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.keyToDidDoc = void 0; const index_1 = require("../index"); const ssi_sdk_ext_key_utils_1 = require("@sphereon/ssi-sdk-ext.key-utils"); const keyToDidDoc = ({ pubKeyBytes, fingerprint, contentType }) => { const did = `did:key:${fingerprint}`; const keyId = `${did}#${fingerprint}`; const publicKeyJwk = (0, ssi_sdk_ext_key_utils_1.jwkJcsDecode)(pubKeyBytes); return Object.assign(Object.assign({}, (contentType === index_1.DID_LD_JSON && { '@context': ['https://www.w3.org/ns/did/v1', 'https://w3id.org/security/suites/jws-2020/v1'], })), { id: did, verificationMethod: [ { id: keyId, type: 'JsonWebKey2020', controller: did, publicKeyJwk, }, ], authentication: [keyId], assertionMethod: [keyId], capabilityDelegation: [keyId], capabilityInvocation: [keyId] }); }; exports.keyToDidDoc = keyToDidDoc; exports.default = { keyToDidDoc: exports.keyToDidDoc }; //# sourceMappingURL=jwk.jcs.js.map