
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
@transmute/did-key-ed25519
Advanced tools
``` npm i @transmute/did-key-ed25519@latest --save ```
npm i @transmute/did-key-ed25519@latest --save
import crypto from 'crypto';
import * as ed25519 from '@transmute/did-key-ed25519';
const { didDocument, keys } = await ed25519.generate(
{
secureRandom: () => {
return crypto.randomBytes(32);
},
},
{ accept: 'application/did+json' }
);
import { Ed25519KeyPair } from '@transmute/did-key-ed25519';
const k = await Ed25519KeyPair.generate({
secureRandom: () => {
return Buffer.from(
'4f66b355aa7b0980ff901f2295b9c562ac3061be4df86703eb28c612faae6578',
'hex'
);
},
});
const exportedKeyPair = await k.export({
type: 'JsonWebKey2020',
privateKey: true,
});
import * as ed25519 from '@transmute/did-key-ed25519';
const {
didDocument,
} = await ed25519.resolve(
'did:key:z6Mkhox8UJXSDJkyBmHaCeTbdVkpXPFyyZ5pWPDdQpNsh5M3',
{ accept: 'application/did+json' }
);
This suite shipped in https://www.w3.org/2018/credentials/v1
so no additional context is needed.
import { ld as vcjs } from '@transmute/vc.js';
import { Ed25519KeyPair } from '@transmute/did-key-ed25519';
import {
Ed25519Signature2018,
Ed25519VerificationKey2018,
} from '@transmute/ed25519-signature-2018';
const k = await Ed25519KeyPair.generate({
secureRandom: () => {
return Buffer.from(
'4f66b355aa7b0980ff901f2295b9c562ac3061be4df86703eb28c612faae6578',
'hex'
);
},
});
const suite = new Ed25519Signature2018({
key: await Ed25519VerificationKey2018.from(
await k.export({
type: 'Ed25519VerificationKey2018',
privateKey: true,
})
),
date: '2020-03-10T04:24:12Z',
});
const vc = await vcjs.issue({
credential: {
'@context': ['https://www.w3.org/2018/credentials/v1'],
id: 'http://example.gov/credentials/3732',
type: ['VerifiableCredential'],
issuer: {
id: k.controller,
},
issuanceDate: '2020-03-10T04:24:12.164Z',
credentialSubject: {
id: 'did:example:ebfeb1f712ebc6f1c276e12ec21',
},
},
suite,
documentLoader,
});
This suite was created after https://www.w3.org/2018/credentials/v1
so it must be added to the credential context.
import { ld as vcjs } from '@transmute/vc.js';
import { Ed25519KeyPair } from '@transmute/did-key-ed25519';
import { JsonWebSignature, JsonWebKey } from '@transmute/json-web-signature';
const k = await Ed25519KeyPair.generate({
secureRandom: () => {
return Buffer.from(
'4f66b355aa7b0980ff901f2295b9c562ac3061be4df86703eb28c612faae6578',
'hex'
);
},
});
const suite = new JsonWebSignature({
key: await JsonWebKey.from(
await k.export({
type: 'Ed25519VerificationKey2018',
privateKey: true,
})
),
date: '2020-03-10T04:24:12Z',
});
const vc = await vcjs.issue({
credential: {
'@context': [
'https://www.w3.org/2018/credentials/v1',
// 🧙♂️ This extension context is required.
'https://w3id.org/security/suites/jws-2020/v1',
],
id: 'http://example.gov/credentials/3732',
type: ['VerifiableCredential'],
issuer: {
id: k.controller,
},
issuanceDate: '2020-03-10T04:24:12.164Z',
credentialSubject: {
id: 'did:example:ebfeb1f712ebc6f1c276e12ec21',
},
},
suite,
documentLoader,
});
import { Ed25519KeyPair } from '@transmute/did-key-ed25519';
import { JWS } from '@transmute/jose-ld';
const k = await Ed25519KeyPair.generate({
secureRandom: () => {
return Buffer.from(
'4e61bc1918ea6a47ae3307331be7798196a1a8e7cfe4b6e8f7c9a5f36017d929',
'hex'
);
},
});
const JWA_ALG = 'EdDSA';
const signer = JWS.createSigner(k.signer('EdDsa'), JWA_ALG);
const verifier = JWS.createVerifier(k.verifier('EdDsa'), JWA_ALG);
const message = Uint8Array.from(Buffer.from('hello'));
const signature = await signer.sign({ data: message });
const verified = await verifier.verify({
signature,
});
0.3.0-unstable.10 (2022-12-12)
Note: Version bump only for package root
FAQs
``` npm i @transmute/did-key-ed25519@latest --save ```
The npm package @transmute/did-key-ed25519 receives a total of 3,093 weekly downloads. As such, @transmute/did-key-ed25519 popularity was classified as popular.
We found that @transmute/did-key-ed25519 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
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.