@sphereon/ssi-sdk-ext.key-utils
Advanced tools
Comparing version 0.24.1-unstable.71 to 0.24.1-unstable.75
@@ -33,2 +33,6 @@ import { IAgentContext, IKey, IKeyManager, ManagedKeyInfo, MinimalImportableKey } from '@veramo/core'; | ||
}) => string; | ||
export declare const toJwkFromKey: (key: IKey | MinimalImportableKey | ManagedKeyInfo, opts?: { | ||
use?: JwkKeyUse; | ||
noKidThumbprint?: boolean; | ||
}) => JWK; | ||
/** | ||
@@ -35,0 +39,0 @@ * Converts a public key in hex format to a JWK |
@@ -38,3 +38,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.SignatureAlgorithmEnum = exports.keyTypeFromCryptographicSuite = exports.signatureAlgorithmFromKeyType = exports.signatureAlgorithmFromKey = exports.hexStringFromUint8Array = exports.toRawCompressedHexPublicKey = exports.isRawCompressedPublicKey = exports.asn1DerToRawPublicKey = exports.isAsn1Der = exports.padLeft = exports.jwkDetermineUse = exports.toJwk = exports.calculateJwkThumbprint = exports.toBase64url = exports.calculateJwkThumbprintForKey = exports.importProvidedOrGeneratedKey = exports.generatePrivateKeyHex = exports.logger = void 0; | ||
exports.SignatureAlgorithmEnum = exports.keyTypeFromCryptographicSuite = exports.signatureAlgorithmFromKeyType = exports.signatureAlgorithmFromKey = exports.hexStringFromUint8Array = exports.toRawCompressedHexPublicKey = exports.isRawCompressedPublicKey = exports.asn1DerToRawPublicKey = exports.isAsn1Der = exports.padLeft = exports.jwkDetermineUse = exports.toJwk = exports.toJwkFromKey = exports.calculateJwkThumbprint = exports.toBase64url = exports.calculateJwkThumbprintForKey = exports.importProvidedOrGeneratedKey = exports.generatePrivateKeyHex = exports.logger = void 0; | ||
const random_1 = require("@ethersproject/random"); | ||
@@ -187,2 +187,7 @@ const ssi_sdk_ext_x509_utils_1 = require("@sphereon/ssi-sdk-ext.x509-utils"); | ||
exports.calculateJwkThumbprint = calculateJwkThumbprint; | ||
const toJwkFromKey = (key, opts) => { | ||
const isPrivateKey = 'privateKeyHex' in key; | ||
return (0, exports.toJwk)(key.publicKeyHex, key.type, Object.assign(Object.assign({}, opts), { key, isPrivateKey })); | ||
}; | ||
exports.toJwkFromKey = toJwkFromKey; | ||
/** | ||
@@ -189,0 +194,0 @@ * Converts a public key in hex format to a JWK |
@@ -28,2 +28,3 @@ import { IKey, MinimalImportableKey } from '@veramo/core'; | ||
export interface JWK { | ||
kty: string; | ||
alg?: string; | ||
@@ -39,3 +40,2 @@ crv?: string; | ||
kid?: string; | ||
kty?: string; | ||
n?: string; | ||
@@ -42,0 +42,0 @@ oth?: Array<{ |
{ | ||
"name": "@sphereon/ssi-sdk-ext.key-utils", | ||
"description": "Sphereon SSI-SDK plugin for key creation.", | ||
"version": "0.24.1-unstable.71+8d51b5a", | ||
"version": "0.24.1-unstable.75+01db327", | ||
"source": "src/index.ts", | ||
@@ -14,4 +14,4 @@ "main": "dist/index.js", | ||
"@ethersproject/random": "^5.7.0", | ||
"@sphereon/ssi-sdk-ext.x509-utils": "0.24.1-unstable.71+8d51b5a", | ||
"@sphereon/ssi-types": "0.29.1-next.46", | ||
"@sphereon/ssi-sdk-ext.x509-utils": "0.24.1-unstable.75+01db327", | ||
"@sphereon/ssi-types": "0.29.1-unstable.73", | ||
"@stablelib/ed25519": "^1.0.3", | ||
@@ -53,3 +53,3 @@ "@stablelib/sha256": "^1.0.1", | ||
], | ||
"gitHead": "8d51b5ae666f7dfc47ce87f9dfbe6ea0d4d4c316" | ||
"gitHead": "01db32715f7e7a95b57e07c23b7f3cc5b6ffa578" | ||
} |
@@ -191,2 +191,7 @@ import { randomBytes } from '@ethersproject/random' | ||
export const toJwkFromKey = (key: IKey | MinimalImportableKey | ManagedKeyInfo, opts?: { use?: JwkKeyUse; noKidThumbprint?: boolean }): JWK => { | ||
const isPrivateKey = 'privateKeyHex' in key | ||
return toJwk(key.publicKeyHex!, key.type, { ...opts, key, isPrivateKey }) | ||
} | ||
/** | ||
@@ -193,0 +198,0 @@ * Converts a public key in hex format to a JWK |
@@ -36,2 +36,3 @@ import { IKey, MinimalImportableKey } from '@veramo/core' | ||
export interface JWK { | ||
kty: string | ||
alg?: string | ||
@@ -47,3 +48,2 @@ crv?: string | ||
kid?: string | ||
kty?: string | ||
n?: string | ||
@@ -50,0 +50,0 @@ oth?: Array<{ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
114126
1857
+ Added@sphereon/ssi-types@0.29.1-unstable.73(transitive)
- Removed@sphereon/ssi-types@0.29.1-next.46(transitive)
Updated@sphereon/ssi-sdk-ext.x509-utils@0.24.1-unstable.75+01db327