Interface TinkKey

  • All Known Implementing Classes:
    ProtoKey

    @Immutable
    public interface TinkKey
    TinkKey represents how Tink views individual keys. In contrast, KeysetHandle only provides access to a Keyset, which represents multiple keys.

    A TinkKey contains the data associated to a type of key and provides ways of getting that data. The TinkKey interface does not specify how the key data is represented nor how it provides access to the data.

    Do not use this in new code. Instead, use Key.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      KeyTemplate getKeyTemplate()
      A TinkKey should know the KeyTemplate from which it was generated, which in turn specifies the cryptographic algorithm in which the TinkKey should be used.
      boolean hasSecret()
      Returns true if the key contains secret key material, and false otherwise.
    • Method Detail

      • hasSecret

        boolean hasSecret()
        Returns true if the key contains secret key material, and false otherwise.
      • getKeyTemplate

        KeyTemplate getKeyTemplate()
        A TinkKey should know the KeyTemplate from which it was generated, which in turn specifies the cryptographic algorithm in which the TinkKey should be used. Throws UnsupportedOperationException to help ease rollout until it is possible to easily find the KeyTemplate associated to a key described in proto
        Returns:
        the KeyTemplate used to generate the key.
        Throws:
        java.lang.UnsupportedOperationException - if the TinkKey does not yet support returning its KeyTemplate