Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@digitalbazaar/x25519-key-agreement-key-2019

Package Overview
Dependencies
Maintainers
6
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@digitalbazaar/x25519-key-agreement-key-2019 - npm Package Compare versions

Comparing version 5.0.1 to 5.1.0

6

CHANGELOG.md
# @digitalbazaar/x25519-key-agreement-key-2019 ChangeLog
## 5.1.0 - 2021-04-02
### Added
- Add `revoked` export tests. (To support `CryptoLD`'s new `fromKeyId()`
method.) Also add `includeContext` flag to `export()`.
## 5.0.1 - 2021-03-25

@@ -4,0 +10,0 @@

35

lib/X25519KeyAgreementKey2019.js

@@ -27,7 +27,13 @@ /*!

* X25519KeyAgreementKey2019 { ...
* @param {object} options - Base58 keys plus other options
* @param {string} options.controller
* @param {string} options.id
* @param {string} options.publicKeyBase58 - Base58 encoded Public Key.
* @param {string} [options.privateKeyBase58] - Base58 Private Key.
* @param {object} options - Options hashmap.
* @param {string} options.controller - Controller DID or document url.
* @param {string} [options.id] - Key ID, typically composed of controller
* URL and key fingerprint as hash fragment.
* @param {string} options.publicKeyBase58 - Base58 encoded public key.
* @param {string} [options.privateKeyBase58] - Base58 private key.
* @param {string} [options.revoked] - Timestamp of when the key has been
* revoked, in RFC3339 format. If not present, the key itself is considered
* not revoked. Note that this mechanism is slightly different than DID
* Document key revocation, where a DID controller can revoke a key from
* that DID by removing it from the DID Document.
*/

@@ -219,2 +225,3 @@ constructor(options = {}) {

* @param {boolean} [options.privateKey] - Export private key material?
* @param {boolean} [options.includeContext] - Include JSON-LD context?
*

@@ -224,3 +231,3 @@ * @returns {object} A plain js object that's ready for serialization

*/
export({publicKey = false, privateKey = false} = {}) {
export({publicKey = false, privateKey = false, includeContext = false} = {}) {
if(!(publicKey || privateKey)) {

@@ -232,5 +239,10 @@ throw new TypeError(

id: this.id,
type: this.type,
controller: this.controller
type: this.type
};
if(includeContext) {
exportedKey['@context'] = X25519KeyAgreementKey2019.SUITE_CONTEXT;
}
if(this.controller) {
exportedKey.controller = this.controller;
}
if(publicKey) {

@@ -242,2 +254,5 @@ exportedKey.publicKeyBase58 = this.publicKeyBase58;

}
if(this.revoked) {
exportedKey.revoked = this.revoked;
}
return exportedKey;

@@ -369,2 +384,6 @@ }

// Used by CryptoLD harness for dispatching.
X25519KeyAgreementKey2019.suite = SUITE_ID;
// Currently, X 2019 suite does not have its own standalone context, and
// uses security/v2
X25519KeyAgreementKey2019.SUITE_CONTEXT = 'https://w3id.org/security/v2';
{
"name": "@digitalbazaar/x25519-key-agreement-key-2019",
"version": "5.0.1",
"version": "5.1.0",
"description": "An X25519 (Curve25519) DH key implementation to work with the crypto-ld LDKeyPair API",

@@ -5,0 +5,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc