XChaCha20Poly1305KeyManager extends KeyTypeManager<XChaCha20Poly1305Key> { public static final KeyTemplate xChaCha20Poly1305Template() { return KeyTemplate.create( new XChaCha20Poly1305KeyManager().getKeyType(), XChaCha20Poly1305KeyFormat.getDefaultInstance().toByteArray(), KeyTemplate.OutputPrefixType.TINK); } XChaCha20Poly1305KeyManager(); @Override String getKeyType(); @Override int getVersion(); @Override KeyMaterialType keyMaterialType(); @Override void validateKey(XChaCha20Poly1305Key key); @Override XChaCha20Poly1305Key parseKey(ByteString byteString); @Override KeyFactory<XChaCha20Poly1305KeyFormat, XChaCha20Poly1305Key> keyFactory(); static void register(boolean newKeyAllowed); static final KeyTemplate xChaCha20Poly1305Template(); static final KeyTemplate rawXChaCha20Poly1305Template();  }
@Test public void testXChaCha20Poly1305Template() throws Exception { KeyTemplate template = XChaCha20Poly1305KeyManager.xChaCha20Poly1305Template(); assertThat(template.getTypeUrl()).isEqualTo(new XChaCha20Poly1305KeyManager().getKeyType()); assertThat(template.getOutputPrefixType()).isEqualTo(KeyTemplate.OutputPrefixType.TINK); XChaCha20Poly1305KeyFormat unused = XChaCha20Poly1305KeyFormat.parseFrom( ByteString.copyFrom(template.getValue()), ExtensionRegistryLite.getEmptyRegistry()); }