ChaCha20Poly1305KeyManager extends KeyTypeManager<ChaCha20Poly1305Key> { public static final KeyTemplate rawChaCha20Poly1305Template() { return KeyTemplate.create( new ChaCha20Poly1305KeyManager().getKeyType(), ChaCha20Poly1305KeyFormat.getDefaultInstance().toByteArray(), KeyTemplate.OutputPrefixType.RAW); } ChaCha20Poly1305KeyManager(); @Override String getKeyType(); @Override int getVersion(); @Override KeyMaterialType keyMaterialType(); @Override void validateKey(ChaCha20Poly1305Key key); @Override ChaCha20Poly1305Key parseKey(ByteString byteString); @Override KeyFactory<ChaCha20Poly1305KeyFormat, ChaCha20Poly1305Key> keyFactory(); static void register(boolean newKeyAllowed); static final KeyTemplate chaCha20Poly1305Template(); static final KeyTemplate rawChaCha20Poly1305Template();  }
@Test public void testRawChaCha20Poly1305Template() throws Exception { KeyTemplate template = ChaCha20Poly1305KeyManager.rawChaCha20Poly1305Template(); assertEquals(new ChaCha20Poly1305KeyManager().getKeyType(), template.getTypeUrl()); assertEquals(KeyTemplate.OutputPrefixType.RAW, template.getOutputPrefixType()); ChaCha20Poly1305KeyFormat unused = ChaCha20Poly1305KeyFormat.parseFrom( template.getValue(), ExtensionRegistryLite.getEmptyRegistry()); }