Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request]: Storage Handling #1269

Open
drtwodog opened this issue Dec 1, 2023 · 4 comments
Open

[Request]: Storage Handling #1269

drtwodog opened this issue Dec 1, 2023 · 4 comments
Labels
Request Request a feature

Comments

@drtwodog
Copy link

drtwodog commented Dec 1, 2023

Hello,
I hope you can help me.

Description

I create some UI examples based on your nodejs examples.
Here I want to first of all create a DID with a specific verification method

In different steps I want to use that method to create VCs. But I need to have the storage (..the private keys)
In your example you have the direct access to the storage and could you it directly.

Could you help me to understand how I access that storage to create VCs.
I tried to use
var keyStorage = storage.keyStorage();
var keyIdStorage = storage.keyIdStorage();

But when I try :
const storage: Storage = new Storage(keyStorage , keyIdStorage);

I gives me the error:
identity-wasm/node/identity_wasm.js:9339
const ret = getObject(arg0).getKeyId(MethodDigest.__wrap(arg1));
^
TypeError: getObject(...).getKeyId is not a function

I know that this is an Support question, but I hope you can help me out?

By the way, is it planned to include the identity framwaork somehow to the sdk?

Regards..

@drtwodog drtwodog added the Request Request a feature label Dec 1, 2023
@drtwodog
Copy link
Author

drtwodog commented Dec 1, 2023

To be more precise:
The question is: Could you give me an example how to call the storage from an did and sign with that key a VC?

Regards

@abdulmth
Copy link
Contributor

abdulmth commented Dec 1, 2023

When you call

    const credentialJwt = await issuerDocument.createCredentialJwt(
        issuerStorage,
        issuerFragment,
        unsignedVc,
        new JwsSignatureOptions(),
    );

(taken from createVC example)

The storage will be automatically used to sign the VC. You don't have to sign it manually. The key that will be used is defined by the issuerFragmen. So what happens in that method, is it takes the fragment, looks for the verification method corresponding to it, calculates the key_id for that verification method in the key id storage, then uses the JWT storage to sign the VC with that key. So basically, when you use that method, you don't have to sign anything manually. Read more in https://wiki.iota.org/identity.rs/how-tos/key-storage .

Note that in the JS bindings, we don't offer any persistent storage solution yet. You have to implement the storage interfaces yourself. In Rust, we provide a stronghold implementation ready to be used.

About the SDK, AFAIK there are no plans right now for including identity as a part of the SDK.

@drtwodog
Copy link
Author

drtwodog commented Dec 1, 2023

Hey, thx for the Fast Response. I saw that vc method.
In your example you create the storage in the same Methode and use it for the creation of the did and then for the vc.

I want first to create the did with the Service... and then later create the vc ( e.g. at an other point in time) in a seperated method.

How is this possible? Get the storage with the keyId???

@drtwodog
Copy link
Author

drtwodog commented Dec 1, 2023

ahhh ok, no persitent storage... I read that to late -> I saw that stronghold for rust -> is it planned to have it in JS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request Request a feature
Projects
None yet
Development

No branches or pull requests

2 participants