public string CreateSignature(X509Certificate2 certificate, IToken token, Uri uri, string verb, string verifier = null, bool renewToken = false, string callback = null) { var oAuthParameters = new OAuthParameters( new ConsumerKey(token.ConsumerKey), //Modified to fix oauth error for private app //new TokenKey(token.TokenKey), new TokenKey(token.ConsumerKey), "RSA-SHA1", new DefaultTimestampSequence(), new DefaultNonceSequence(), string.Empty, "1.0", verifier, token.Session, renewToken, callback); var signatureBaseString = new SignatureBaseString( new Request { Url = uri, Verb = verb }, oAuthParameters); var signature = new RsaSha1(certificate).Sign(signatureBaseString); oAuthParameters.SetSignature(signature); return new AuthorizationHeader(oAuthParameters, string.Empty, renewToken).Value; }
public string CreateSignature(X509Certificate2 certificate, IToken token, Uri uri, string verb, string verifier = null) { var oAuthParameters = new OAuthParameters( new ConsumerKey(token.ConsumerKey), new TokenKey(token.ConsumerKey), "RSA-SHA1", new DefaultTimestampSequence(), new DefaultNonceSequence(), string.Empty, "1.0", verifier, token.Session); var signatureBaseString = new SignatureBaseString( new Request { Url = uri, Verb = verb }, oAuthParameters); var signature = new RsaSha1(certificate).Sign(signatureBaseString); oAuthParameters.SetSignature(signature); return new AuthorizationHeader(oAuthParameters, string.Empty).Value; ; }