@libp2p/keychain
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -0,4 +1,4 @@ | ||
import type { KeyChain, KeyInfo, KeyType } from '@libp2p/interface-keychain'; | ||
import type { PeerId } from '@libp2p/interface-peer-id'; | ||
import type { Datastore } from 'interface-datastore'; | ||
import type { KeyChain, KeyInfo, KeyType } from '@libp2p/interface-keychain'; | ||
export interface DEKConfig { | ||
@@ -5,0 +5,0 @@ hash: string; |
/* eslint max-nested-callbacks: ["error", 5] */ | ||
import { pbkdf2, randomBytes } from '@libp2p/crypto'; | ||
import { generateKeyPair, importKey, unmarshalPrivateKey } from '@libp2p/crypto/keys'; | ||
import { CodeError } from '@libp2p/interfaces/errors'; | ||
import { logger } from '@libp2p/logger'; | ||
import { peerIdFromKeys } from '@libp2p/peer-id'; | ||
import { Key } from 'interface-datastore/key'; | ||
import mergeOptions from 'merge-options'; | ||
import sanitize from 'sanitize-filename'; | ||
import mergeOptions from 'merge-options'; | ||
import { Key } from 'interface-datastore/key'; | ||
import { CodeError } from '@libp2p/interfaces/errors'; | ||
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; | ||
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; | ||
import { codes } from './errors.js'; | ||
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'; | ||
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'; | ||
import { generateKeyPair, importKey, unmarshalPrivateKey } from '@libp2p/crypto/keys'; | ||
import { pbkdf2, randomBytes } from '@libp2p/crypto'; | ||
import { peerIdFromKeys } from '@libp2p/peer-id'; | ||
const log = logger('libp2p:keychain'); | ||
@@ -74,2 +74,4 @@ const keyPrefix = '/pkcs8/'; | ||
export class DefaultKeyChain { | ||
components; | ||
init; | ||
/** | ||
@@ -328,3 +330,3 @@ * Creates a new instance of a key chain | ||
const privateKey = await importKey(pem, password); | ||
return await peerIdFromKeys(privateKey.public.bytes, privateKey.bytes); | ||
return peerIdFromKeys(privateKey.public.bytes, privateKey.bytes); | ||
} | ||
@@ -331,0 +333,0 @@ /** |
{ | ||
"name": "@libp2p/keychain", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Key management and cryptographically protected messages", | ||
@@ -160,3 +160,3 @@ "license": "Apache-2.0 OR MIT", | ||
"@libp2p/peer-id-factory": "^2.0.1", | ||
"aegir": "^38.1.0", | ||
"aegir": "^39.0.10", | ||
"datastore-core": "^9.0.1", | ||
@@ -163,0 +163,0 @@ "multiformats": "^11.0.1" |
/* eslint max-nested-callbacks: ["error", 5] */ | ||
import { pbkdf2, randomBytes } from '@libp2p/crypto' | ||
import { generateKeyPair, importKey, unmarshalPrivateKey } from '@libp2p/crypto/keys' | ||
import { CodeError } from '@libp2p/interfaces/errors' | ||
import { logger } from '@libp2p/logger' | ||
import { peerIdFromKeys } from '@libp2p/peer-id' | ||
import { Key } from 'interface-datastore/key' | ||
import mergeOptions from 'merge-options' | ||
import sanitize from 'sanitize-filename' | ||
import mergeOptions from 'merge-options' | ||
import { Key } from 'interface-datastore/key' | ||
import { CodeError } from '@libp2p/interfaces/errors' | ||
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' | ||
import { toString as uint8ArrayToString } from 'uint8arrays/to-string' | ||
import { codes } from './errors.js' | ||
import { toString as uint8ArrayToString } from 'uint8arrays/to-string' | ||
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' | ||
import { generateKeyPair, importKey, unmarshalPrivateKey } from '@libp2p/crypto/keys' | ||
import type { KeyChain, KeyInfo, KeyType } from '@libp2p/interface-keychain' | ||
import type { PeerId } from '@libp2p/interface-peer-id' | ||
import { pbkdf2, randomBytes } from '@libp2p/crypto' | ||
import type { Datastore } from 'interface-datastore' | ||
import { peerIdFromKeys } from '@libp2p/peer-id' | ||
import type { KeyChain, KeyInfo, KeyType } from '@libp2p/interface-keychain' | ||
@@ -393,3 +393,3 @@ const log = logger('libp2p:keychain') | ||
return await peerIdFromKeys(privateKey.public.bytes, privateKey.bytes) | ||
return peerIdFromKeys(privateKey.public.bytes, privateKey.bytes) | ||
} | ||
@@ -396,0 +396,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
327035
2219