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

@sphereon/ssi-sdk-ext.did-utils

Package Overview
Dependencies
Maintainers
4
Versions
351
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sphereon/ssi-sdk-ext.did-utils - npm Package Compare versions

Comparing version 0.12.1-next.3 to 0.12.1-next.4

15

dist/did-functions.js

@@ -128,6 +128,17 @@ "use strict";

const secp256 = new elliptic_1.default.ec(pk.publicKeyJwk.crv === 'secp256k1' ? 'secp256k1' : 'p256');
const prefix = pk.publicKeyJwk.crv === 'secp256k1' ? '04' : '03';
// const prefix = pk.publicKeyJwk.crv === 'secp256k1' ? '04' : '03'
const x = u8a.fromString(pk.publicKeyJwk.x, 'base64url');
const y = u8a.fromString(pk.publicKeyJwk.y, 'base64url');
const hex = `${prefix}${u8a.toString(x, 'base16')}${u8a.toString(y, 'base16')}`;
const xHex = u8a.toString(x, 'base16');
const yHex = u8a.toString(y, 'base16');
const length = x.length + y.length;
let prefix = '04';
if (length === 64 || length === 65) {
// raw key
prefix = '04';
}
else {
prefix = length % 2 === 1 ? '03' : '02';
}
const hex = `${prefix}${xHex}${yHex}`;
// We return directly as we don't want to convert the result back into Uint8Array and then convert again to hex as the elliptic lib already returns hex strings

@@ -134,0 +145,0 @@ return secp256.keyFromPublic(hex, 'hex').getPublic(true, 'hex');

6

package.json
{
"name": "@sphereon/ssi-sdk-ext.did-utils",
"description": "DID Utils",
"version": "0.12.1-next.3+51ae676",
"version": "0.12.1-next.4+5f3d708",
"source": "src/index.ts",

@@ -14,3 +14,3 @@ "main": "dist/index.js",

"@sphereon/did-uni-client": "^0.6.0",
"@sphereon/ssi-sdk-ext.key-utils": "0.12.1-next.3+51ae676",
"@sphereon/ssi-sdk-ext.key-utils": "0.12.1-next.4+5f3d708",
"@veramo/core": "4.2.0",

@@ -38,3 +38,3 @@ "@veramo/utils": "4.2.0",

"keywords": [],
"gitHead": "51ae6769386866771c68c7b7806a75b62a9d5ec1"
"gitHead": "5f3d70898783d56f5aa7a36e4fd56faf5907dbeb"
}

@@ -100,6 +100,18 @@ import { UniResolver } from '@sphereon/did-uni-client'

const secp256 = new elliptic.ec(pk.publicKeyJwk.crv === 'secp256k1' ? 'secp256k1' : 'p256')
const prefix = pk.publicKeyJwk.crv === 'secp256k1' ? '04' : '03'
// const prefix = pk.publicKeyJwk.crv === 'secp256k1' ? '04' : '03'
const x = u8a.fromString(pk.publicKeyJwk.x!, 'base64url')
const y = u8a.fromString(pk.publicKeyJwk.y!, 'base64url')
const hex = `${prefix}${u8a.toString(x, 'base16')}${u8a.toString(y, 'base16')}`
const xHex = u8a.toString(x, 'base16')
const yHex = u8a.toString(y, 'base16')
const length = x.length + y.length
let prefix = '04'
if (length === 64 || length === 65) {
// raw key
prefix = '04'
} else {
prefix = length % 2 === 1 ? '03' : '02'
}
const hex = `${prefix}${xHex}${yHex}`
// We return directly as we don't want to convert the result back into Uint8Array and then convert again to hex as the elliptic lib already returns hex strings

@@ -106,0 +118,0 @@ return secp256.keyFromPublic(hex, 'hex').getPublic(true, 'hex')

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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