AesGcmKeyManager extends KeyTypeManager<AesGcmKey> { public static final KeyTemplate rawAes256GcmTemplate() { return createKeyTemplate(32, KeyTemplate.OutputPrefixType.RAW); } AesGcmKeyManager(); @Override String getKeyType(); @Override int getVersion(); @Override KeyMaterialType keyMaterialType(); @Override void validateKey(AesGcmKey key); @Override AesGcmKey parseKey(ByteString byteString); @Override KeyFactory<AesGcmKeyFormat, AesGcmKey> keyFactory(); static void register(boolean newKeyAllowed); static final KeyTemplate aes128GcmTemplate(); static final KeyTemplate rawAes128GcmTemplate(); static final KeyTemplate aes256GcmTemplate(); static final KeyTemplate rawAes256GcmTemplate();  }
@Test public void testRawAes256GcmTemplate() throws Exception { KeyTemplate template = AesGcmKeyManager.rawAes256GcmTemplate(); assertEquals(new AesGcmKeyManager().getKeyType(), template.getTypeUrl()); assertEquals(KeyTemplate.OutputPrefixType.RAW, template.getOutputPrefixType()); AesGcmKeyFormat format = AesGcmKeyFormat.parseFrom( ByteString.copyFrom(template.getValue()), ExtensionRegistryLite.getEmptyRegistry()); assertEquals(32, format.getKeySize()); }