XChaCha20Poly1305KeyManager extends KeyTypeManager<XChaCha20Poly1305Key> { @Override public void validateKey(XChaCha20Poly1305Key key) throws GeneralSecurityException { Validators.validateVersion(key.getVersion(), getVersion()); if (key.getKeyValue().size() != KEY_SIZE_IN_BYTES) { throw new GeneralSecurityException("invalid XChaCha20Poly1305Key: incorrect key length"); } } 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 createKey_valid() throws Exception { manager.validateKey(factory.createKey(XChaCha20Poly1305KeyFormat.getDefaultInstance())); }