Package co.cryptoservice.sdk
Record Class KdfResult
java.lang.Object
java.lang.Record
co.cryptoservice.sdk.KdfResult
- Record Components:
algorithm- the algorithmderivedKey- the derived key; lowercase hexkeyLength- derived key length in bytessalt- the salt used: the request's, or 16 random bytes; lowercase hex
public record KdfResult(String algorithm, String derivedKey, int keyLength, String salt)
extends Record
What
POST /v2/kdf answers: derive a key from a password.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealgorithmrecord component.Returns the value of thederivedKeyrecord component.byte[]derivedKey()decoded from hex.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thekeyLengthrecord component.salt()Returns the value of thesaltrecord component.byte[]salt()decoded from hex.toString()Names the members; values that may be secret (keys, plaintexts, passwords, signatures) are redacted.
-
Constructor Details
-
KdfResult
Creates an instance of aKdfResultrecord class.- Parameters:
algorithm- the value for thealgorithmrecord componentderivedKey- the value for thederivedKeyrecord componentkeyLength- the value for thekeyLengthrecord componentsalt- the value for thesaltrecord component
-
-
Method Details
-
derivedKeyBytes
public byte[] derivedKeyBytes()derivedKey()decoded from hex.- Returns:
- the bytes, or null when
derivedKeyis absent - Throws:
IllegalArgumentException- when the server sent malformed hex
-
saltBytes
public byte[] saltBytes()salt()decoded from hex.- Returns:
- the bytes, or null when
saltis absent - Throws:
IllegalArgumentException- when the server sent malformed hex
-
toString
Names the members; values that may be secret (keys, plaintexts, passwords, signatures) are redacted. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
algorithm
Returns the value of thealgorithmrecord component.- Returns:
- the value of the
algorithmrecord component
-
derivedKey
Returns the value of thederivedKeyrecord component.- Returns:
- the value of the
derivedKeyrecord component
-
keyLength
public int keyLength()Returns the value of thekeyLengthrecord component.- Returns:
- the value of the
keyLengthrecord component
-
salt
Returns the value of thesaltrecord component.- Returns:
- the value of the
saltrecord component
-