Oauth Authentication by using RSA SHA1 in java -
i have searched , found below code hmacsha1. have generated signature , want use rsa-sha1 algorithm . stuck in generating oauth_signature , implementing further steps oauth. please share more clear solution
public static string computesignature(string basestring,string keystring) throws generalsecurityexception, unsupportedencodingexception {
secretkey secretkey = null; byte[] keybytes = keystring.getbytes(); secretkey = new secretkeyspec(keybytes, "hmacsha1"); mac mac = mac.getinstance("hmacsha1"); mac.init(secretkey); byte[] text = basestring.getbytes(); return new string(base64.encodebase64(mac.dofinal(text))).trim(); }
}
Comments
Post a Comment