How to store an II in a file?

I want to make (in Rust) a Web robot (an app outside IC) that stores an II and uses this II to connect to IC.

Which file format? How to generate an II? Should I use BasicIdentity or should I use some form of delegate idenity? etc.?

Note that the monetary amount of loss of stealing this identity by a hacker is rather low. But I want to follow good security guidelines anyway, to learn in the way.

@qwertytrewq: Would you mind expanding your use-case a little bit further? Do you need just some identity to interact with the IC or do you need an identity issued by Internet Identity specifically? If so, why does the web robot need an II?

I would suggest to generate a BasicIdentity as you suggested and simply use that (without being tied to Internet Identity in any way).

I need some identity compatible with IC.

The robot needs an identity to send requests to IC that only this robot is allowed to do (simply, API authentication).

How to generate BasicIdentity?

@qwertytrewq: You can generate an ED25519 key pair from a secure random source and then initialize the BasicIdentity with that.

1 Like