@Alpha @Immutable public final class SecretBytes extends Object
SecretKeyAccess.| Modifier and Type | Method and Description |
|---|---|
static SecretBytes |
copyFrom(byte[] value,
SecretKeyAccess access)
Creates a new SecretBytes with the contents given in
value. |
boolean |
equalsSecretBytes(SecretBytes other)
Returns true if the
other byte array has the same bytes, in time depending only on the
length of both SecretBytes objects. |
static SecretBytes |
randomBytes(int length)
Creates a new SecretBytes with bytes chosen uniformly at random of length
length. |
int |
size()
Returns the length of the bytes wrapped by this object.
|
byte[] |
toByteArray(SecretKeyAccess access)
Returns a copy of the bytes wrapped by this object.
|
public static SecretBytes copyFrom(byte[] value, SecretKeyAccess access)
value.
The parameter access must be non-null.
public static SecretBytes randomBytes(int length)
length.public byte[] toByteArray(SecretKeyAccess access)
The parameter access must be non-null.
public int size()
public boolean equalsSecretBytes(SecretBytes other)
other byte array has the same bytes, in time depending only on the
length of both SecretBytes objects.