Class KeyCertificate
java.lang.Object
com.iizix.license.v2.KeyCertificate
A signing-key certificate (
LICENSE-V2-DESIGN.md section 2.4, ruling LV-3): the IIZI-KEYCERT/1 envelope a pinned root signs over a payload of v, kid (the certified key's ID), key (its Ed25519 public half), notBefore and notAfter (epoch milliseconds UTC, inclusive). The envelope's own kid line names the ROOT that signed it; the payload's kid names the key being certified. A licence document carries the certificate of the key that signed it in its cert line, and its kid line must equal this certificate's getKeyID().Constructed only by LicenseVerifier.verifyCertificate(byte[]), so an instance is a certificate that verified under a pinned root. Its validity at a later instant is isValidAt(Instant).
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe header line: "IIZI-KEYCERT/1".static final StringThe payload key "key": the certified key, base64url of its 32 bytes.static final PatternA key ID:[A-Za-z0-9][A-Za-z0-9._-]{0,63}, e.g.The payload keys, all required.static final StringThe payload key "kid": the certified key's ID.static final StringThe payload key "notAfter": the last instant the certificate is valid, epoch milliseconds.static final StringThe payload key "notBefore": the first instant the certificate is valid, epoch milliseconds.static final StringThe payload key "v": the format version,VERSION.static final intThe format version: 1.Method Summary
Modifier and TypeMethodDescriptionbyte[]getBytes()Gets the certificate bytes, theIIZI-KEYCERT/1envelope.getKey()Gets the certified key.byte[]Gets the certified key's 32 bytes.getKeyID()Gets the certified key's ID.Gets the certified key as text.Gets the last instant the certificate is valid.Gets the first instant the certificate is valid.Gets the key ID of the root that signed the certificate.static booleanTells whether a text is a key ID of the formKEY_ID_PATTERN.booleanTells whether an instant is inside the validity, both ends inclusive.toString()The key IDs and the validity, never the bytes.
Field Details
HEADER
VERSION
public static final int VERSIONThe format version: 1.- See Also:
KEY
The payload key "key": the certified key, base64url of its 32 bytes.- See Also:
KID
NOT_AFTER
The payload key "notAfter": the last instant the certificate is valid, epoch milliseconds.- See Also:
NOT_BEFORE
The payload key "notBefore": the first instant the certificate is valid, epoch milliseconds.- See Also:
V
KEYS
KEY_ID_PATTERN
A key ID:[A-Za-z0-9][A-Za-z0-9._-]{0,63}, e.g.mls-2026-1.
Method Details
isKeyID
Tells whether a text is a key ID of the formKEY_ID_PATTERN.- Parameters:
text- The text, may be null.- Returns:
- true for a key ID.
getBytes
public byte[] getBytes()Gets the certificate bytes, theIIZI-KEYCERT/1envelope.- Returns:
- A copy of the bytes.
getRootKeyID
Gets the key ID of the root that signed the certificate.- Returns:
- The root's key ID, the envelope's
kid.
getKeyID
getKey
getKeyBytes
public byte[] getKeyBytes()Gets the certified key's 32 bytes.- Returns:
- A copy of the bytes.
getKeyText
getNotBefore
getNotAfter
isValidAt
Tells whether an instant is inside the validity, both ends inclusive.- Parameters:
now- The instant.- Returns:
- true when
notBefore <= now <= notAfter.
toString