AesCtrHmacStreamingKeyManager extends KeyTypeManager<AesCtrHmacStreamingKey> { public static final KeyTemplate aes256CtrHmacSha2564KBTemplate() { return createKeyTemplate(32, HashType.SHA256, 32, HashType.SHA256, 32, 4096); } AesCtrHmacStreamingKeyManager(); @Override String getKeyType(); @Override int getVersion(); @Override KeyMaterialType keyMaterialType(); @Override void validateKey(AesCtrHmacStreamingKey key); @Override AesCtrHmacStreamingKey parseKey(ByteString byteString); @Override KeyFactory<AesCtrHmacStreamingKeyFormat, AesCtrHmacStreamingKey> keyFactory(); static void register(boolean newKeyAllowed); static final KeyTemplate aes128CtrHmacSha2564KBTemplate(); static final KeyTemplate aes128CtrHmacSha2561MBTemplate(); static final KeyTemplate aes256CtrHmacSha2564KBTemplate(); static final KeyTemplate aes256CtrHmacSha2561MBTemplate();  }
@Test public void testAes256CtrHmacSha2564KBTemplate() throws Exception { KeyTemplate template = AesCtrHmacStreamingKeyManager.aes256CtrHmacSha2564KBTemplate(); assertThat(template.getTypeUrl()).isEqualTo(new AesCtrHmacStreamingKeyManager().getKeyType()); assertThat(template.getOutputPrefixType()).isEqualTo(KeyTemplate.OutputPrefixType.RAW); AesCtrHmacStreamingKeyFormat format = AesCtrHmacStreamingKeyFormat.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().getHmacParams().getHash()).isEqualTo(HashType.SHA256); assertThat(format.getParams().getHmacParams().getTagSize()).isEqualTo(32); assertThat(format.getParams().getCiphertextSegmentSize()).isEqualTo(4096); }