Class Hello
java.lang.Object
com.iizix.license.v2.Hello
The byte strings the identity proofs sign (
LICENSE-V2-DESIGN.md sections 5.1, 5.2 and 5.4), one method each, so that no caller concatenates them itself and both ends of a wire build the same bytes:mlsHello(byte[], byte[], UUID):"iizi-mls-hello/2" 0x00 cn sn lic- the MLS signing key's proof to a client (5.1 step 2).installProve(byte[], byte[], UUID):"iizi-install-prove/2" 0x00 sn cn lic- the installation key's proof to the MLS (5.2 step 4).hubRegister(byte[], String, String):"iizi-hub-register/1" 0x00 pn member run- the installation key's proof to the hub principal (5.4, HUBREGISTER).
Layout. The label in ASCII, one zero byte, then the fields: a nonce is exactly 32 bytes; a licence UUID is its 16 bytes big-endian (the most significant long first); a string is its UTF-8 bytes preceded by their count as two bytes big-endian. Every field has a fixed length or carries its length, so two different inputs never give the same bytes, and the label differs per proof, so a signature over one is never a signature over another (5.2).
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe label of a member's proof to the hub principal: "iizi-hub-register/1".static final StringThe label of an installation's proof to the MLS: "iizi-install-prove/2".static final intThe largest string a proof carries: 65535 bytes of UTF-8.static final StringThe label of the MLS's proof: "iizi-mls-hello/2".static final intThe length of a nonce: 32 bytes.Method Summary
Modifier and TypeMethodDescriptionstatic byte[]hubRegister(byte[] pn, String member, String run) The bytes a member signs to prove itself to the hub principal (5.4):"iizi-hub-register/1" 0x00 pn member run.static byte[]installProve(byte[] sn, byte[] cn, UUID lic) The bytes an installation signs to prove itself to the MLS (5.2 step 4):"iizi-install-prove/2" 0x00 sn cn lic.static byte[]The bytes the MLS signs to prove itself (5.1 step 2):"iizi-mls-hello/2" 0x00 cn sn lic.static byte[]newNonce()Creates a nonce: 32 random bytes.
Field Details
MLS_HELLO
INSTALL_PROVE
The label of an installation's proof to the MLS: "iizi-install-prove/2".- See Also:
HUB_REGISTER
The label of a member's proof to the hub principal: "iizi-hub-register/1".- See Also:
NONCE_LENGTH
public static final int NONCE_LENGTHThe length of a nonce: 32 bytes.- See Also:
MAX_STRING_LENGTH
public static final int MAX_STRING_LENGTHThe largest string a proof carries: 65535 bytes of UTF-8.- See Also:
Method Details
newNonce
mlsHello
The bytes the MLS signs to prove itself (5.1 step 2):"iizi-mls-hello/2" 0x00 cn sn lic.- Parameters:
cn- The client's nonce, 32 bytes.sn- The MLS's nonce, 32 bytes.lic- The licence UUID.- Returns:
- The bytes to sign or verify.
- Throws:
IllegalArgumentException- If a nonce is not 32 bytes.
installProve
The bytes an installation signs to prove itself to the MLS (5.2 step 4):"iizi-install-prove/2" 0x00 sn cn lic.- Parameters:
sn- The MLS's nonce, 32 bytes.cn- The client's nonce, 32 bytes.lic- The licence UUID.- Returns:
- The bytes to sign or verify.
- Throws:
IllegalArgumentException- If a nonce is not 32 bytes.
hubRegister
The bytes a member signs to prove itself to the hub principal (5.4):"iizi-hub-register/1" 0x00 pn member run.- Parameters:
pn- The principal's challenge, 32 bytes.member- The member ID.run- The member's run ID.- Returns:
- The bytes to sign or verify.
- Throws:
IllegalArgumentException- If the challenge is not 32 bytes or a string exceeds 65535 bytes of UTF-8.