@CanIgnoreReturnValue
  @Deprecated
  public synchronized AndroidKeysetManager rotate(
      com.google.crypto.tink.proto.KeyTemplate keyTemplate) throws GeneralSecurityException {
    keysetManager = keysetManager.rotate(keyTemplate);
    write(keysetManager.getKeysetHandle(), writer, masterAead);
    return this;
  }
Generates and adds a fresh key generated using {@code keyTemplate}, and sets the new key as the
primary key.

@throws GeneralSecurityException if cannot find any {@link KeyManager} that can handle {@code
    keyTemplate}
@deprecated Please use {@link #add}. This method adds a new key and immediately promotes it to
    primary. However, when you do keyset rotation, you almost never want to make the new key
    primary, because old binaries don't know the new key yet.
java_src/src/main/java/com/google/crypto/tink/integration/android/AndroidKeysetManager.java