Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Improve signer secret import #17

Description

@vasco-santos

Context: #15 (comment)

I think we should embrace the composed principals exposed by ucanto instead of assuming which key types are at play. Specifically we have SignerImporter interface that import Signer from '@ucanto/principal' implements.

That is to say I think it would make a lot more sense if we wrote JSON.serialize(signer.toArchive()) into secrets and then read loaded it with Signer.from(JSON.parse(secret)).

Also note that this would remove need for signer.withDID(did) dance as long as what we stored in secrets is ed25519.parse('...').withDID(did)

P.S. Only reason toArchive does not return bytes or a string today is because in browsers we won't be able to serialize non-extractible keys, yet we could store object containing them into indexedDB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions