Permalink
Browse files

Added .NET source files

  • Loading branch information...
1 parent 07de93e commit 242d51727afec983b80fcdf83757bb5a9137867b Mashery committed Mar 5, 2011
Showing with 1,415 additions and 0 deletions.
  1. +401 −0 Form1.Designer.cs
  2. +104 −0 Form1.cs
  3. +120 −0 Form1.resx
  4. +21 −0 LICENSE.TXT
  5. +316 −0 OAuthBase.cs
  6. +143 −0 OAuthSig.csproj
  7. +20 −0 Program.cs
  8. +36 −0 Properties/AssemblyInfo.cs
  9. +71 −0 Properties/Resources.Designer.cs
  10. +117 −0 Properties/Resources.resx
  11. +30 −0 Properties/Settings.Designer.cs
  12. +7 −0 Properties/Settings.settings
  13. +26 −0 Properties/app.manifest
  14. +3 −0 app.config
View
401 Form1.Designer.cs
@@ -0,0 +1,401 @@
+namespace OAuthSig
+{
+ partial class Form1
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.txtURI = new System.Windows.Forms.TextBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.label3 = new System.Windows.Forms.Label();
+ this.label4 = new System.Windows.Forms.Label();
+ this.label5 = new System.Windows.Forms.Label();
+ this.label6 = new System.Windows.Forms.Label();
+ this.label7 = new System.Windows.Forms.Label();
+ this.label8 = new System.Windows.Forms.Label();
+ this.label9 = new System.Windows.Forms.Label();
+ this.txtConsKey = new System.Windows.Forms.TextBox();
+ this.txtConsSecret = new System.Windows.Forms.TextBox();
+ this.txtToken = new System.Windows.Forms.TextBox();
+ this.txtTokenSecret = new System.Windows.Forms.TextBox();
+ this.txtTimestamp = new System.Windows.Forms.TextBox();
+ this.txtNonce = new System.Windows.Forms.TextBox();
+ this.btnGenerate = new System.Windows.Forms.Button();
+ this.label10 = new System.Windows.Forms.Label();
+ this.genSig = new System.Windows.Forms.Label();
+ this.drpSigMethod = new System.Windows.Forms.ComboBox();
+ this.chkVersion = new System.Windows.Forms.CheckBox();
+ this.label11 = new System.Windows.Forms.Label();
+ this.txtRawSig = new System.Windows.Forms.TextBox();
+ this.txtEncodedSig = new System.Windows.Forms.TextBox();
+ this.txtGenURL = new System.Windows.Forms.TextBox();
+ this.label12 = new System.Windows.Forms.Label();
+ this.label13 = new System.Windows.Forms.Label();
+ this.label14 = new System.Windows.Forms.Label();
+ this.drpHTTPMethod = new System.Windows.Forms.ComboBox();
+ this.SuspendLayout();
+ //
+ // txtURI
+ //
+ this.txtURI.Location = new System.Drawing.Point(108, 35);
+ this.txtURI.Name = "txtURI";
+ this.txtURI.Size = new System.Drawing.Size(377, 20);
+ this.txtURI.TabIndex = 0;
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(69, 38);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(29, 13);
+ this.label1.TabIndex = 1;
+ this.label1.Text = "URI:";
+ this.label1.Click += new System.EventHandler(this.label1_Click);
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(21, 67);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(78, 13);
+ this.label2.TabIndex = 2;
+ this.label2.Text = "Consumer Key:";
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(8, 98);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(91, 13);
+ this.label3.TabIndex = 3;
+ this.label3.Text = "Consumer Secret:";
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Location = new System.Drawing.Point(57, 129);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(41, 13);
+ this.label4.TabIndex = 4;
+ this.label4.Text = "Token:";
+ this.label4.Click += new System.EventHandler(this.label4_Click);
+ //
+ // label5
+ //
+ this.label5.AutoSize = true;
+ this.label5.Location = new System.Drawing.Point(23, 159);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(75, 13);
+ this.label5.TabIndex = 5;
+ this.label5.Text = "Token Secret:";
+ //
+ // label6
+ //
+ this.label6.AutoSize = true;
+ this.label6.Location = new System.Drawing.Point(21, 195);
+ this.label6.Name = "label6";
+ this.label6.Size = new System.Drawing.Size(78, 13);
+ this.label6.TabIndex = 6;
+ this.label6.Text = "HTTP Method:";
+ //
+ // label7
+ //
+ this.label7.AutoSize = true;
+ this.label7.Location = new System.Drawing.Point(38, 222);
+ this.label7.Name = "label7";
+ this.label7.Size = new System.Drawing.Size(61, 13);
+ this.label7.TabIndex = 7;
+ this.label7.Text = "Timestamp:";
+ //
+ // label8
+ //
+ this.label8.AutoSize = true;
+ this.label8.Location = new System.Drawing.Point(57, 248);
+ this.label8.Name = "label8";
+ this.label8.Size = new System.Drawing.Size(42, 13);
+ this.label8.TabIndex = 8;
+ this.label8.Text = "Nonce:";
+ //
+ // label9
+ //
+ this.label9.AutoSize = true;
+ this.label9.Location = new System.Drawing.Point(251, 195);
+ this.label9.Name = "label9";
+ this.label9.Size = new System.Drawing.Size(94, 13);
+ this.label9.TabIndex = 9;
+ this.label9.Text = "Signature Method:";
+ //
+ // txtConsKey
+ //
+ this.txtConsKey.Location = new System.Drawing.Point(108, 64);
+ this.txtConsKey.Name = "txtConsKey";
+ this.txtConsKey.Size = new System.Drawing.Size(227, 20);
+ this.txtConsKey.TabIndex = 10;
+ //
+ // txtConsSecret
+ //
+ this.txtConsSecret.Location = new System.Drawing.Point(108, 91);
+ this.txtConsSecret.Name = "txtConsSecret";
+ this.txtConsSecret.Size = new System.Drawing.Size(227, 20);
+ this.txtConsSecret.TabIndex = 11;
+ //
+ // txtToken
+ //
+ this.txtToken.Location = new System.Drawing.Point(108, 126);
+ this.txtToken.Name = "txtToken";
+ this.txtToken.Size = new System.Drawing.Size(227, 20);
+ this.txtToken.TabIndex = 12;
+ //
+ // txtTokenSecret
+ //
+ this.txtTokenSecret.Location = new System.Drawing.Point(108, 156);
+ this.txtTokenSecret.Name = "txtTokenSecret";
+ this.txtTokenSecret.Size = new System.Drawing.Size(227, 20);
+ this.txtTokenSecret.TabIndex = 13;
+ //
+ // txtTimestamp
+ //
+ this.txtTimestamp.Location = new System.Drawing.Point(108, 219);
+ this.txtTimestamp.Name = "txtTimestamp";
+ this.txtTimestamp.Size = new System.Drawing.Size(130, 20);
+ this.txtTimestamp.TabIndex = 15;
+ //
+ // txtNonce
+ //
+ this.txtNonce.Location = new System.Drawing.Point(108, 245);
+ this.txtNonce.Name = "txtNonce";
+ this.txtNonce.Size = new System.Drawing.Size(227, 20);
+ this.txtNonce.TabIndex = 16;
+ this.txtNonce.TextChanged += new System.EventHandler(this.textBox7_TextChanged);
+ //
+ // btnGenerate
+ //
+ this.btnGenerate.Location = new System.Drawing.Point(173, 284);
+ this.btnGenerate.Name = "btnGenerate";
+ this.btnGenerate.Size = new System.Drawing.Size(128, 23);
+ this.btnGenerate.TabIndex = 18;
+ this.btnGenerate.Text = "Generate Signature";
+ this.btnGenerate.UseVisualStyleBackColor = true;
+ this.btnGenerate.Click += new System.EventHandler(this.btnGenerate_Click);
+ //
+ // label10
+ //
+ this.label10.AutoSize = true;
+ this.label10.Location = new System.Drawing.Point(51, 330);
+ this.label10.Name = "label10";
+ this.label10.Size = new System.Drawing.Size(133, 13);
+ this.label10.TabIndex = 19;
+ this.label10.Text = "Raw Generated Signature:";
+ //
+ // genSig
+ //
+ this.genSig.AutoSize = true;
+ this.genSig.Location = new System.Drawing.Point(194, 330);
+ this.genSig.Name = "genSig";
+ this.genSig.Size = new System.Drawing.Size(0, 13);
+ this.genSig.TabIndex = 20;
+ //
+ // drpSigMethod
+ //
+ this.drpSigMethod.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.drpSigMethod.FormattingEnabled = true;
+ this.drpSigMethod.Items.AddRange(new object[] {
+ "HMAC-SHA1",
+ "PLAINTEXT",
+ "RSA-SHA1"});
+ this.drpSigMethod.Location = new System.Drawing.Point(351, 192);
+ this.drpSigMethod.Name = "drpSigMethod";
+ this.drpSigMethod.Size = new System.Drawing.Size(121, 21);
+ this.drpSigMethod.TabIndex = 22;
+ //
+ // chkVersion
+ //
+ this.chkVersion.AutoSize = true;
+ this.chkVersion.Checked = true;
+ this.chkVersion.CheckState = System.Windows.Forms.CheckState.Checked;
+ this.chkVersion.Location = new System.Drawing.Point(137, 12);
+ this.chkVersion.Name = "chkVersion";
+ this.chkVersion.Size = new System.Drawing.Size(155, 17);
+ this.chkVersion.TabIndex = 24;
+ this.chkVersion.Text = "Include Version parameter?";
+ this.chkVersion.UseVisualStyleBackColor = true;
+ //
+ // label11
+ //
+ this.label11.AutoSize = true;
+ this.label11.Location = new System.Drawing.Point(30, 355);
+ this.label11.Name = "label11";
+ this.label11.Size = new System.Drawing.Size(154, 13);
+ this.label11.TabIndex = 25;
+ this.label11.Text = "Encoded Generated Signature:";
+ //
+ // txtRawSig
+ //
+ this.txtRawSig.BackColor = System.Drawing.SystemColors.HighlightText;
+ this.txtRawSig.Location = new System.Drawing.Point(190, 323);
+ this.txtRawSig.Name = "txtRawSig";
+ this.txtRawSig.ReadOnly = true;
+ this.txtRawSig.Size = new System.Drawing.Size(317, 20);
+ this.txtRawSig.TabIndex = 26;
+ //
+ // txtEncodedSig
+ //
+ this.txtEncodedSig.BackColor = System.Drawing.SystemColors.HighlightText;
+ this.txtEncodedSig.Location = new System.Drawing.Point(190, 348);
+ this.txtEncodedSig.Name = "txtEncodedSig";
+ this.txtEncodedSig.ReadOnly = true;
+ this.txtEncodedSig.Size = new System.Drawing.Size(317, 20);
+ this.txtEncodedSig.TabIndex = 27;
+ //
+ // txtGenURL
+ //
+ this.txtGenURL.BackColor = System.Drawing.SystemColors.HighlightText;
+ this.txtGenURL.Location = new System.Drawing.Point(93, 378);
+ this.txtGenURL.Multiline = true;
+ this.txtGenURL.Name = "txtGenURL";
+ this.txtGenURL.ReadOnly = true;
+ this.txtGenURL.Size = new System.Drawing.Size(414, 62);
+ this.txtGenURL.TabIndex = 28;
+ //
+ // label12
+ //
+ this.label12.AutoSize = true;
+ this.label12.Location = new System.Drawing.Point(8, 378);
+ this.label12.Name = "label12";
+ this.label12.Size = new System.Drawing.Size(85, 13);
+ this.label12.TabIndex = 29;
+ this.label12.Text = "Generated URL:";
+ //
+ // label13
+ //
+ this.label13.AutoSize = true;
+ this.label13.Location = new System.Drawing.Point(244, 222);
+ this.label13.Name = "label13";
+ this.label13.Size = new System.Drawing.Size(153, 13);
+ this.label13.TabIndex = 30;
+ this.label13.Text = "(Leave blank to auto-generate)";
+ this.label13.Click += new System.EventHandler(this.label13_Click);
+ //
+ // label14
+ //
+ this.label14.AutoSize = true;
+ this.label14.Location = new System.Drawing.Point(341, 248);
+ this.label14.Name = "label14";
+ this.label14.Size = new System.Drawing.Size(153, 13);
+ this.label14.TabIndex = 31;
+ this.label14.Text = "(Leave blank to auto-generate)";
+ //
+ // drpHTTPMethod
+ //
+ this.drpHTTPMethod.FormattingEnabled = true;
+ this.drpHTTPMethod.Items.AddRange(new object[] {
+ "GET",
+ "POST",
+ "PUT",
+ "DELETE",
+ "HEAD"});
+ this.drpHTTPMethod.Location = new System.Drawing.Point(108, 192);
+ this.drpHTTPMethod.Name = "drpHTTPMethod";
+ this.drpHTTPMethod.Size = new System.Drawing.Size(121, 21);
+ this.drpHTTPMethod.TabIndex = 32;
+ //
+ // Form1
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(519, 452);
+ this.Controls.Add(this.drpHTTPMethod);
+ this.Controls.Add(this.label14);
+ this.Controls.Add(this.label13);
+ this.Controls.Add(this.label12);
+ this.Controls.Add(this.txtGenURL);
+ this.Controls.Add(this.txtEncodedSig);
+ this.Controls.Add(this.txtRawSig);
+ this.Controls.Add(this.label11);
+ this.Controls.Add(this.chkVersion);
+ this.Controls.Add(this.drpSigMethod);
+ this.Controls.Add(this.genSig);
+ this.Controls.Add(this.label10);
+ this.Controls.Add(this.btnGenerate);
+ this.Controls.Add(this.txtNonce);
+ this.Controls.Add(this.txtTimestamp);
+ this.Controls.Add(this.txtTokenSecret);
+ this.Controls.Add(this.txtToken);
+ this.Controls.Add(this.txtConsSecret);
+ this.Controls.Add(this.txtConsKey);
+ this.Controls.Add(this.label9);
+ this.Controls.Add(this.label8);
+ this.Controls.Add(this.label7);
+ this.Controls.Add(this.label6);
+ this.Controls.Add(this.label5);
+ this.Controls.Add(this.label4);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.label1);
+ this.Controls.Add(this.txtURI);
+ this.Name = "Form1";
+ this.Text = "OAuth Signature Generator";
+ this.Load += new System.EventHandler(this.Form1_Load);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TextBox txtURI;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.Label label6;
+ private System.Windows.Forms.Label label7;
+ private System.Windows.Forms.Label label8;
+ private System.Windows.Forms.Label label9;
+ private System.Windows.Forms.TextBox txtConsKey;
+ private System.Windows.Forms.TextBox txtConsSecret;
+ private System.Windows.Forms.TextBox txtToken;
+ private System.Windows.Forms.TextBox txtTokenSecret;
+ private System.Windows.Forms.TextBox txtTimestamp;
+ private System.Windows.Forms.TextBox txtNonce;
+ private System.Windows.Forms.Button btnGenerate;
+ private System.Windows.Forms.Label label10;
+ private System.Windows.Forms.Label genSig;
+ private System.Windows.Forms.ComboBox drpSigMethod;
+ private System.Windows.Forms.CheckBox chkVersion;
+ private System.Windows.Forms.Label label11;
+ private System.Windows.Forms.TextBox txtRawSig;
+ private System.Windows.Forms.TextBox txtEncodedSig;
+ private System.Windows.Forms.TextBox txtGenURL;
+ private System.Windows.Forms.Label label12;
+ private System.Windows.Forms.Label label13;
+ private System.Windows.Forms.Label label14;
+ private System.Windows.Forms.ComboBox drpHTTPMethod;
+ }
+}
+
View
104 Form1.cs
@@ -0,0 +1,104 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+namespace OAuthSig
+{
+ public partial class Form1 : Form
+ {
+ public Form1()
+ {
+ InitializeComponent();
+ }
+
+ private void label1_Click(object sender, EventArgs e)
+ {
+
+ }
+
+ private void label4_Click(object sender, EventArgs e)
+ {
+
+ }
+
+ private void textBox7_TextChanged(object sender, EventArgs e)
+ {
+
+ }
+
+ private void btnGenerate_Click(object sender, EventArgs e)
+ {
+ OAuth.OAuthBase.SignatureTypes signatureType = OAuth.OAuthBase.SignatureTypes.HMACSHA1;
+ string normalizedUrl;
+ string normalizedRequestParameters;
+ OAuth.OAuthBase myOAuth = new OAuth.OAuthBase();
+
+ try
+ {
+ Uri uri = new Uri(txtURI.Text);
+ string consumerKey = txtConsKey.Text;
+ string consumerSecret = txtConsSecret.Text;
+ string token = txtToken.Text;
+ string tokenSecret = txtTokenSecret.Text;
+ string httpMethod = drpHTTPMethod.SelectedItem.ToString();
+ string timeStamp = txtTimestamp.Text;
+ string nonce = txtNonce.Text;
+
+ if (string.IsNullOrEmpty(timeStamp))
+ {
+ timeStamp = myOAuth.GenerateTimeStamp();
+ txtTimestamp.Text = timeStamp;
+ }
+
+ if (string.IsNullOrEmpty(nonce))
+ {
+ nonce = myOAuth.GenerateNonce();
+ txtNonce.Text = nonce;
+ }
+
+ switch (drpSigMethod.SelectedIndex)
+ {
+ case 0:
+ signatureType = OAuth.OAuthBase.SignatureTypes.HMACSHA1;
+ break;
+ case 1:
+ signatureType = OAuth.OAuthBase.SignatureTypes.PLAINTEXT;
+ break;
+ case 2:
+ signatureType = OAuth.OAuthBase.SignatureTypes.RSASHA1;
+ break;
+ }
+
+ myOAuth.includeVersion = chkVersion.Checked;
+
+ string signature = myOAuth.GenerateSignature(uri, consumerKey, consumerSecret,
+ token, tokenSecret, httpMethod, timeStamp, nonce, signatureType,
+ out normalizedUrl, out normalizedRequestParameters);
+
+ txtRawSig.Text = signature;
+ txtEncodedSig.Text = myOAuth.UrlEncode(signature);
+
+ txtGenURL.Text = normalizedUrl + "?" + normalizedRequestParameters + "&oauth_signature=" + txtEncodedSig.Text;
+ }
+ catch (Exception exception)
+ {
+ MessageBox.Show(exception.Message);
+ }
+ }
+
+ private void Form1_Load(object sender, EventArgs e)
+ {
+ drpSigMethod.SelectedIndex = 0;
+ drpHTTPMethod.SelectedIndex = 0;
+ }
+
+ private void label13_Click(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
View
120 Form1.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
View
21 LICENSE.TXT
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (C) 2011 Mashery, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
View
316 OAuthBase.cs
@@ -0,0 +1,316 @@
+using System;
+using System.Security.Cryptography;
+using System.Collections.Generic;
+using System.Text;
+using System.Web;
+
+namespace OAuth {
+ public class OAuthBase {
+
+ /// <summary>
+ /// Provides a predefined set of algorithms that are supported officially by the protocol
+ /// </summary>
+ public enum SignatureTypes {
+ HMACSHA1,
+ PLAINTEXT,
+ RSASHA1
+ }
+
+ /// <summary>
+ /// Provides an internal structure to sort the query parameter
+ /// </summary>
+ protected class QueryParameter {
+ private string name = null;
+ private string value = null;
+
+ public QueryParameter(string name, string value) {
+ this.name = name;
+ this.value = value;
+ }
+
+ public string Name {
+ get { return name; }
+ }
+
+ public string Value {
+ get { return value; }
+ }
+ }
+
+ /// <summary>
+ /// Comparer class used to perform the sorting of the query parameters
+ /// </summary>
+ protected class QueryParameterComparer : IComparer<QueryParameter> {
+
+ #region IComparer<QueryParameter> Members
+
+ public int Compare(QueryParameter x, QueryParameter y) {
+ if (x.Name == y.Name) {
+ return string.Compare(x.Value, y.Value);
+ } else {
+ return string.Compare(x.Name, y.Name);
+ }
+ }
+
+ #endregion
+ }
+
+ protected const string OAuthVersion = "1.0";
+ protected const string OAuthParameterPrefix = "oauth_";
+
+ public bool includeVersion = true;
+
+ //
+ // List of know and used oauth parameters' names
+ //
+ protected const string OAuthConsumerKeyKey = "oauth_consumer_key";
+ protected const string OAuthCallbackKey = "oauth_callback";
+ protected const string OAuthVersionKey = "oauth_version";
+ protected const string OAuthSignatureMethodKey = "oauth_signature_method";
+ protected const string OAuthSignatureKey = "oauth_signature";
+ protected const string OAuthTimestampKey = "oauth_timestamp";
+ protected const string OAuthNonceKey = "oauth_nonce";
+ protected const string OAuthTokenKey = "oauth_token";
+ protected const string OAuthTokenSecretKey = "oauth_token_secret";
+
+ protected const string HMACSHA1SignatureType = "HMAC-SHA1";
+ protected const string PlainTextSignatureType = "PLAINTEXT";
+ protected const string RSASHA1SignatureType = "RSA-SHA1";
+
+ protected Random random = new Random();
+
+ protected string unreservedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~";
+
+ /// <summary>
+ /// Helper function to compute a hash value
+ /// </summary>
+ /// <param name="hashAlgorithm">The hashing algoirhtm used. If that algorithm needs some initialization, like HMAC and its derivatives, they should be initialized prior to passing it to this function</param>
+ /// <param name="data">The data to hash</param>
+ /// <returns>a Base64 string of the hash value</returns>
+ private string ComputeHash(HashAlgorithm hashAlgorithm, string data) {
+ if (hashAlgorithm == null) {
+ throw new ArgumentNullException("hashAlgorithm");
+ }
+
+ if (string.IsNullOrEmpty(data)) {
+ throw new ArgumentNullException("data");
+ }
+
+ byte[] dataBuffer = System.Text.Encoding.ASCII.GetBytes(data);
+ byte[] hashBytes = hashAlgorithm.ComputeHash(dataBuffer);
+
+ return Convert.ToBase64String(hashBytes);
+ }
+
+ /// <summary>
+ /// Internal function to cut out all non oauth query string parameters (all parameters not begining with "oauth_")
+ /// </summary>
+ /// <param name="parameters">The query string part of the Url</param>
+ /// <returns>A list of QueryParameter each containing the parameter name and value</returns>
+ private List<QueryParameter> GetQueryParameters(string parameters) {
+ if (parameters.StartsWith("?")) {
+ parameters = parameters.Remove(0, 1);
+ }
+
+ List<QueryParameter> result = new List<QueryParameter>();
+
+ if (!string.IsNullOrEmpty(parameters)) {
+ string[] p = parameters.Split('&');
+ foreach (string s in p) {
+ if (!string.IsNullOrEmpty(s) && !s.StartsWith(OAuthParameterPrefix)) {
+ if (s.IndexOf('=') > -1) {
+ string[] temp = s.Split('=');
+ result.Add(new QueryParameter(temp[0], temp[1]));
+ } else {
+ result.Add(new QueryParameter(s, string.Empty));
+ }
+ }
+ }
+ }
+
+ return result;
+ }
+
+ /// <summary>
+ /// This is a different Url Encode implementation since the default .NET one outputs the percent encoding in lower case.
+ /// While this is not a problem with the percent encoding spec, it is used in upper case throughout OAuth
+ /// </summary>
+ /// <param name="value">The value to Url encode</param>
+ /// <returns>Returns a Url encoded string</returns>
+ public string UrlEncode(string value) {
+ StringBuilder result = new StringBuilder();
+
+ foreach (char symbol in value) {
+ if (unreservedChars.IndexOf(symbol) != -1) {
+ result.Append(symbol);
+ } else {
+ result.Append('%' + String.Format("{0:X2}", (int)symbol));
+ }
+ }
+
+ return result.ToString();
+ }
+
+ /// <summary>
+ /// Normalizes the request parameters according to the spec
+ /// </summary>
+ /// <param name="parameters">The list of parameters already sorted</param>
+ /// <returns>a string representing the normalized parameters</returns>
+ protected string NormalizeRequestParameters(IList<QueryParameter> parameters) {
+ StringBuilder sb = new StringBuilder();
+ QueryParameter p = null;
+ for (int i = 0; i < parameters.Count; i++) {
+ p = parameters[i];
+ sb.AppendFormat("{0}={1}", p.Name, p.Value);
+
+ if (i < parameters.Count - 1) {
+ sb.Append("&");
+ }
+ }
+
+ return sb.ToString();
+ }
+
+ /// <summary>
+ /// Generate the signature base that is used to produce the signature
+ /// </summary>
+ /// <param name="url">The full url that needs to be signed including its non OAuth url parameters</param>
+ /// <param name="consumerKey">The consumer key</param>
+ /// <param name="token">The token, if available. If not available pass null or an empty string</param>
+ /// <param name="tokenSecret">The token secret, if available. If not available pass null or an empty string</param>
+ /// <param name="httpMethod">The http method used. Must be a valid HTTP method verb (POST,GET,PUT, etc)</param>
+ /// <param name="signatureType">The signature type. To use the default values use <see cref="OAuthBase.SignatureTypes">OAuthBase.SignatureTypes</see>.</param>
+ /// <returns>The signature base</returns>
+ public string GenerateSignatureBase(Uri url, string consumerKey, string token, string tokenSecret, string httpMethod, string timeStamp, string nonce, string signatureType, out string normalizedUrl, out string normalizedRequestParameters) {
+ if (token == null) {
+ token = string.Empty;
+ }
+
+ if (tokenSecret == null) {
+ tokenSecret = string.Empty;
+ }
+
+ if (string.IsNullOrEmpty(consumerKey)) {
+ throw new ArgumentNullException("consumerKey");
+ }
+
+ if (string.IsNullOrEmpty(httpMethod)) {
+ throw new ArgumentNullException("httpMethod");
+ }
+
+ if (string.IsNullOrEmpty(signatureType)) {
+ throw new ArgumentNullException("signatureType");
+ }
+
+ normalizedUrl = null;
+ normalizedRequestParameters = null;
+
+ List<QueryParameter> parameters = GetQueryParameters(url.Query);
+ if (includeVersion)
+ {
+ parameters.Add(new QueryParameter(OAuthVersionKey, OAuthVersion));
+ }
+ parameters.Add(new QueryParameter(OAuthNonceKey, nonce));
+ parameters.Add(new QueryParameter(OAuthTimestampKey, timeStamp));
+ parameters.Add(new QueryParameter(OAuthSignatureMethodKey, signatureType));
+ parameters.Add(new QueryParameter(OAuthConsumerKeyKey, consumerKey));
+
+ if (!string.IsNullOrEmpty(token)) {
+ parameters.Add(new QueryParameter(OAuthTokenKey, token));
+ }
+
+ parameters.Sort(new QueryParameterComparer());
+
+ normalizedUrl = string.Format("{0}://{1}", url.Scheme, url.Host);
+ if (!((url.Scheme == "http" && url.Port == 80) || (url.Scheme == "https" && url.Port == 443)))
+ {
+ normalizedUrl += ":" + url.Port;
+ }
+ normalizedUrl += url.AbsolutePath;
+ normalizedRequestParameters = NormalizeRequestParameters(parameters);
+
+ StringBuilder signatureBase = new StringBuilder();
+ signatureBase.AppendFormat("{0}&", httpMethod.ToUpper());
+ signatureBase.AppendFormat("{0}&", UrlEncode(normalizedUrl));
+ signatureBase.AppendFormat("{0}", UrlEncode(normalizedRequestParameters));
+
+ return signatureBase.ToString();
+ }
+
+ /// <summary>
+ /// Generate the signature value based on the given signature base and hash algorithm
+ /// </summary>
+ /// <param name="signatureBase">The signature based as produced by the GenerateSignatureBase method or by any other means</param>
+ /// <param name="hash">The hash algorithm used to perform the hashing. If the hashing algorithm requires initialization or a key it should be set prior to calling this method</param>
+ /// <returns>A base64 string of the hash value</returns>
+ public string GenerateSignatureUsingHash(string signatureBase, HashAlgorithm hash) {
+ return ComputeHash(hash, signatureBase);
+ }
+
+ /// <summary>
+ /// Generates a signature using the HMAC-SHA1 algorithm
+ /// </summary>
+ /// <param name="url">The full url that needs to be signed including its non OAuth url parameters</param>
+ /// <param name="consumerKey">The consumer key</param>
+ /// <param name="consumerSecret">The consumer seceret</param>
+ /// <param name="token">The token, if available. If not available pass null or an empty string</param>
+ /// <param name="tokenSecret">The token secret, if available. If not available pass null or an empty string</param>
+ /// <param name="httpMethod">The http method used. Must be a valid HTTP method verb (POST,GET,PUT, etc)</param>
+ /// <returns>A base64 string of the hash value</returns>
+ public string GenerateSignature(Uri url, string consumerKey, string consumerSecret, string token, string tokenSecret, string httpMethod, string timeStamp, string nonce, out string normalizedUrl, out string normalizedRequestParameters) {
+ return GenerateSignature(url, consumerKey, consumerSecret, token, tokenSecret, httpMethod, timeStamp, nonce, SignatureTypes.HMACSHA1, out normalizedUrl, out normalizedRequestParameters);
+ }
+
+ /// <summary>
+ /// Generates a signature using the specified signatureType
+ /// </summary>
+ /// <param name="url">The full url that needs to be signed including its non OAuth url parameters</param>
+ /// <param name="consumerKey">The consumer key</param>
+ /// <param name="consumerSecret">The consumer seceret</param>
+ /// <param name="token">The token, if available. If not available pass null or an empty string</param>
+ /// <param name="tokenSecret">The token secret, if available. If not available pass null or an empty string</param>
+ /// <param name="httpMethod">The http method used. Must be a valid HTTP method verb (POST,GET,PUT, etc)</param>
+ /// <param name="signatureType">The type of signature to use</param>
+ /// <returns>A base64 string of the hash value</returns>
+ public string GenerateSignature(Uri url, string consumerKey, string consumerSecret, string token, string tokenSecret, string httpMethod, string timeStamp, string nonce, SignatureTypes signatureType, out string normalizedUrl, out string normalizedRequestParameters) {
+ normalizedUrl = null;
+ normalizedRequestParameters = null;
+
+ switch (signatureType) {
+ case SignatureTypes.PLAINTEXT:
+ return HttpUtility.UrlEncode(string.Format("{0}&{1}", consumerSecret, tokenSecret));
+ case SignatureTypes.HMACSHA1:
+ string signatureBase = GenerateSignatureBase(url, consumerKey, token, tokenSecret, httpMethod, timeStamp, nonce, HMACSHA1SignatureType, out normalizedUrl, out normalizedRequestParameters);
+
+ HMACSHA1 hmacsha1 = new HMACSHA1();
+ hmacsha1.Key = Encoding.ASCII.GetBytes(string.Format("{0}&{1}", UrlEncode(consumerSecret), string.IsNullOrEmpty(tokenSecret) ? "" : UrlEncode(tokenSecret)));
+
+ return GenerateSignatureUsingHash(signatureBase, hmacsha1);
+ case SignatureTypes.RSASHA1:
+ throw new NotImplementedException();
+ default:
+ throw new ArgumentException("Unknown signature type", "signatureType");
+ }
+ }
+
+ /// <summary>
+ /// Generate the timestamp for the signature
+ /// </summary>
+ /// <returns></returns>
+ public virtual string GenerateTimeStamp() {
+ // Default implementation of UNIX time of the current UTC time
+ TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
+ return Convert.ToInt64(ts.TotalSeconds).ToString();
+ }
+
+ /// <summary>
+ /// Generate a nonce
+ /// </summary>
+ /// <returns></returns>
+ public virtual string GenerateNonce() {
+ // Just a simple implementation of a random number between 123400 and 9999999
+ return random.Next(123400, 9999999).ToString();
+ }
+
+ }
+}
View
143 OAuthSig.csproj
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{867C825A-2A46-4CD7-AD01-CAAD3569EFE1}</ProjectGuid>
+ <OutputType>WinExe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>OAuthSig</RootNamespace>
+ <AssemblyName>OAuthSig</AssemblyName>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <ManifestCertificateThumbprint>FE530C03C287061286247D2EBFF6AA732514C937</ManifestCertificateThumbprint>
+ <ManifestKeyFile>OAuthSig_TemporaryKey.pfx</ManifestKeyFile>
+ <GenerateManifests>false</GenerateManifests>
+ <SignManifests>false</SignManifests>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <TargetFrameworkSubset>
+ </TargetFrameworkSubset>
+ <PublishUrl>C:\Documents and Settings\rrichards\My Documents\temp\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <SupportUrl>http://www.cdatazone.org/</SupportUrl>
+ <ProductName>OAuth Signature Generator</ProductName>
+ <PublisherName>Rob Richards</PublisherName>
+ <ApplicationRevision>1</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <PublishWizardCompleted>true</PublishWizardCompleted>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ <TargetZone>LocalIntranet</TargetZone>
+ <ApplicationManifest>Properties\app.manifest</ApplicationManifest>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Web" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Deployment" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Form1.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="Form1.Designer.cs">
+ <DependentUpon>Form1.cs</DependentUpon>
+ </Compile>
+ <Compile Include="OAuthBase.cs" />
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <EmbeddedResource Include="Form1.resx">
+ <DependentUpon>Form1.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <Compile Include="Properties\Resources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
+ <None Include="app.config" />
+ <None Include="Properties\app.manifest" />
+ <None Include="Properties\Settings.settings">
+ <Generator>SettingsSingleFileGenerator</Generator>
+ <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+ </None>
+ <Compile Include="Properties\Settings.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Settings.settings</DependentUpon>
+ <DesignTimeSharedInput>True</DesignTimeSharedInput>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
View
20 Program.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+
+namespace OAuthSig
+{
+ static class Program
+ {
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new Form1());
+ }
+ }
+}
View
36 Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("OAuthSig")]
+[assembly: AssemblyDescription("OAuth Signature Generator")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("OAuthSig")]
+[assembly: AssemblyCopyright("Copyright © 2008")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("f8b44eca-983d-4edb-9400-f3e0a1e735a5")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
View
71 Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.3053
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace OAuthSig.Properties
+{
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OAuthSig.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
View
117 Properties/Resources.resx
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
View
30 Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.3053
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace OAuthSig.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
View
7 Properties/Settings.settings
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+ <Profiles>
+ <Profile Name="(Default)" />
+ </Profiles>
+ <Settings />
+</SettingsFile>
View
26 Properties/app.manifest
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+ <security>
+ <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
+ <!-- UAC Manifest Options
+ If you want to change the Windows User Account Control level replace the
+ requestedExecutionLevel node with one of the following.
+
+ <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+ <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+ <requestedExecutionLevel level="highestAvailable" uiAccess="false" />
+
+ If you want to utilize File and Registry Virtualization for backward
+ compatibility then delete the requestedExecutionLevel node.
+ -->
+ <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+ </requestedPrivileges>
+ <applicationRequestMinimum>
+ <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" />
+ <defaultAssemblyRequest permissionSetReference="Custom" />
+ </applicationRequestMinimum>
+ </security>
+ </trustInfo>
+</asmv1:assembly>
View
3 app.config
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<configuration>
+<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>

0 comments on commit 242d517

Please sign in to comment.