Package com.yahoo.security
Class KeyId
java.lang.Object
com.yahoo.security.KeyId
Represents a named key ID comprising an arbitrary (but length-limited)
sequence of valid UTF-8 bytes.
- Author:
- vekterli
-
Field Summary
Fields -
Method Summary
-
Field Details
-
MAX_KEY_ID_UTF8_LENGTH
public static final int MAX_KEY_ID_UTF8_LENGTH- See Also:
-
-
Method Details
-
ofBytes
Construct a KeyId containing the given sequence of bytes.- Parameters:
keyIdBytes- array of valid UTF-8 bytes. May be zero-length, but not null. Note: to avoid accidental mutations, the key bytes are deep-copied.- Returns:
- a new KeyId instance
-
ofString
Construct a KeyId containing the UTF-8 byte representation of the given string.- Parameters:
keyId- a string whose UTF-8 byte representation will be the key ID. May be zero-length but not null.- Returns:
- a new KeyId instance
-
asBytes
public byte[] asBytes()- Returns:
- the raw backing byte array. Must therefore not be mutated.
-
asString
-
equals
-
hashCode
public int hashCode() -
toString
-