Identity management


Let's review some code examples on how to handle identities with the Java client library:

Tip: if you're new to our Java library, we suggest you begin with our Get Started guide.

Creating an Identity

To create or load an identity from a file:

RadixIdentity identity = RadixIdentities.loadOrCreateEncryptedFile("filename.key", "password");

This will either create or load a file with a public/private key and encrypted with the given password.

Getting an Address

An address is a reference to an account and allows a user to receive tokens and/or data from other users.

You can get your own address by:

RadixAddress myAddress = api.getAddress();

Or from a base58 string:

RadixAddress anotherAddress = RadixAddress.fromString("JHB89drvftPj6zVCNjnaijURk8D8AMFw4mVja19aoBGmRXWchnJ");