Record Class WrappedIdentity
java.lang.Object
java.lang.Record
lol.trq.alts.vault.WrappedIdentity
- Record Components:
ed25519PublicKey- the identity (signing) public key, Base64 raw 32 bytesx25519PublicKey- the key-agreement public key, Base64 raw 32 byteskdfSalt- the PBKDF2 salt for the passphrase-derived master key, Base64kdfIterations- the PBKDF2 iteration countwrappedPrivateMaterial- the private key material sealed under the master key (iv||ct), Base64recoverySalt- the PBKDF2 salt for the recovery-code key, Base64, or null if no recovery is setrecoveryWrappedPrivateMaterial- the private material sealed under the recovery key (iv||ct), Base64, or null if no recovery is set
public record WrappedIdentity(String ed25519PublicKey, String x25519PublicKey, String kdfSalt, int kdfIterations, String wrappedPrivateMaterial, String recoverySalt, String recoveryWrappedPrivateMaterial)
extends Record
The server-storable, passphrase-protected form of a
VaultIdentity. Holds the two public keys
in the clear (they are public) plus the private key material sealed under a passphrase-derived key,
and optionally a second sealing of the same material under an offline recovery code. The server, or
anyone without the passphrase or recovery code, learns nothing exploitable from this record.- Since:
- 0.2.0, moved from
lol.trq.alts.cryptoin 1.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theed25519PublicKeyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns whether this identity carries an offline recovery sealing.intReturns the value of thekdfIterationsrecord component.kdfSalt()Returns the value of thekdfSaltrecord component.Returns the value of therecoverySaltrecord component.Returns the value of therecoveryWrappedPrivateMaterialrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thewrappedPrivateMaterialrecord component.Returns the value of thex25519PublicKeyrecord component.
-
Constructor Details
-
WrappedIdentity
public WrappedIdentity(String ed25519PublicKey, String x25519PublicKey, String kdfSalt, int kdfIterations, String wrappedPrivateMaterial, String recoverySalt, String recoveryWrappedPrivateMaterial) Validates that the always-present components are non-null.- Throws:
AltsException- of kindAltsFailure.Kind.INVALID_INPUTifed25519PublicKey,x25519PublicKey,kdfSaltorwrappedPrivateMaterialis null, as in a stored record that lost a field- Since:
- 0.2.0
-
-
Method Details
-
hasRecovery
public boolean hasRecovery()Returns whether this identity carries an offline recovery sealing.- Returns:
- true if a recovery code can restore this identity
- Since:
- 0.2.0
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
ed25519PublicKey
Returns the value of theed25519PublicKeyrecord component.- Returns:
- the value of the
ed25519PublicKeyrecord component
-
x25519PublicKey
Returns the value of thex25519PublicKeyrecord component.- Returns:
- the value of the
x25519PublicKeyrecord component
-
kdfSalt
-
kdfIterations
@SerializedName("kdfIterations") public int kdfIterations()Returns the value of thekdfIterationsrecord component.- Returns:
- the value of the
kdfIterationsrecord component
-
wrappedPrivateMaterial
Returns the value of thewrappedPrivateMaterialrecord component.- Returns:
- the value of the
wrappedPrivateMaterialrecord component
-
recoverySalt
Returns the value of therecoverySaltrecord component.- Returns:
- the value of the
recoverySaltrecord component
-
recoveryWrappedPrivateMaterial
Returns the value of therecoveryWrappedPrivateMaterialrecord component.- Returns:
- the value of the
recoveryWrappedPrivateMaterialrecord component
-