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

<p>It looks up a {@link KeyManager} identified by {@code keyTemplate.type_url}, and calls
{@link KeyManager#newKey} with {@code keyTemplate} as the parameter.

@return a new key
@deprecated Use {@code newKeyData} instead.
java_src/src/main/java/com/google/crypto/tink/Registry.java