Interface TinkFlag


  • public interface TinkFlag
    Describes a change to Tink behavior.

    A flag describes a change to behavior in Tink.

    There are several use cases for flags.

    The most common use cases is that flags are used to change change behavior of APIs in Tink. The only way this is done is that an API which previously did some operation will be changed to throw an exception (due to some validation error). The flag can then be used to fall back to the legacy behavior where the input is accepted. For example, this can be done when parsing is made stricter.

    Another use case is that the flag makes validation less strict. This can be useful when one wants to react to emergency. For example, suppose a Keyset has an AEAD key which is not a primary and is of a key type which Tink does not understand. In this case it can be useful to ignore this key.

    • Method Detail

      • setValue

        void setValue​(boolean t)
        Overrides the value to t for this flag.

        Users can set this to enable different behavior.

      • getValue

        boolean getValue()
        Returns the current value of this flag.

        This is typically only used within Tink to control behavior.