public <ParametersT extends Parameters, SerializationT extends Serialization>
      SerializationT serializeParameters(
          ParametersT parameters, Class<SerializationT> serializationClass)
          throws GeneralSecurityException {
    SerializerIndex index = new SerializerIndex(parameters.getClass(), serializationClass);
    if (!parametersSerializerMap.containsKey(index)) {
      throw new GeneralSecurityException("No Key Format serializer for " + index + " available");
    }
    @SuppressWarnings("unchecked") // We know we only insert like this.
    ParametersSerializer<ParametersT, SerializationT> serializer =
        (ParametersSerializer<ParametersT, SerializationT>) parametersSerializerMap.get(index);
    return serializer.serializeParameters(parameters);
  }
Serializes a given Parameters object into a "SerializationT" object.

<p>This will look up a previously registered serializer for the requested {@code
SerializationT} class and the passed in key type, and then call serializeKey on the result.
java_src/src/main/java/com/google/crypto/tink/internal/SerializationRegistry.java