Class StreamingAeadKeyTemplates


  • @Deprecated
    public final class StreamingAeadKeyTemplates
    extends java.lang.Object
    Deprecated.
    Try using our refaster templates to replace them (see https://github.com/tink-crypto/tink-java/tree/main/tools/refaster). If migration is unclear, please file an issue on https://github.com/tink-crypto/tink-java.
    Pre-generated KeyTemplate for StreamingAead keys.

    We recommend to avoid this class in order to keep dependencies small.

    • Using this class adds a dependency on protobuf. We hope that eventually it is possible to use Tink without a dependency on protobuf.
    • Using this class adds a dependency on classes for all involved key types.
    These dependencies all come from static class member variables, which are initialized when the class is loaded. This implies that static analysis and code minimization tools (such as proguard) cannot remove the usages either.

    Instead, we recommend to use KeysetHandle.generateEntryFromParametersName or KeysetHandle.generateEntryFromParameters.

    One can use these templates to generate new Keyset with KeysetHandle. To generate a new keyset that contains a AesGcmHkdfStreamingKey, one can do:

    
     StreamingAeadConfig.register();
     KeysetHandle handle = KeysetHandle.generateNew(StreamingAeadKeyTemplates.AES128_GCM_HKDF_4KB);
     StreamingAead ags = handle.getPrimitive(RegistryConfiguration.get(), StreamingAead.class);
     
    Since:
    1.1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static com.google.crypto.tink.proto.KeyTemplate AES128_CTR_HMAC_SHA256_1MB
      Deprecated.
      A KeyTemplate that generates new instances of AesCtrHmacStreamingKey with the following parameters: Size of the main key: 16 bytes HKDF algo: HMAC-SHA256 Size of AES-CTR derived keys: 16 bytes Tag algo: HMAC-SHA256 Tag size: 32 bytes Ciphertext segment size: 1048576 bytes (1 MB)
      static com.google.crypto.tink.proto.KeyTemplate AES128_CTR_HMAC_SHA256_4KB
      Deprecated.
      A KeyTemplate that generates new instances of AesCtrHmacStreamingKey with the following parameters: Size of the main key: 16 bytes HKDF algo: HMAC-SHA256 Size of AES-CTR derived keys: 16 bytes Tag algo: HMAC-SHA256 Tag size: 32 bytes Ciphertext segment size: 4096
      static com.google.crypto.tink.proto.KeyTemplate AES128_GCM_HKDF_1MB
      Deprecated.
      A KeyTemplate that generates new instances of AesGcmHkdfStreamingKey with the following parameters: Size of the main key: 16 bytes HKDF algo: HMAC-SHA256 Size of AES-GCM derived keys: 16 bytes Ciphertext segment size: 1048576 bytes (1 MB)
      static com.google.crypto.tink.proto.KeyTemplate AES128_GCM_HKDF_4KB
      Deprecated.
      A KeyTemplate that generates new instances of AesGcmHkdfStreamingKey with the following parameters: Size of the main key: 16 bytes HKDF algo: HMAC-SHA256 Size of AES-GCM derived keys: 16 bytes Ciphertext segment size: 4096 bytes
      static com.google.crypto.tink.proto.KeyTemplate AES256_CTR_HMAC_SHA256_1MB
      Deprecated.
      A KeyTemplate that generates new instances of AesCtrHmacStreamingKey with the following parameters: Size of the main key: 32 bytes HKDF algo: HMAC-SHA256 Size of AES-CTR derived keys: 32 bytes Tag algo: HMAC-SHA256 Tag size: 32 bytes Ciphertext segment size: 1048576 bytes (1 MB)
      static com.google.crypto.tink.proto.KeyTemplate AES256_CTR_HMAC_SHA256_4KB
      Deprecated.
      A KeyTemplate that generates new instances of AesCtrHmacStreamingKey with the following parameters: Size of the main key: 32 bytes HKDF algo: HMAC-SHA256 Size of AES-CTR derived keys: 32 bytes Tag algo: HMAC-SHA256 Tag size: 32 bytes Ciphertext segment size: 4096
      static com.google.crypto.tink.proto.KeyTemplate AES256_GCM_HKDF_1MB
      Deprecated.
      A KeyTemplate that generates new instances of AesGcmHkdfStreamingKey with the following parameters: Size of the main key: 32 bytes HKDF algo: HMAC-SHA256 Size of AES-GCM derived keys: 32 bytes Ciphertext segment size: 1048576 bytes (1 MB)
      static com.google.crypto.tink.proto.KeyTemplate AES256_GCM_HKDF_4KB
      Deprecated.
      A KeyTemplate that generates new instances of AesGcmHkdfStreamingKey with the following parameters: Size of the main key: 32 bytes HKDF algo: HMAC-SHA256 Size of AES-GCM derived keys: 32 bytes Ciphertext segment size: 4096 bytes
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static com.google.crypto.tink.proto.KeyTemplate createAesCtrHmacStreamingKeyTemplate​(int mainKeySize, com.google.crypto.tink.proto.HashType hkdfHashType, int derivedKeySize, com.google.crypto.tink.proto.HashType macHashType, int tagSize, int ciphertextSegmentSize)
      Deprecated.
       
      static com.google.crypto.tink.proto.KeyTemplate createAesGcmHkdfStreamingKeyTemplate​(int mainKeySize, com.google.crypto.tink.proto.HashType hkdfHashType, int derivedKeySize, int ciphertextSegmentSize)
      Deprecated.
       
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • AES128_CTR_HMAC_SHA256_4KB

        public static final com.google.crypto.tink.proto.KeyTemplate AES128_CTR_HMAC_SHA256_4KB
        Deprecated.
        A KeyTemplate that generates new instances of AesCtrHmacStreamingKey with the following parameters:
        • Size of the main key: 16 bytes
        • HKDF algo: HMAC-SHA256
        • Size of AES-CTR derived keys: 16 bytes
        • Tag algo: HMAC-SHA256
        • Tag size: 32 bytes
        • Ciphertext segment size: 4096
      • AES128_CTR_HMAC_SHA256_1MB

        public static final com.google.crypto.tink.proto.KeyTemplate AES128_CTR_HMAC_SHA256_1MB
        Deprecated.
        A KeyTemplate that generates new instances of AesCtrHmacStreamingKey with the following parameters:
        • Size of the main key: 16 bytes
        • HKDF algo: HMAC-SHA256
        • Size of AES-CTR derived keys: 16 bytes
        • Tag algo: HMAC-SHA256
        • Tag size: 32 bytes
        • Ciphertext segment size: 1048576 bytes (1 MB)
      • AES256_CTR_HMAC_SHA256_4KB

        public static final com.google.crypto.tink.proto.KeyTemplate AES256_CTR_HMAC_SHA256_4KB
        Deprecated.
        A KeyTemplate that generates new instances of AesCtrHmacStreamingKey with the following parameters:
        • Size of the main key: 32 bytes
        • HKDF algo: HMAC-SHA256
        • Size of AES-CTR derived keys: 32 bytes
        • Tag algo: HMAC-SHA256
        • Tag size: 32 bytes
        • Ciphertext segment size: 4096
      • AES256_CTR_HMAC_SHA256_1MB

        public static final com.google.crypto.tink.proto.KeyTemplate AES256_CTR_HMAC_SHA256_1MB
        Deprecated.
        A KeyTemplate that generates new instances of AesCtrHmacStreamingKey with the following parameters:
        • Size of the main key: 32 bytes
        • HKDF algo: HMAC-SHA256
        • Size of AES-CTR derived keys: 32 bytes
        • Tag algo: HMAC-SHA256
        • Tag size: 32 bytes
        • Ciphertext segment size: 1048576 bytes (1 MB)
      • AES128_GCM_HKDF_4KB

        public static final com.google.crypto.tink.proto.KeyTemplate AES128_GCM_HKDF_4KB
        Deprecated.
        A KeyTemplate that generates new instances of AesGcmHkdfStreamingKey with the following parameters:
        • Size of the main key: 16 bytes
        • HKDF algo: HMAC-SHA256
        • Size of AES-GCM derived keys: 16 bytes
        • Ciphertext segment size: 4096 bytes
      • AES128_GCM_HKDF_1MB

        public static final com.google.crypto.tink.proto.KeyTemplate AES128_GCM_HKDF_1MB
        Deprecated.
        A KeyTemplate that generates new instances of AesGcmHkdfStreamingKey with the following parameters:
        • Size of the main key: 16 bytes
        • HKDF algo: HMAC-SHA256
        • Size of AES-GCM derived keys: 16 bytes
        • Ciphertext segment size: 1048576 bytes (1 MB)
      • AES256_GCM_HKDF_4KB

        public static final com.google.crypto.tink.proto.KeyTemplate AES256_GCM_HKDF_4KB
        Deprecated.
        A KeyTemplate that generates new instances of AesGcmHkdfStreamingKey with the following parameters:
        • Size of the main key: 32 bytes
        • HKDF algo: HMAC-SHA256
        • Size of AES-GCM derived keys: 32 bytes
        • Ciphertext segment size: 4096 bytes
      • AES256_GCM_HKDF_1MB

        public static final com.google.crypto.tink.proto.KeyTemplate AES256_GCM_HKDF_1MB
        Deprecated.
        A KeyTemplate that generates new instances of AesGcmHkdfStreamingKey with the following parameters:
        • Size of the main key: 32 bytes
        • HKDF algo: HMAC-SHA256
        • Size of AES-GCM derived keys: 32 bytes
        • Ciphertext segment size: 1048576 bytes (1 MB)
    • Method Detail

      • createAesCtrHmacStreamingKeyTemplate

        public static com.google.crypto.tink.proto.KeyTemplate createAesCtrHmacStreamingKeyTemplate​(int mainKeySize,
                                                                                                    com.google.crypto.tink.proto.HashType hkdfHashType,
                                                                                                    int derivedKeySize,
                                                                                                    com.google.crypto.tink.proto.HashType macHashType,
                                                                                                    int tagSize,
                                                                                                    int ciphertextSegmentSize)
        Deprecated.
        Returns:
        a KeyTemplate containing a AesCtrHmacStreamingKeyFormat with some specified parameters.
      • createAesGcmHkdfStreamingKeyTemplate

        public static com.google.crypto.tink.proto.KeyTemplate createAesGcmHkdfStreamingKeyTemplate​(int mainKeySize,
                                                                                                    com.google.crypto.tink.proto.HashType hkdfHashType,
                                                                                                    int derivedKeySize,
                                                                                                    int ciphertextSegmentSize)
        Deprecated.
        Returns:
        a KeyTemplate containing a AesGcmHkdfStreamingKeyFormat with some specified parameters.