{"_id":"@aomi/one-did-resolver","_rev":"1-1d818fb80a2a6db354be716d04054c88","name":"@aomi/one-did-resolver","dist-tags":{"latest":"0.0.0-Alpha.2"},"versions":{"0.0.0-Alpha.1":{"name":"@aomi/one-did-resolver","version":"0.0.0-Alpha.1","repository":{"type":"git","url":"git@github.com:aomi-blockchain/one-did-resolver.git"},"author":{"name":"尼古拉斯丶少","email":"sean.snow@live.com"},"license":"MIT","main":"./lib/index.js","exports":{".":"./lib/index.js"},"scripts":{"build":"tsc -d","watch":"tsc -d && tsc -w","prepublishOnly":"yarn build"},"dependencies":{"did-resolver":"^3.2.0","dids":"^2.4.3","multibase":"^4.0.6","varint":"^6.0.0"},"devDependencies":{"@types/varint":"^6.0.0","typescript":"^4.6.3"},"description":"提供自定义标识的DID","licenseText":"MIT License\n\nCopyright (c) 2022 aomi-blockchain\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@aomi/one-did-resolver@0.0.0-Alpha.1","dist":{"shasum":"b78b12bc164ee29db9bef08fe52032b494a779e1","integrity":"sha512-qV+4Uo3/IEA6nz65hmBm01PbWsrMWDUYV0Go8+Xh1TtklI+7pwP0nZFaX2C3wNHMg6qLWp2ARUEWgB+c3Z2rjw==","tarball":"https://registry.npmjs.org/@aomi/one-did-resolver/-/one-did-resolver-0.0.0-Alpha.1.tgz","fileCount":33,"unpackedSize":16059,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyEyWJO52+6de56soaZlz28KIp5CqGloo9RnLlJZJ2VQIgdD8ZO/qK6wer9kMxmdLJ8n35OiDGaMhzv+PNVCa8fAA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiV9yhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0yA//ab/CN5tmb0L9NNmlWSAkGSfxulgr0Bl6HNMnLypeciNBu9p3\r\nyVITi0gsVE3EJbr4xTCMVwTwzOzUeofIjZcTn33BPKVVyXkWqzw8og41JTJB\r\nMyQjUtCcJnvyp0XS2oLjiN7+uJmt9pZfk+ug+b9b7HtlwGfz7x+g4ZVjzUsC\r\nkQYL7UxcxVqpOj/rVFTor4VWln8acdBIWxKnlN1+NNKTWPcZqFu9rwBiFEtj\r\nHvwW0+oRY8VYO9OAEqvjxBIK5Nm+1QyHQrg0zdC4z++JmqxwmXYLOz8MB+oM\r\nFt5e5QFQCo1vyJYOWkBLwNHPxcr84DSn7C96jKxUXSXOqCdi0i/yzgfiI/6I\r\nPkd6ce8XtCRH/ZEBGckvNi0OL/rR3bnkjY2NGlxks1PM0XsOQZfkqvC+None\r\nd/ccNHYjTRSEZv05fr0q14P2aIpG9rD0m/NRyD8CbSycCMeCOIWLUgijtt6p\r\nLW4te8Dj2YFAuRHaJtNkl+wHqOdm47iHkGs6NDJwwum3ZHRBE78MJbz4gwQC\r\ng04W1KAFZukIJCvBEyYsk8tcCPCkPScAHr+N7gsS+TLy9YNeXFw3qFze4pkt\r\nX7sCtbvkMO3A9067jX0fBDxzi6Q6ILESvVXzhc6XIM73tbE4y5RrffxIyz12\r\nNdACXlpDDK5v+ZiTpYMGo6s3EbqOAcvRKuE=\r\n=iyZn\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"sean-tian","email":"sean.snow@live.com"},"directories":{},"maintainers":[{"name":"sean-tian","email":"sean.snow@live.com"},{"name":"happysuns","email":"873241789@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/one-did-resolver_0.0.0-Alpha.1_1649925280835_0.6503531899968558"},"_hasShrinkwrap":false},"0.0.0-Alpha.2":{"name":"@aomi/one-did-resolver","version":"0.0.0-Alpha.2","repository":{"type":"git","url":"git@github.com:aomi-blockchain/one-did-resolver.git"},"author":{"name":"尼古拉斯丶少","email":"sean.snow@live.com"},"license":"MIT","main":"./lib/index.js","scripts":{"build":"tsc -d","watch":"tsc -d && tsc -w","prepublishOnly":"yarn build"},"dependencies":{"did-resolver":"^3.2.0","dids":"^2.4.3","multibase":"^4.0.6","varint":"^6.0.0"},"devDependencies":{"@types/varint":"^6.0.0","typescript":"^4.6.3"},"description":"提供自定义标识的DID","licenseText":"MIT License\n\nCopyright (c) 2022 aomi-blockchain\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@aomi/one-did-resolver@0.0.0-Alpha.2","dist":{"shasum":"0b23291eba0a4f1297da4cbfb68fbf2f839ca429","integrity":"sha512-R3NMIIJU1cc3l/B1U3WVlmF9NC8eguo/w5iU4uiBaQOGMHZjPfDSm7tRf+lYTrvaonTJlIWsu/7cHYgjhJg/ug==","tarball":"https://registry.npmjs.org/@aomi/one-did-resolver/-/one-did-resolver-0.0.0-Alpha.2.tgz","fileCount":24,"unpackedSize":12201,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDgygVSL6vegPUUlN3rRvZ9xnLQP0sQhqcp/W+kx+ESRAiAS+FF6LgFEG/TQuC2IUIQR+MD7TtYjuS5qDcabKgvTJA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiV+YrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrHmg/9EpC6ckxkgbJQOoimY18Jc2PRPClDUjOJ4TB8kjvQxAJoLXQM\r\nYp7DIzj5JizK/OFPMpUF+YZOY0NHMM6Hew/Uet5kyIl2tIUhBM09/Ldj76FW\r\nIDHxfPIPMquTLo9l++6N05sgWoCZK7Skt8AYFY/Fekgn2wxm01QVnbN1pkN2\r\nXjPkXc/1kP1qMwg7dDKwNzlLd35I8Jryn+Qxz2iguI4tPyf+ShhtBG0XbTtl\r\n6l/Bry0QSomKetOiEx+ahi1pUbTVXEVJFOHNdjxrI9crbjSOhfk3Jq+5xDyq\r\njQ5ehh8xZdW7tEzSMMTYG/f9nWm1mWuVi5nSeWswJgGTfeqMHMzZbEt8qTr5\r\nJNluJ/ljNiW3tEmDEF6roh4f1KZjz4+cRgN2dcgXzCtVvN0W8/EgZKha+Mnf\r\nBPE7kh152l8yAnZ0vNirI35C5O2MwPOKAryZooBxetXMQEnczrTe5YWpLt+S\r\nauIgIOIfGGmJS+f50o78B8bQ0uoSZFfDd4UKijt7rfZMet9o/NdR2oBEhuKM\r\nSK1tAictHymnTTKLcxKDVlEE0LvMWn7rSp/UiTB27BTU9itIaguOY4xNia3x\r\n7Jkny8bD9yNGF0lNT2jqtc7lmsOm8Z6O4FD/D5oZtMph+HS2bnQK4S4SQma5\r\nlrkOrfkGFv7iXyGyVot9zcDLp8efPuCWPpY=\r\n=HOiU\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"sean-tian","email":"sean.snow@live.com"},"directories":{},"maintainers":[{"name":"sean-tian","email":"sean.snow@live.com"},{"name":"happysuns","email":"873241789@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/one-did-resolver_0.0.0-Alpha.2_1649927723126_0.5714838221854295"},"_hasShrinkwrap":false}},"time":{"created":"2022-04-14T08:34:40.772Z","0.0.0-Alpha.1":"2022-04-14T08:34:40.972Z","modified":"2022-04-14T09:15:23.344Z","0.0.0-Alpha.2":"2022-04-14T09:15:23.257Z"},"maintainers":[{"name":"sean-tian","email":"sean.snow@live.com"},{"name":"happysuns","email":"873241789@qq.com"}],"description":"提供自定义标识的DID","repository":{"type":"git","url":"git@github.com:aomi-blockchain/one-did-resolver.git"},"author":{"name":"尼古拉斯丶少","email":"sean.snow@live.com"},"license":"MIT","readme":"# One Did Provider\n\n提供自定义标识的DID\n\n### Installation\n```\nnpm install @aomi/one-did-provider\n// or\nyarn add @aomi/one-did-provider\n```\n\n### Providers\n\n#### OneEd25519Provider\n\n基于`OneEd25519Provider`封装的DID。\n\n原ED25519 DID 结构\n```\ndid:key:z${base58(publicKey)}\n```\nOne ED25519 DID 结构\n```\ndid:one:${base64(flag)}.z${base58(publicKey)}\n```\n\n```typescript\nimport { OneEd25519Provider } from '@aomi/one-did-provider'\nimport KeyResolver from 'key-did-resolver'\nimport { DID } from 'dids'\n\nconst seed = new Uint8Array(...) //  32 bytes with high entropy\nconst provider = new OneEd25519Provider('master app',seed)\nconst did = new DID({ provider, resolver: KeyResolver.getResolver() })\nawait did.authenticate()\n\n// log the DID\nconsole.log(did.id)\n\n// create JWS\nconst { jws, linkedBlock } = await did.createDagJWS({ hello: 'world' })\n\n// verify JWS\nawait did.verifyJWS(jws)\n\n// create JWE\nconst jwe = await did.createDagJWE({ very: 'secret' }, [did.id])\n\n// decrypt JWE\nconst decrypted = await did.decryptDagJWE(jwe)\n\n```\n\n","readmeFilename":"README.md"}