@vess-id/ai-identity 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -2746,6 +2746,32 @@ function getClient(config, password) {
|
|
|
2746
2746
|
return defaultClient;
|
|
2747
2747
|
}
|
|
2748
2748
|
|
|
2749
|
+
// src/identity/user-key-pair-manager.ts
|
|
2750
|
+
var UserKeyPairManager = class {
|
|
2751
|
+
/**
|
|
2752
|
+
* Generate a new key pair and create a did:jwk DID
|
|
2753
|
+
*/
|
|
2754
|
+
async generateKeyPair() {
|
|
2755
|
+
const keyPair = await SDJwtClient.generateKeyPair();
|
|
2756
|
+
const did = createDidJwk(keyPair.publicKey);
|
|
2757
|
+
return {
|
|
2758
|
+
did,
|
|
2759
|
+
publicKey: keyPair.publicKey,
|
|
2760
|
+
privateKey: keyPair.privateKey
|
|
2761
|
+
};
|
|
2762
|
+
}
|
|
2763
|
+
/**
|
|
2764
|
+
* Extract public key info from a did:jwk DID
|
|
2765
|
+
* @throws Error if the DID is not in did:jwk format
|
|
2766
|
+
*/
|
|
2767
|
+
extractPublicKeyInfo(did) {
|
|
2768
|
+
if (!did.startsWith("did:jwk:")) {
|
|
2769
|
+
throw new Error("Only did:jwk format is supported");
|
|
2770
|
+
}
|
|
2771
|
+
return extractPublicKeyFromDid(did);
|
|
2772
|
+
}
|
|
2773
|
+
};
|
|
2774
|
+
|
|
2749
2775
|
// src/vc/api-vc-manager.ts
|
|
2750
2776
|
import {
|
|
2751
2777
|
CredentialType as CredentialType2
|
|
@@ -4689,6 +4715,7 @@ export {
|
|
|
4689
4715
|
SimpleRebac,
|
|
4690
4716
|
ToolManager,
|
|
4691
4717
|
UserIdentityManager,
|
|
4718
|
+
UserKeyPairManager,
|
|
4692
4719
|
VCManager,
|
|
4693
4720
|
VPManager,
|
|
4694
4721
|
checkPermissionWithVP,
|