writeAsymkeyAuth(id, authType, controller, publicKey)

Feature

Return authentication in type 'asymmetric key', an item in the did document.

Parameters

string authentication id, // did string + “#” + unique id "EcdsaSecp256k1VerificationKey2019" string controller, // did string string publicKey

Return Value

object authentication for asymmetric key

const did = "did:mitum:0x4526f3D0EdC63D9EaeCD94D56551e0f061CFCa47fca";
const id = did + "#auth_key5";
const authType = "EcdsaSecp256k1VerificationKey2019";
const controller = did;
const publicKey = "0359335c48c7b06d05cfba06c4d37aa0369069d5d5c036a6c7a098199e0650d3c8fpu";
const authentication = mitum.authdid.writeAsymkeyAuth(id, authType, controller, publicKey);

console.log(authentication);
// output
{
  _hint: 'mitum-did-asymmetric-key-authentication-v0.0.1',
  id: 'did:mitum:0x4526f3D0EdC63D9EaeCD94D56551e0f061CFCa47fca#auth_key5',
  authType: 'EcdsaSecp256k1VerificationKey2019',
  controller: 'did:mitum:0x4526f3D0EdC63D9EaeCD94D56551e0f061CFCa47fca',
  publicKey: '0359335c48c7b06d05cfba06c4d37aa0369069d5d5c036a6c7a098199e0650d3c8fpu'
}

Last updated