Class OwnerIdentity
java.lang.Object
lol.trq.alts.vault.OwnerIdentity
The owner of a repository (AVP SPEC 3.1): the keys derived from a 24-word BIP39 phrase. The owner key is
fixed for the repository's life; only it signs the manifest states that change the members, the
refresh-token policy or the hosts. The owner's own device is also a member, whose keys derive from the
same phrase.
This is a secret: whoever holds the phrase or the entropy owns the repository. A host persists it as its
entropy() (for example in HostSecrets) and restores it with fromEntropy(byte[]), or shows the phrase() once and keeps nothing, and restores it with fromPhrase(String). A second owner device gets it without typing the phrase through a LinkSession. No method of the library sends the phrase, the entropy, the seed or a private key to a host,
and toString() shows none of them.
- Since:
- 1.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe length of the mnemonic entropy: 32 bytes, 24 words. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]entropy()The mnemonic entropy, the form a host persists.The owner fingerprint (SPEC 11.2), 16 hex digits, which a joiner'sRepoLocatorcarries.static OwnerIdentityfromEntropy(byte[] entropy) The owner from the entropy a host persisted.static OwnerIdentityfromPhrase(String phrase) The owner from a typed or pasted phrase.static OwnerIdentitygenerate()A new owner from fresh entropy.memberId()The owner key as a member id: the owner's Ed25519 public key, base64.phrase()The 24-word phrase.toString()The fingerprint only; never the phrase, the entropy or a key.
-
Field Details
-
ENTROPY_BYTES
public static final int ENTROPY_BYTESThe length of the mnemonic entropy: 32 bytes, 24 words.- Since:
- 1.0.0
- See Also:
-
-
Method Details
-
generate
-
fromPhrase
The owner from a typed or pasted phrase. Case and the whitespace between and around the words do not matter; the words and the checksum are checked (SPEC 3.1).- Parameters:
phrase- the 24 words- Returns:
- the identity
- Throws:
AltsException- of kindINVALID_INPUTif the phrase is not 24 words of the BIP39 English list with a matching checksum- Since:
- 1.0.0
-
fromEntropy
The owner from the entropy a host persisted.- Parameters:
entropy- the 32 bytesentropy()returned; copied- Returns:
- the identity
- Throws:
AltsException- of kindINVALID_INPUTif it is not 32 bytes- Since:
- 1.0.0
-
phrase
The 24-word phrase. A secret: show it to the owner, never log it.- Returns:
- the words, separated by single spaces
- Since:
- 1.0.0
-
entropy
public byte[] entropy()The mnemonic entropy, the form a host persists. A secret.- Returns:
- a copy of the 32 bytes, which the caller zeroes when done
- Since:
- 1.0.0
-
memberId
The owner key as a member id: the owner's Ed25519 public key, base64.- Returns:
- the member id
- Since:
- 1.0.0
-
fingerprint
The owner fingerprint (SPEC 11.2), 16 hex digits, which a joiner'sRepoLocatorcarries.- Returns:
- the fingerprint
- Since:
- 1.0.0
-
toString
-