Interface KeyMetadata

All Known Implementing Classes:
ImmutableKeyMetadata, KeyMetadata.AbstractKeyMetadata

public interface KeyMetadata
Metadata about a particular key, public or private. This interface acts like a pointer to a key without having to pass around the key itself. This pattern enables a single API to operate with keys that exist in the same JVM as the running program, but also allows the API to operate on keys that exist outside of the JVM, such as in an external key-store like an HSM or other hardware wallet.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    To satisfy immutables.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final KeyMetadata
    Any empty instance that conforms to this interface but is otherwise empty.
  • Method Summary

    Modifier and Type
    Method
    Description
    A Builder for immutables.
    The unique identifier for the private-key used to encrypt this encoded secret.
    An optional password that will unlock this particular key.
    The unique identifier of the keyring that holds the the private-key used to encrypt this encoded secret.
    The version of the encryption key used to encrypt this secret.
    The unique identifier of the platform that can decode this secret.
  • Field Details

    • EMPTY

      static final KeyMetadata EMPTY
      Any empty instance that conforms to this interface but is otherwise empty. The purpose of this instance is to enable the signing interface to work with implementations that don't have more than a single private key internally without having to introduce null values into the API.
  • Method Details

    • builder

      static ImmutableKeyMetadata.Builder builder()
      A Builder for immutables.
      Returns:
      A ImmutableKeyMetadata.Builder.
    • platformIdentifier

      String platformIdentifier()
      The unique identifier of the platform that can decode this secret.
      Returns:
      A String.
    • keyringIdentifier

      String keyringIdentifier()
      The unique identifier of the keyring that holds the the private-key used to encrypt this encoded secret.
      Returns:
      A String.
    • keyIdentifier

      String keyIdentifier()
      The unique identifier for the private-key used to encrypt this encoded secret.
      Returns:
      A String.
    • keyVersion

      String keyVersion()
      The version of the encryption key used to encrypt this secret.
      Returns:
      A String.
    • keyPassword

      Optional<String> keyPassword()
      An optional password that will unlock this particular key.
      Returns:
      An Optional of type String.