OK. I have to say that I am thoroughly unimpressed with YourPay and LinkPoint. It took me all day just to figure out how to CONNECT to their test server. Here is the email I sent them. Hopefully google will pick this up and help any poor, weary traveller who is searching to find the answer to these issues if they don't revise their help pages.
----
There are several issues with connecting to your server using Java which were not mentioned in any manual, and which I spent most of the day tracking down. Perhaps if I mention this to you, you can get an FAQ or something written to help out anyone else who has to deal with this.
1) The certificate files that you download from the interface are in the wrong format for Java. Java seems to require keys to be in the PKCS12 format. Instead of having a helpful error message, Java gives something akin to the following error message:
java.io.IOException: toDerInputStream rejects tag type 45
In order to solve the problem, you must use openssl to convert the certificate into one that is usable. So, for the file 12345.pem, you would do:
openssl pkcs12 -export -out 12345.pkcs -in 12345.pem
Then you would use 12345.pkcs as your client certificate file.
2) Now, this works great for connecting to your production server. However, your test server is a different problem. Connecting to your test server gives the following error:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
This is because you have self-signed your testing certificate. Java doesn't like that. Now, you can import your own certificate into Java, provided you actually have the certificate. I didn't find your certificate on your website, but I found a way to grab it from the SSL connection. If you do:
openssl s_client -connect staging.linkpt.net:1129
It will spit out the certificate file during connection. You can then copy that into a file to use to import into your Java KeyStore (I'm using staging_certificate.txt for this example).
They way you import it into the Java keystore is as follows:
keytool -import -keystore /PATH/TO/YOUR/KEYSTORE/cacerts -file staging_certificate.txt -alias linkptstaging
The /PATH/TO/YOUR/KEYSTORE/cacerts varies by platform. Of course, this entire step would be avoided if you simply bothered to spend the $300 to sign the certificate for your staging server.