Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
did-document
Advanced tools
DID documents contain a set of data that describes a DID, including mechanisms, such as public keys and pseudonymous biometrics, that an entity can use to authenticate itself as the DID. A DID Document may also contain other attributes or claims describing the entity. These documents are graph-based data structures that are typically expressed using JSON-LD, but may be expressed using other compatible graph-based data formats.
This project is in active development.
Stability: 1 - Experimental. These features are still under active development and subject to non-backwards compatible changes, or even removal, in any future version. Use of the feature is not recommended in production environments. Experimental features are not subject to the Node.js Semantic Versioning model.
$ npm install arablocks/did-document
const { DIDDocument } = require('did-document')
const did = 'did:ara:701012c34fc3c883c4b61dfae06568483c5ae6c81020767ee536a9ba6300792b'
// create a new DID document
const ddo = new DIDDocument({ id: did })
// Add a publicKey to an existing DID document
ddo.addPublicKey({
id: `${did}#owner`,
publicKeyHex: "ec84465527bea0f8c54ce6c42c0d7549a7163336655a8bcaf731f07eb2997c73",
publicKeyBase58: "GvGCfZpuJapzxoo3rgyaYR39XReFxaWpZZUvoaq1o8qg",
publicKeyBase64: "OyERlUnvqD4xUzmxCwNdUmnFjM2ZVqLyvcx8H6ymXxz"
})
// Add an authentication mechanism
ddo.addAuthentication({
publicKey: `${did}#owner`,
type: "Ed25519SignatureAuthentication2018"
})
// Add a service endpoint to the DDO
ddo.addService({
id: `${did}#arasite`,
type: 'ara-site.Service',
serviceEndpoint: 'http://www.ara.one',
description: 'This is our project site'
})
doc = new DIDDocument(opts, context)
doc.context
The generic DID context to which the DID document refers to
doc.id
The Decentralized Identity to which the document belongs to
doc.publicKey
A lists public keys whose corresponding private keys are controlled by the entity identified by the DID identifier
doc.authentication
A list of mechanisms by which an entity can cryptographically prove that they are associated with a DID and DID Description
doc.service
Service endpoints represent any type of service that the DID entity wishes to advertise, including decentralized identity management services for further discovery, authentication, authorization, or interaction
doc.addPublicKey(publicKey)
Add a public key entity to the DID document
doc.addAuthentication(authentication)
Add an authentication mechanism to the did document
doc.addService(service)
Add a service endpoint to the did document
doc.toJSON()
Convert a DID document to JSON format
FAQs
Decentralized Identity (DID) Document
We found that did-document demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.