@Deprecated
  public static synchronized KeyData newKeyData(
      com.google.crypto.tink.proto.KeyTemplate keyTemplate) throws GeneralSecurityException {
    KeyManager<?> manager =
        KeyManagerRegistry.globalInstance().getUntypedKeyManager(keyTemplate.getTypeUrl());
    if (KeyManagerRegistry.globalInstance().isNewKeyAllowed(keyTemplate.getTypeUrl())) {
      return manager.newKeyData(keyTemplate.getValue());
    } else {
      throw new GeneralSecurityException(
          "newKey-operation not permitted for key type " + keyTemplate.getTypeUrl());
    }
  }
Generates a new {@link KeyData} for the specified {@code template}.

<p>It looks up a {@link KeyManager} identified by {@code keyTemplate.type_url}, and calls
{@link KeyManager#newKeyData}.

<p>This method should be used solely for key management.

@return a new {@link KeyData}
@deprecated Use {@code KeysetHandle.generateNew} with a Parameters object instead. To convert a
    proto KeyTemplate to a parameters one can use {@code
    TinkProtoParametersFormat.parse(t.toByteArray());}
java_src/src/main/java/com/google/crypto/tink/Registry.java