I'm trying to use the Atlassian-supplied "OAuthTutorialClient" for Java, and cannot get the requestToken command to complete successfully against a BitBucket server. I have what I think is a working private key - I can git push from my local directory to the server successfully. However in code, when I execute this line:
String accessToken = jiraOAuthClient.getAccessToken(tmpToken, secret, properties.get(CONSUMER_KEY), properties.get(PRIVATE_KEY));
I get this error: "java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: invalid key format"
The CONSUMER_KEY value is "OauthKey", and the PRIVATE_KEY value starts and ends with this: "AAABABv1...PH7k2YA==" . Both of these values are stored in the config.properties file as per the sample code. Any thoughts would be welcome!