Record Class TransitKey

java.lang.Object
java.lang.Record
codes.grow.packages.vault.TransitKey
Record Components:
name - key name
type - key type, e.g. aes256-gcm96, ed25519
keys - version to creation time (unix seconds as text) or, for asymmetric keys, the JSON of the version entry (with public_key)
latestVersion - latest version
minDecryptionVersion - minimum version allowed for decryption
minEncryptionVersion - minimum version used for encryption (0 = latest)
minAvailableVersion - oldest version still stored
deletionAllowed - whether deleteKey is allowed
exportable - whether the key can be exported
derived - whether key derivation is used
supportsEncryption - encryption support
supportsDecryption - decryption support
supportsSigning - signing support
supportsDerivation - derivation support
autoRotatePeriod - automatic rotation period (zero = off)

public record TransitKey(String name, String type, Map<String,String> keys, int latestVersion, int minDecryptionVersion, int minEncryptionVersion, int minAvailableVersion, boolean deletionAllowed, boolean exportable, boolean derived, boolean supportsEncryption, boolean supportsDecryption, boolean supportsSigning, boolean supportsDerivation, Duration autoRotatePeriod) extends Record
A transit key (GET transit/keys/<name>).
  • Constructor Details

    • TransitKey

      public TransitKey(String name, String type, Map<String,String> keys, int latestVersion, int minDecryptionVersion, int minEncryptionVersion, int minAvailableVersion, boolean deletionAllowed, boolean exportable, boolean derived, boolean supportsEncryption, boolean supportsDecryption, boolean supportsSigning, boolean supportsDerivation, Duration autoRotatePeriod)
      Creates the record; the map is copied.
      Parameters:
      name - name
      type - type
      keys - keys
      latestVersion - latest version
      minDecryptionVersion - min decryption version
      minEncryptionVersion - min encryption version
      minAvailableVersion - min available version
      deletionAllowed - deletion flag
      exportable - export flag
      derived - derived flag
      supportsEncryption - encryption flag
      supportsDecryption - decryption flag
      supportsSigning - signing flag
      supportsDerivation - derivation flag
      autoRotatePeriod - rotation period
  • Method Details

    • 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 '=='.
      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.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • type

      public String type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • keys

      public Map<String,String> keys()
      Returns the value of the keys record component.
      Returns:
      the value of the keys record component
    • latestVersion

      public int latestVersion()
      Returns the value of the latestVersion record component.
      Returns:
      the value of the latestVersion record component
    • minDecryptionVersion

      public int minDecryptionVersion()
      Returns the value of the minDecryptionVersion record component.
      Returns:
      the value of the minDecryptionVersion record component
    • minEncryptionVersion

      public int minEncryptionVersion()
      Returns the value of the minEncryptionVersion record component.
      Returns:
      the value of the minEncryptionVersion record component
    • minAvailableVersion

      public int minAvailableVersion()
      Returns the value of the minAvailableVersion record component.
      Returns:
      the value of the minAvailableVersion record component
    • deletionAllowed

      public boolean deletionAllowed()
      Returns the value of the deletionAllowed record component.
      Returns:
      the value of the deletionAllowed record component
    • exportable

      public boolean exportable()
      Returns the value of the exportable record component.
      Returns:
      the value of the exportable record component
    • derived

      public boolean derived()
      Returns the value of the derived record component.
      Returns:
      the value of the derived record component
    • supportsEncryption

      public boolean supportsEncryption()
      Returns the value of the supportsEncryption record component.
      Returns:
      the value of the supportsEncryption record component
    • supportsDecryption

      public boolean supportsDecryption()
      Returns the value of the supportsDecryption record component.
      Returns:
      the value of the supportsDecryption record component
    • supportsSigning

      public boolean supportsSigning()
      Returns the value of the supportsSigning record component.
      Returns:
      the value of the supportsSigning record component
    • supportsDerivation

      public boolean supportsDerivation()
      Returns the value of the supportsDerivation record component.
      Returns:
      the value of the supportsDerivation record component
    • autoRotatePeriod

      public Duration autoRotatePeriod()
      Returns the value of the autoRotatePeriod record component.
      Returns:
      the value of the autoRotatePeriod record component