I think you may be mistaken on the process to do this. It might be simplified when using the Java bindings (or C#) since those typically wrap some of the functionality for the user vs other language bindings or vs using pure RemoteWebDriver (over say SafariDriver) to work with Safari.
you do pass in a string array of extensions but for the values, "Each extension should be specified as the base64 encoding of a .safariextz file". Which means you have to read in the safariextz file as binary data then do a base64 conversion to make it a string then pass that in an array as desired capabilities.
Existing firefox profiles (which can contain extensions in them already) are passed the same way as base64 string (of a zip file of the profile directory)