@Test public void testAes256CmacTemplate() throws Exception { KeyTemplate template = AesCmacKeyManager.aes256CmacTemplate(); assertThat(template.getTypeUrl()).isEqualTo(new AesCmacKeyManager().getKeyType()); assertThat(template.getOutputPrefixType()).isEqualTo(KeyTemplate.OutputPrefixType.TINK); AesCmacKeyFormat format = AesCmacKeyFormat.parseFrom(template.getValue(), ExtensionRegistryLite.getEmptyRegistry()); assertThat(format.getKeySize()).isEqualTo(32); assertThat(format.getParams().getTagSize()).isEqualTo(16); }
public static final KeyTemplate aes256CmacTemplate() { AesCmacKeyFormat format = AesCmacKeyFormat.newBuilder() .setKeySize(32) .setParams(AesCmacParams.newBuilder().setTagSize(16).build()) .build(); return KeyTemplate.create( new AesCmacKeyManager().getKeyType(), format.toByteArray(), KeyTemplate.OutputPrefixType.TINK); }
AesCmacKeyManager extends KeyTypeManager<AesCmacKey> { public static final KeyTemplate aes256CmacTemplate() { AesCmacKeyFormat format = AesCmacKeyFormat.newBuilder() .setKeySize(32) .setParams(AesCmacParams.newBuilder().setTagSize(16).build()) .build(); return KeyTemplate.create( new AesCmacKeyManager().getKeyType(), format.toByteArray(), KeyTemplate.OutputPrefixType.TINK); } }
AesCmacKeyManager extends KeyTypeManager<AesCmacKey> { public static final KeyTemplate aes256CmacTemplate() { AesCmacKeyFormat format = AesCmacKeyFormat.newBuilder() .setKeySize(32) .setParams(AesCmacParams.newBuilder().setTagSize(16).build()) .build(); return KeyTemplate.create( new AesCmacKeyManager().getKeyType(), format.toByteArray(), KeyTemplate.OutputPrefixType.TINK); } AesCmacKeyManager(); }
AesCmacKeyManager extends KeyTypeManager<AesCmacKey> { public static final KeyTemplate aes256CmacTemplate() { AesCmacKeyFormat format = AesCmacKeyFormat.newBuilder() .setKeySize(32) .setParams(AesCmacParams.newBuilder().setTagSize(16).build()) .build(); return KeyTemplate.create( new AesCmacKeyManager().getKeyType(), format.toByteArray(), KeyTemplate.OutputPrefixType.TINK); } AesCmacKeyManager(); @Override String getKeyType(); @Override int getVersion(); @Override KeyMaterialType keyMaterialType(); @Override void validateKey(AesCmacKey key); @Override AesCmacKey parseKey(ByteString byteString); @Override KeyFactory<AesCmacKeyFormat, AesCmacKey> keyFactory(); static void register(boolean newKeyAllowed); static final KeyTemplate aes256CmacTemplate(); static final KeyTemplate rawAes256CmacTemplate(); }
AesCmacKeyManager extends KeyTypeManager<AesCmacKey> { public static final KeyTemplate aes256CmacTemplate() { AesCmacKeyFormat format = AesCmacKeyFormat.newBuilder() .setKeySize(32) .setParams(AesCmacParams.newBuilder().setTagSize(16).build()) .build(); return KeyTemplate.create( new AesCmacKeyManager().getKeyType(), format.toByteArray(), KeyTemplate.OutputPrefixType.TINK); } AesCmacKeyManager(); @Override String getKeyType(); @Override int getVersion(); @Override KeyMaterialType keyMaterialType(); @Override void validateKey(AesCmacKey key); @Override AesCmacKey parseKey(ByteString byteString); @Override KeyFactory<AesCmacKeyFormat, AesCmacKey> keyFactory(); static void register(boolean newKeyAllowed); static final KeyTemplate aes256CmacTemplate(); static final KeyTemplate rawAes256CmacTemplate();  }