AesGcmHkdfStreamingKeyManager extends KeyTypeManager<AesGcmHkdfStreamingKey> { public static final KeyTemplate aes256GcmHkdf1MBTemplate() { return createKeyTemplate(32, HashType.SHA256, 32, 1 << 20); } AesGcmHkdfStreamingKeyManager(); @Override String getKeyType(); @Override int getVersion(); @Override KeyMaterialType keyMaterialType(); @Override void validateKey(AesGcmHkdfStreamingKey key); @Override AesGcmHkdfStreamingKey parseKey(ByteString byteString); @Override KeyFactory<AesGcmHkdfStreamingKeyFormat, AesGcmHkdfStreamingKey> keyFactory(); static void register(boolean newKeyAllowed); static final KeyTemplate aes128GcmHkdf4KBTemplate(); static final KeyTemplate aes128GcmHkdf1MBTemplate(); static final KeyTemplate aes256GcmHkdf4KBTemplate(); static final KeyTemplate aes256GcmHkdf1MBTemplate();  }
@Test public void testAes256GcmHkdf1MBTemplate() throws Exception { KeyTemplate template = AesGcmHkdfStreamingKeyManager.aes256GcmHkdf1MBTemplate(); assertThat(template.getTypeUrl()).isEqualTo(new AesGcmHkdfStreamingKeyManager().getKeyType()); assertThat(template.getOutputPrefixType()).isEqualTo(KeyTemplate.OutputPrefixType.RAW); AesGcmHkdfStreamingKeyFormat format = AesGcmHkdfStreamingKeyFormat.parseFrom( template.getValue(), ExtensionRegistryLite.getEmptyRegistry()); assertThat(format.getKeySize()).isEqualTo(32); assertThat(format.getParams().getDerivedKeySize()).isEqualTo(32); assertThat(format.getParams().getHkdfHashType()).isEqualTo(HashType.SHA256); assertThat(format.getParams().getCiphertextSegmentSize()).isEqualTo(1 << 20); }