private static Keyset.Key createKeysetKey(Key key, KeyStatus keyStatus, int id)
      throws GeneralSecurityException {
    ProtoKeySerialization serializedKey =
        MutableSerializationRegistry.globalInstance()
            .serializeKey(key, ProtoKeySerialization.class, InsecureSecretKeyAccess.get());
    @Nullable Integer idRequirement = serializedKey.getIdRequirementOrNull();
    if (idRequirement != null && idRequirement != id) {
      throw new GeneralSecurityException("Wrong ID set for key with ID requirement");
    }
    return toKeysetKey(id, serializeStatus(keyStatus), serializedKey);
  }
Returns true if this keyset is equal to {@code other}, ignoring monitoring annotations.

<p>Note: this may return false even if the keysets represent the same set of functions. For
example, this can happen if the keys store zero-byte padding of a {@link java.math.BigInteger},
which are irrelevant to the function computed. Currently, keysets can also be invalid in which
case this will return false.
java_src/src/main/java/com/google/crypto/tink/KeysetHandle.java