@Deprecated
  public static synchronized KeyData newKeyData(
      com.google.crypto.tink.KeyTemplate keyTemplate) throws GeneralSecurityException {
    byte[] serializedKeyTemplate = TinkProtoParametersFormat.serialize(keyTemplate.toParameters());
    try {
      return newKeyData(
          com.google.crypto.tink.proto.KeyTemplate.parseFrom(
              serializedKeyTemplate, ExtensionRegistryLite.getEmptyRegistry()));
    } catch (InvalidProtocolBufferException e) {
      throw new GeneralSecurityException("Failed to parse serialized parameters", e);
    }
  }
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(keyTemplate.toParameters())} instead and use
    the Keyset Handle API.
java_src/src/main/java/com/google/crypto/tink/Registry.java