@ndn/keychain
Advanced tools
Comparing version 0.0.20230121 to 0.0.20240113
@@ -5,3 +5,3 @@ import { __importDefault, __importStar } from "tslib"; | ||
import _cjsDefaultImport0 from "@yoursunny/asn1"; const asn1 = __importDefault(_cjsDefaultImport0).default; | ||
import { extractSpkiAlgorithm } from "./impl-spki_browser.js"; | ||
import { assertSpkiAlgorithm } from "./impl-spki_browser.js"; | ||
const SignVerifyParams = { name: "ECDSA", hash: "SHA-256" }; | ||
@@ -17,4 +17,4 @@ function makeGenParams(curve) { | ||
const NamedCurveOids = { | ||
"2A8648CE3D030107": "P-256", | ||
"2B81040022": "P-384", | ||
"2A8648CE3D030107": "P-256", // 1.2.840.10045.3.1.7 | ||
"2B81040022": "P-384", // 1.3.132.0.34 | ||
"2B81040023": "P-521", // 1.3.132.0.35 | ||
@@ -68,5 +68,3 @@ }; | ||
async importSpki(spki, der) { | ||
if (extractSpkiAlgorithm(der) !== "2A8648CE3D0201") { // 1.2.840.10045.2.1 | ||
throw new Error("not ECDSA key"); | ||
} | ||
assertSpkiAlgorithm(der, "ECDSA", "2A8648CE3D0201"); // 1.2.840.10045.2.1 | ||
// SubjectPublicKeyInfo.algorithm.parameter | ||
@@ -73,0 +71,0 @@ const ecp = der.children?.[0]?.children?.[1]; |
@@ -5,3 +5,3 @@ import { __importDefault, __importStar } from "tslib"; | ||
import _cjsDefaultImport0 from "@yoursunny/asn1"; const asn1 = __importDefault(_cjsDefaultImport0).default; | ||
import { extractSpkiAlgorithm } from "./impl-spki_node.js"; | ||
import { assertSpkiAlgorithm } from "./impl-spki_node.js"; | ||
const SignVerifyParams = { name: "ECDSA", hash: "SHA-256" }; | ||
@@ -17,4 +17,4 @@ function makeGenParams(curve) { | ||
const NamedCurveOids = { | ||
"2A8648CE3D030107": "P-256", | ||
"2B81040022": "P-384", | ||
"2A8648CE3D030107": "P-256", // 1.2.840.10045.3.1.7 | ||
"2B81040022": "P-384", // 1.3.132.0.34 | ||
"2B81040023": "P-521", // 1.3.132.0.35 | ||
@@ -68,5 +68,3 @@ }; | ||
async importSpki(spki, der) { | ||
if (extractSpkiAlgorithm(der) !== "2A8648CE3D0201") { // 1.2.840.10045.2.1 | ||
throw new Error("not ECDSA key"); | ||
} | ||
assertSpkiAlgorithm(der, "ECDSA", "2A8648CE3D0201"); // 1.2.840.10045.2.1 | ||
// SubjectPublicKeyInfo.algorithm.parameter | ||
@@ -73,0 +71,0 @@ const ecp = der.children?.[0]?.children?.[1]; |
import type { SigningAlgorithm } from "../key/mod.js"; | ||
declare const PointSizes: { | ||
"P-256": number; | ||
"P-384": number; | ||
"P-521": number; | ||
readonly "P-256": 32; | ||
readonly "P-384": 48; | ||
readonly "P-521": 66; | ||
}; | ||
@@ -7,0 +7,0 @@ export type EcCurve = keyof typeof PointSizes; |
import { SigType, Verifier } from "@ndn/packet"; | ||
import { crypto } from "@ndn/util"; | ||
import { Ed25519Algorithm, polyfillEd25519 } from "@yoursunny/webcrypto-ed25519"; | ||
import { extractSpkiAlgorithm } from "./impl-spki_browser.js"; | ||
import { assertSpkiAlgorithm } from "./impl-spki_browser.js"; | ||
polyfillEd25519(); | ||
class NodeEd { | ||
class EdAlgo { | ||
uuid; | ||
@@ -44,5 +44,3 @@ sigType; | ||
async importSpki(spki, der) { | ||
if (extractSpkiAlgorithm(der) !== this.oid) { | ||
throw new Error(`not ${this.algo.name} key`); | ||
} | ||
assertSpkiAlgorithm(der, this.algo.name, this.oid); | ||
const key = await crypto.subtle.importKey("spki", spki, this.algo, true, this.keyUsages.public); | ||
@@ -69,2 +67,2 @@ return { | ||
/** Ed25519 signing algorithm. */ | ||
export const Ed25519 = new NodeEd("fa9e8104-39b1-4a8e-828d-8c557d973476", SigType.Ed25519, Ed25519Algorithm, "2B6570"); | ||
export const Ed25519 = new EdAlgo("fa9e8104-39b1-4a8e-828d-8c557d973476", SigType.Ed25519, Ed25519Algorithm, "2B6570"); |
import { SigType, Verifier } from "@ndn/packet"; | ||
import { crypto } from "@ndn/util"; | ||
import { Ed25519Algorithm, polyfillEd25519 } from "@yoursunny/webcrypto-ed25519"; | ||
import { extractSpkiAlgorithm } from "./impl-spki_node.js"; | ||
import { assertSpkiAlgorithm } from "./impl-spki_node.js"; | ||
polyfillEd25519(); | ||
class NodeEd { | ||
class EdAlgo { | ||
uuid; | ||
@@ -44,5 +44,3 @@ sigType; | ||
async importSpki(spki, der) { | ||
if (extractSpkiAlgorithm(der) !== this.oid) { | ||
throw new Error(`not ${this.algo.name} key`); | ||
} | ||
assertSpkiAlgorithm(der, this.algo.name, this.oid); | ||
const key = await crypto.subtle.importKey("spki", spki, this.algo, true, this.keyUsages.public); | ||
@@ -69,2 +67,2 @@ return { | ||
/** Ed25519 signing algorithm. */ | ||
export const Ed25519 = new NodeEd("fa9e8104-39b1-4a8e-828d-8c557d973476", SigType.Ed25519, Ed25519Algorithm, "2B6570"); | ||
export const Ed25519 = new EdAlgo("fa9e8104-39b1-4a8e-828d-8c557d973476", SigType.Ed25519, Ed25519Algorithm, "2B6570"); |
import { toHex } from "@ndn/util"; | ||
/** Extract SubjectPublicKeyInfo.algorithm.algorithm field as OID. */ | ||
export function extractSpkiAlgorithm(der) { | ||
/** | ||
* Require SubjectPublicKeyInfo.algorithm.algorithm to have specific OID. | ||
* @param der SubjectPublicKeyInfo. | ||
* @param algoName textual algorithm name. | ||
* @param oid OID hex string (upper case). | ||
*/ | ||
export function assertSpkiAlgorithm(der, algoName, oid) { | ||
const algo = der.children?.[0]?.children?.[0]; | ||
return algo?.type === 0x06 && algo.value ? toHex(algo.value) : undefined; | ||
if (algo?.type === 0x06 && algo.value && toHex(algo.value) === oid) { | ||
return; | ||
} | ||
throw new Error(`not ${algoName} public key`); | ||
} |
import { toHex } from "@ndn/util"; | ||
/** Extract SubjectPublicKeyInfo.algorithm.algorithm field as OID. */ | ||
export function extractSpkiAlgorithm(der) { | ||
/** | ||
* Require SubjectPublicKeyInfo.algorithm.algorithm to have specific OID. | ||
* @param der SubjectPublicKeyInfo. | ||
* @param algoName textual algorithm name. | ||
* @param oid OID hex string (upper case). | ||
*/ | ||
export function assertSpkiAlgorithm(der, algoName, oid) { | ||
const algo = der.children?.[0]?.children?.[0]; | ||
return algo?.type === 0x06 && algo.value ? toHex(algo.value) : undefined; | ||
if (algo?.type === 0x06 && algo.value && toHex(algo.value) === oid) { | ||
return; | ||
} | ||
throw new Error(`not ${algoName} public key`); | ||
} |
import type * as asn1 from "@yoursunny/asn1"; | ||
/** Extract SubjectPublicKeyInfo.algorithm.algorithm field as OID. */ | ||
export declare function extractSpkiAlgorithm(der: asn1.ElementBuffer): string | undefined; | ||
/** | ||
* Require SubjectPublicKeyInfo.algorithm.algorithm to have specific OID. | ||
* @param der SubjectPublicKeyInfo. | ||
* @param algoName textual algorithm name. | ||
* @param oid OID hex string (upper case). | ||
*/ | ||
export declare function assertSpkiAlgorithm(der: asn1.ElementBuffer, algoName: string, oid: string): void; |
import { crypto } from "@ndn/util"; | ||
import { extractSpkiAlgorithm } from "./impl-spki_browser.js"; | ||
import { assertSpkiAlgorithm } from "./impl-spki_browser.js"; | ||
export var RsaModulusLength; | ||
@@ -48,5 +48,3 @@ (function (RsaModulusLength) { | ||
async importSpki(spki, der) { | ||
if (extractSpkiAlgorithm(der) !== "2A864886F70D010101") { // 1.2.840.113549.1.1.1 | ||
throw new Error("not RSA key"); | ||
} | ||
assertSpkiAlgorithm(der, "RSA", "2A864886F70D010101"); // 1.2.840.113549.1.1.1 | ||
const key = await crypto.subtle.importKey("spki", spki, this.importParams, true, this.keyUsages.public); | ||
@@ -53,0 +51,0 @@ return { |
import { crypto } from "@ndn/util"; | ||
import { extractSpkiAlgorithm } from "./impl-spki_node.js"; | ||
import { assertSpkiAlgorithm } from "./impl-spki_node.js"; | ||
export var RsaModulusLength; | ||
@@ -48,5 +48,3 @@ (function (RsaModulusLength) { | ||
async importSpki(spki, der) { | ||
if (extractSpkiAlgorithm(der) !== "2A864886F70D010101") { // 1.2.840.113549.1.1.1 | ||
throw new Error("not RSA key"); | ||
} | ||
assertSpkiAlgorithm(der, "RSA", "2A864886F70D010101"); // 1.2.840.113549.1.1.1 | ||
const key = await crypto.subtle.importKey("spki", spki, this.importParams, true, this.keyUsages.public); | ||
@@ -53,0 +51,0 @@ return { |
import { EncryptionAlgorithmListFull } from "./full-encryption_browser.js"; | ||
import { SigningAlgorithmListFull } from "./full-signing_browser.js"; | ||
/** A full list of crypto algorithms. */ | ||
/** | ||
* A full list of crypto algorithms. | ||
* This list encompasses SigningAlgorithmListFull and EncryptionAlgorithmListFull. | ||
*/ | ||
export const CryptoAlgorithmListFull = [ | ||
@@ -5,0 +8,0 @@ ...SigningAlgorithmListFull, |
import { EncryptionAlgorithmListFull } from "./full-encryption_node.js"; | ||
import { SigningAlgorithmListFull } from "./full-signing_node.js"; | ||
/** A full list of crypto algorithms. */ | ||
/** | ||
* A full list of crypto algorithms. | ||
* This list encompasses SigningAlgorithmListFull and EncryptionAlgorithmListFull. | ||
*/ | ||
export const CryptoAlgorithmListFull = [ | ||
@@ -5,0 +8,0 @@ ...SigningAlgorithmListFull, |
import type { CryptoAlgorithm } from "../key/mod.js"; | ||
/** A full list of crypto algorithms. */ | ||
/** | ||
* A full list of crypto algorithms. | ||
* This list encompasses SigningAlgorithmListFull and EncryptionAlgorithmListFull. | ||
*/ | ||
export declare const CryptoAlgorithmListFull: readonly CryptoAlgorithm[]; |
@@ -18,2 +18,3 @@ import { ECDSA } from "../algo/mod_browser.js"; | ||
* A slim list of crypto algorithms. | ||
* This list encompasses SigningAlgorithmListSlim and EncryptionAlgorithmListSlim. | ||
* If you need more algorithms, explicitly import them or use CryptoAlgorithmListFull. | ||
@@ -20,0 +21,0 @@ */ |
@@ -18,2 +18,3 @@ import { ECDSA } from "../algo/mod_node.js"; | ||
* A slim list of crypto algorithms. | ||
* This list encompasses SigningAlgorithmListSlim and EncryptionAlgorithmListSlim. | ||
* If you need more algorithms, explicitly import them or use CryptoAlgorithmListFull. | ||
@@ -20,0 +21,0 @@ */ |
@@ -16,4 +16,5 @@ import type { CryptoAlgorithm, EncryptionAlgorithm, SigningAlgorithm } from "../key/mod.js"; | ||
* A slim list of crypto algorithms. | ||
* This list encompasses SigningAlgorithmListSlim and EncryptionAlgorithmListSlim. | ||
* If you need more algorithms, explicitly import them or use CryptoAlgorithmListFull. | ||
*/ | ||
export declare const CryptoAlgorithmListSlim: readonly CryptoAlgorithm[]; |
@@ -1,7 +0,6 @@ | ||
export var TT; | ||
(function (TT) { | ||
TT.ValidityPeriod = 0xFD; | ||
TT.NotBefore = 0xFE; | ||
TT.NotAfter = 0xFF; | ||
})(TT || (TT = {})); | ||
export const TT = { | ||
ValidityPeriod: 0xFD, | ||
NotBefore: 0xFE, | ||
NotAfter: 0xFF, | ||
}; | ||
export const ContentTypeKEY = 0x02; |
@@ -1,7 +0,6 @@ | ||
export var TT; | ||
(function (TT) { | ||
TT.ValidityPeriod = 0xFD; | ||
TT.NotBefore = 0xFE; | ||
TT.NotAfter = 0xFF; | ||
})(TT || (TT = {})); | ||
export const TT = { | ||
ValidityPeriod: 0xFD, | ||
NotBefore: 0xFE, | ||
NotAfter: 0xFF, | ||
}; | ||
export const ContentTypeKEY = 0x02; |
@@ -1,6 +0,6 @@ | ||
export declare namespace TT { | ||
const ValidityPeriod = 253; | ||
const NotBefore = 254; | ||
const NotAfter = 255; | ||
} | ||
export declare const TT: { | ||
readonly ValidityPeriod: 253; | ||
readonly NotBefore: 254; | ||
readonly NotAfter: 255; | ||
}; | ||
export declare const ContentTypeKEY = 2; |
@@ -54,3 +54,3 @@ import { __importDefault, __importStar } from "tslib"; | ||
const der = asn1.parseVerbose(this.publicKeySpki); | ||
const errs = []; | ||
const errs = {}; | ||
for (const algo of algoList) { | ||
@@ -64,6 +64,7 @@ if (!algo.importSpki) { | ||
catch (err) { | ||
errs.push(`${algo.uuid}: ${err}`); | ||
errs[algo.uuid] = err; | ||
} | ||
} | ||
throw new Error(`cannot import key\n${errs.join("\n")}\n(you may need to specify an algoList with more algorithms)`); | ||
const errorMsgs = Object.entries(errs).map(([uuid, err]) => ` ${uuid} ${err}`); | ||
throw new AggregateError(Object.values(errs), `cannot import key\n${errorMsgs.join("\n")}\n(you may need to specify an algoList with more algorithms)`); | ||
} | ||
@@ -70,0 +71,0 @@ } |
@@ -54,3 +54,3 @@ import { __importDefault, __importStar } from "tslib"; | ||
const der = asn1.parseVerbose(this.publicKeySpki); | ||
const errs = []; | ||
const errs = {}; | ||
for (const algo of algoList) { | ||
@@ -64,6 +64,7 @@ if (!algo.importSpki) { | ||
catch (err) { | ||
errs.push(`${algo.uuid}: ${err}`); | ||
errs[algo.uuid] = err; | ||
} | ||
} | ||
throw new Error(`cannot import key\n${errs.join("\n")}\n(you may need to specify an algoList with more algorithms)`); | ||
const errorMsgs = Object.entries(errs).map(([uuid, err]) => ` ${uuid} ${err}`); | ||
throw new AggregateError(Object.values(errs), `cannot import key\n${errorMsgs.join("\n")}\n(you may need to specify an algoList with more algorithms)`); | ||
} | ||
@@ -70,0 +71,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { type Component, type Name, type Signer, Data } from "@ndn/packet"; | ||
import { type Component, Data, type Name, type Signer } from "@ndn/packet"; | ||
import type { CryptoAlgorithm, NamedSigner, PublicKey } from "../key/mod.js"; | ||
@@ -3,0 +3,0 @@ import { ValidityPeriod } from "./validity-period.js"; |
@@ -14,10 +14,13 @@ import { assert, crypto, toHex } from "@ndn/util"; | ||
switch (typeof fixedInput) { | ||
case "bigint": | ||
case "bigint": { | ||
fixed = fixedInput; | ||
break; | ||
case "object": | ||
} | ||
case "object": { | ||
fixed = BigInt(`0x${toHex(fixedInput)}`); | ||
break; | ||
default: | ||
} | ||
default: { | ||
throw new Error("bad CounterIvOptions.fixed"); | ||
} | ||
} | ||
@@ -24,0 +27,0 @@ fixed <<= BigInt(randomBits + counterBits); |
@@ -14,10 +14,13 @@ import { assert, crypto, toHex } from "@ndn/util"; | ||
switch (typeof fixedInput) { | ||
case "bigint": | ||
case "bigint": { | ||
fixed = fixedInput; | ||
break; | ||
case "object": | ||
} | ||
case "object": { | ||
fixed = BigInt(`0x${toHex(fixedInput)}`); | ||
break; | ||
default: | ||
} | ||
default: { | ||
throw new Error("bad CounterIvOptions.fixed"); | ||
} | ||
} | ||
@@ -24,0 +27,0 @@ fixed <<= BigInt(randomBits + counterBits); |
@@ -6,3 +6,3 @@ export * from "./algo/mod_browser.js"; | ||
export * from "./key/mod_browser.js"; | ||
export * as CertNaming from "./naming_browser.js"; | ||
import * as CertNaming from "./naming_browser.js"; export { CertNaming }; | ||
export * from "./store/mod_browser.js"; |
@@ -6,3 +6,3 @@ export * from "./algo/mod_node.js"; | ||
export * from "./key/mod_node.js"; | ||
export * as CertNaming from "./naming_node.js"; | ||
import * as CertNaming from "./naming_node.js"; export { CertNaming }; | ||
export * from "./store/mod_node.js"; |
@@ -6,3 +6,3 @@ export * from "./algo/mod.js"; | ||
export * from "./key/mod.js"; | ||
export * as CertNaming from "./naming.js"; | ||
import * as CertNaming from "./naming.js"; export { CertNaming }; | ||
export * from "./store/mod.js"; |
@@ -1,2 +0,2 @@ | ||
import { type Name, Component } from "@ndn/packet"; | ||
import { Component, type Name } from "@ndn/packet"; | ||
/** 'KEY' component. */ | ||
@@ -3,0 +3,0 @@ export declare const KEY: Component; |
@@ -10,3 +10,3 @@ import { Data } from "@ndn/packet"; | ||
certBuffer = StoreBase.bufferFromStorable(certBuffer); | ||
return Certificate.fromData(new Decoder(certBuffer).decode(Data)); | ||
return Certificate.fromData(Decoder.decode(certBuffer, Data)); | ||
} | ||
@@ -13,0 +13,0 @@ async insert(cert) { |
@@ -10,3 +10,3 @@ import { Data } from "@ndn/packet"; | ||
certBuffer = StoreBase.bufferFromStorable(certBuffer); | ||
return Certificate.fromData(new Decoder(certBuffer).decode(Data)); | ||
return Certificate.fromData(Decoder.decode(certBuffer, Data)); | ||
} | ||
@@ -13,0 +13,0 @@ async insert(cert) { |
import type { Name } from "@ndn/packet"; | ||
import { type NamedDecrypter, type NamedEncrypter, type NamedSigner, type NamedVerifier, type PublicKey, CryptoAlgorithm } from "../key/mod.js"; | ||
import { type StoreProvider, StoreBase } from "./store-base.js"; | ||
import { CryptoAlgorithm, type NamedDecrypter, type NamedEncrypter, type NamedSigner, type NamedVerifier, type PublicKey } from "../key/mod.js"; | ||
import { StoreBase, type StoreProvider } from "./store-base.js"; | ||
/** KV store of named key pairs. */ | ||
@@ -5,0 +5,0 @@ export declare class KeyStore extends StoreBase<KeyStore.StoredKey> { |
@@ -34,10 +34,9 @@ import { Name } from "@ndn/packet"; | ||
const useFallback = (err) => { | ||
switch (typeof fallback) { | ||
case "function": | ||
return fallback(name, this, err); | ||
case "undefined": | ||
throw new Error(`signer ${name} not found ${err}`); | ||
default: | ||
return fallback; | ||
if (fallback === undefined) { | ||
throw new Error(`signer ${name} not found ${err}`, { cause: err }); | ||
} | ||
if (typeof fallback === "function") { | ||
return fallback(name, this, err); | ||
} | ||
return fallback; | ||
}; | ||
@@ -44,0 +43,0 @@ const changeKeyLocator = (signer, certName) => { |
@@ -34,10 +34,9 @@ import { Name } from "@ndn/packet"; | ||
const useFallback = (err) => { | ||
switch (typeof fallback) { | ||
case "function": | ||
return fallback(name, this, err); | ||
case "undefined": | ||
throw new Error(`signer ${name} not found ${err}`); | ||
default: | ||
return fallback; | ||
if (fallback === undefined) { | ||
throw new Error(`signer ${name} not found ${err}`, { cause: err }); | ||
} | ||
if (typeof fallback === "function") { | ||
return fallback(name, this, err); | ||
} | ||
return fallback; | ||
}; | ||
@@ -44,0 +43,0 @@ const changeKeyLocator = (signer, certName) => { |
@@ -1,2 +0,2 @@ | ||
import { type Signer, Name } from "@ndn/packet"; | ||
import { Name, type Signer } from "@ndn/packet"; | ||
import type { Certificate } from "../cert/mod.js"; | ||
@@ -3,0 +3,0 @@ import type { CryptoAlgorithm } from "../key/mod.js"; |
@@ -5,5 +5,3 @@ import { createStore, del, get, keys, set } from "idb-keyval"; | ||
class IdbStoreProvider { | ||
// Firefox does not support structured clone of ECDSA CryptoKey. | ||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1545813 | ||
canSClone = !/rv:.*Gecko\//.test(navigator.userAgent); | ||
canSClone = true; | ||
store; | ||
@@ -10,0 +8,0 @@ constructor(dbName) { |
@@ -1,5 +0,4 @@ | ||
import { __importDefault, __importStar } from "tslib"; | ||
import fs from "node:fs"; | ||
import { dirname } from "node:path"; | ||
import { console } from "@ndn/util"; | ||
import _cjsDefaultImport0 from "graceful-fs"; const fs = __importDefault(_cjsDefaultImport0).default; | ||
import { CertStore } from "./cert-store_node.js"; | ||
@@ -6,0 +5,0 @@ import { KeyStore } from "./key-store_node.js"; |
{ | ||
"name": "@ndn/keychain", | ||
"version": "0.0.20230121", | ||
"version": "0.0.20240113", | ||
"description": "NDNts: Key Chain", | ||
@@ -27,15 +27,14 @@ "keywords": [ | ||
"dependencies": { | ||
"@ndn/naming-convention2": "0.0.20230121", | ||
"@ndn/packet": "0.0.20230121", | ||
"@ndn/tlv": "0.0.20230121", | ||
"@ndn/util": "0.0.20230121", | ||
"@ndn/naming-convention2": "0.0.20240113", | ||
"@ndn/packet": "0.0.20240113", | ||
"@ndn/tlv": "0.0.20240113", | ||
"@ndn/util": "0.0.20240113", | ||
"@yoursunny/asn1": "0.0.20200718", | ||
"@yoursunny/webcrypto-ed25519": "0.0.20221020", | ||
"graceful-fs": "^4.2.10", | ||
"idb-keyval": "^6.2.0", | ||
"mnemonist": "^0.39.5", | ||
"@yoursunny/webcrypto-ed25519": "0.0.20230624", | ||
"idb-keyval": "^6.2.1", | ||
"mnemonist": "^0.39.7", | ||
"throat": "^6.0.2", | ||
"tslib": "^2.4.1" | ||
"tslib": "^2.6.2" | ||
}, | ||
"types": "lib/mod.d.ts" | ||
} |
@@ -7,11 +7,9 @@ # @ndn/keychain | ||
The implementation uses [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API). | ||
The implementation uses [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) that is natively supported in Node.js and modern browsers. | ||
Most browsers restrict WebCrypto to [secure contexts](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts) only, so that this implementation will not work on a webpage that is not delivered securely. | ||
During development, you may use `http://localhost` or [ngrok](https://ngrok.com/) to serve the webpage from a secure context. | ||
* Modern browsers and Node.js 16.x natively support WebCrypto. | ||
* Most browsers restrict WebCrypto to [secure contexts](https://www.w3.org/TR/powerful-features/) only. | ||
During development, you may use `http://localhost` or [ngrok](https://ngrok.com/). | ||
## Signing Algorithms | ||
This package implements signature types defined in [NDN Packet Format 0.3](https://named-data.net/doc/NDN-packet-spec/0.3/signature.html): | ||
This package implements signature types defined in [NDN Packet Format 0.3](https://docs.named-data.net/NDN-packet-spec/0.3/signature.html): | ||
@@ -74,3 +72,3 @@ * [X] DigestSha256 (in `@ndn/packet` package) | ||
`Certificate` class provides basic operations with [NDN Certificate Format 2.0](https://named-data.net/doc/ndn-cxx/0.8.0/specs/certificate.html). | ||
`Certificate` class provides basic operations with [NDN Certificate Format](https://docs.named-data.net/NDN-packet-spec/0.3/certificate.html). | ||
@@ -97,5 +95,4 @@ * [X] generate self-signed certificate | ||
* In Firefox, persistent keychain stores JWK instead of `CryptoKey`, due to [Mozilla Bug 1545813](https://bugzilla.mozilla.org/show_bug.cgi?id=1545813). | ||
* In Firefox, persistent keychain is unusable in a Private Browsing window, due to [Mozilla Bug 781982](https://bugzilla.mozilla.org/show_bug.cgi?id=1639542). | ||
* In Chrome, AES 192-bit key is not supported. | ||
* Ed25519 in browser is implemented in JavaScript, which is less secure than native Web Crypto implementation. |
182631
10
4655
96
+ Added@ndn/naming-convention2@0.0.20240113(transitive)
+ Added@ndn/packet@0.0.20240113(transitive)
+ Added@ndn/tlv@0.0.20240113(transitive)
+ Added@ndn/util@0.0.20240113(transitive)
+ Added@noble/ed25519@2.2.3(transitive)
+ Added@yoursunny/webcrypto-ed25519@0.0.20230624(transitive)
+ Addedcompare-versions@6.0.0-rc.1(transitive)
+ Addedstreaming-iterables@8.0.1(transitive)
+ Addedtype-fest@4.33.0(transitive)
- Removedgraceful-fs@^4.2.10
- Removed@ndn/naming-convention2@0.0.20230121(transitive)
- Removed@ndn/packet@0.0.20230121(transitive)
- Removed@ndn/tlv@0.0.20230121(transitive)
- Removed@ndn/util@0.0.20230121(transitive)
- Removed@noble/ed25519@1.7.3(transitive)
- Removed@yoursunny/webcrypto-ed25519@0.0.20221020(transitive)
- Removedcompare-versions@5.0.3(transitive)
- Removedgraceful-fs@4.2.11(transitive)
Updated@ndn/packet@0.0.20240113
Updated@ndn/tlv@0.0.20240113
Updated@ndn/util@0.0.20240113
Updatedidb-keyval@^6.2.1
Updatedmnemonist@^0.39.7
Updatedtslib@^2.6.2