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 bytes
x25519PublicKey - the key-agreement public key, Base64 raw 32 bytes
kdfSalt - the PBKDF2 salt for the passphrase-derived master key, Base64
kdfIterations - the PBKDF2 iteration count
wrappedPrivateMaterial - the private key material sealed under the master key (iv||ct), Base64
recoverySalt - the PBKDF2 salt for the recovery-code key, Base64, or null if no recovery is set
recoveryWrappedPrivateMaterial - 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.crypto in 1.0.0
  • 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 kind AltsFailure.Kind.INVALID_INPUT if ed25519PublicKey, x25519PublicKey, kdfSalt or wrappedPrivateMaterial is 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

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • ed25519PublicKey

      @SerializedName("ed25519PublicKey") public String ed25519PublicKey()
      Returns the value of the ed25519PublicKey record component.
      Returns:
      the value of the ed25519PublicKey record component
    • x25519PublicKey

      @SerializedName("x25519PublicKey") public String x25519PublicKey()
      Returns the value of the x25519PublicKey record component.
      Returns:
      the value of the x25519PublicKey record component
    • kdfSalt

      @SerializedName("kdfSalt") public String kdfSalt()
      Returns the value of the kdfSalt record component.
      Returns:
      the value of the kdfSalt record component
    • kdfIterations

      @SerializedName("kdfIterations") public int kdfIterations()
      Returns the value of the kdfIterations record component.
      Returns:
      the value of the kdfIterations record component
    • wrappedPrivateMaterial

      @SerializedName("wrappedPrivateMaterial") public String wrappedPrivateMaterial()
      Returns the value of the wrappedPrivateMaterial record component.
      Returns:
      the value of the wrappedPrivateMaterial record component
    • recoverySalt

      @SerializedName("recoverySalt") public String recoverySalt()
      Returns the value of the recoverySalt record component.
      Returns:
      the value of the recoverySalt record component
    • recoveryWrappedPrivateMaterial

      @SerializedName("recoveryWrappedPrivateMaterial") public String recoveryWrappedPrivateMaterial()
      Returns the value of the recoveryWrappedPrivateMaterial record component.
      Returns:
      the value of the recoveryWrappedPrivateMaterial record component