Annotation Type LowLevelCryptoCaller


  • @Target({TYPE,METHOD,CONSTRUCTOR,FIELD,LOCAL_VARIABLE})
    @Retention(CLASS)
    public @interface LowLevelCryptoCaller
    Required to call methods and classes that create primitives from single keys and without configurations instead of from keysets and with configurations.

    Methods that require this annotation have the following disadvantages over the usual Tink methods:

    • The method may not check that the parameters used satisfy any security requirements. For example, a method producing a Mac object from a HmacKey might allow a key size of 4 bytes or a tag size of 4 bytes. This is because these methods often need to tolerate compatibility with legacy systems, or are used for legacy reasons.
    • Since the user does not have a keyset, their code depends on a specific key type and on a single key. Hence, key rotation is more difficult.

    Still, such APIs are correct to use in a context where one implements low level cryptography, and the choice of algorithm and the key rotation happens on a higher level, for example, if one implements a protocol which uses various cryptographic algorithms internally.