toPublicKeyJwk method

VerificationMethod toPublicKeyJwk()

Convert a multibase key to Json web Key

Implementation

VerificationMethod toPublicKeyJwk() {
  if (publicKeyMultibase != null) {
    var pkJwk = multibaseKeyToJwk(publicKeyMultibase!);
    pkJwk['kid'] = id;
    return VerificationMethod(
        id: id,
        controller: controller,
        type: 'JsonWebKey2020',
        publicKeyJwk: pkJwk);
  } else if (publicKeyJwk != null) {
    return this;
  } else {
    throw Exception('Cant find key in this Verification Method');
  }
}