Record Class KmsKey

java.lang.Object
java.lang.Record
co.cryptoservice.sdk.KmsKey
Record Components:
algorithm - key algorithm
createdAt - creation time, ISO 8601
enabled - whether the key is enabled
keyId - the provider's key identifier (local keys: local-<hex>)
provider - the provider that served the request (local, aws, gcp, vault)
usage - the key usage, or null for encrypt
currentVersion - current key version, when versioned, or null when absent

public record KmsKey(String algorithm, String createdAt, boolean enabled, String keyId, String provider, String usage, Integer currentVersion) extends Record
What POST /v2/kms/create-key answers: create a managed key in the designated KMS provider.
  • Constructor Details

    • KmsKey

      public KmsKey(String algorithm, String createdAt, boolean enabled, String keyId, String provider, String usage, Integer currentVersion)
      Creates an instance of a KmsKey record class.
      Parameters:
      algorithm - the value for the algorithm record component
      createdAt - the value for the createdAt record component
      enabled - the value for the enabled record component
      keyId - the value for the keyId record component
      provider - the value for the provider record component
      usage - the value for the usage record component
      currentVersion - the value for the currentVersion record component
  • Method Details

    • toString

      public String toString()
      Names the members; values that may be secret (keys, plaintexts, passwords, signatures) are redacted.
      Specified by:
      toString in class Record
      Returns:
      a description safe to log
    • 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.
    • algorithm

      public String algorithm()
      Returns the value of the algorithm record component.
      Returns:
      the value of the algorithm record component
    • createdAt

      public String createdAt()
      Returns the value of the createdAt record component.
      Returns:
      the value of the createdAt record component
    • enabled

      public boolean enabled()
      Returns the value of the enabled record component.
      Returns:
      the value of the enabled record component
    • keyId

      public String keyId()
      Returns the value of the keyId record component.
      Returns:
      the value of the keyId record component
    • provider

      public String provider()
      Returns the value of the provider record component.
      Returns:
      the value of the provider record component
    • usage

      public String usage()
      Returns the value of the usage record component.
      Returns:
      the value of the usage record component
    • currentVersion

      public Integer currentVersion()
      Returns the value of the currentVersion record component.
      Returns:
      the value of the currentVersion record component