did-auth-lowversion
v1.0.1
Published
const finDID = require('did-auth-lowversion');
Downloads
2
Readme
const finDID = require('did-auth-lowversion');
async function test() {
const privateKey = 'your publicKey'; const data = {'key1':'value1', 'key2':'value2'}; const JsonData = JSON.stringify(data); const keyType = 'EcdsaSecp256k1RecoveryMethod2020 or 2019' /* findid sign */ const signature = await finDID.sign(JsonData, keyType, privateKey)
const authInfo = {
'did':'did:kt:...',
'pubKeyID':'did:kt:..#key-..',
'pubKey':{'keyType':'EcdsaSecp256k1RecoveryMethod2020 or 2019','pubKeyData':'your publicKey'},
'signature': signature.signature,
'data':JsonData
};
/* findid auth */ const isValid = await finDID.didAuth(authInfo.pubKey,authInfo.signature,authInfo.data); console.log(isValid); }
test();