@Deprecated
  public KeyHandle primaryKey() throws GeneralSecurityException {
    int primaryKeyId = keyset.getPrimaryKeyId();
    for (Keyset.Key key : keyset.getKeyList()) {
      if (key.getKeyId() == primaryKeyId) {
        return new InternalKeyHandle(
            new ProtoKey(key.getKeyData(), KeyTemplate.fromProto(key.getOutputPrefixType())),
            key.getStatus(),
            key.getKeyId());
      }
    }
    throw new GeneralSecurityException("No primary key found in keyset.");
  }
Searches the keyset to find the primary key of this {@code KeysetHandle}, and returns the key
wrapped in a {@code KeyHandle}.

<p>Please do not use this function in new code. Instead, use {@link #getPrimary}.

@deprecated Use {@link #getPrimary} instead.
java_src/src/main/java/com/google/crypto/tink/KeysetHandle.java