[
  {
    "path": ".gitignore",
    "content": "/Build\n/Publish\n/Distribution\n/nant-*.log*\npackages/\nBuildMetrics/\n\n#ignore thumbnails created by windows\nThumbs.db\n#Ignore files build by Visual Studio\n*.obj\n*.exe\n*.pdb\n*.user\n*.aps\n*.pch\n*.vspscc\n*_i.c\n*_p.c\n*.ncb\n*.suo\n*.tlb\n*.tlh\n*.bak\n*.cache\n*.ilk\n*.log\n[Bb]in\n[Dd]ebug*/\n*.lib\n*.sbr\nobj/\n[Rr]elease*/\n_ReSharper*/\n[Tt]est[Rr]esult*\n*.userprefs\n"
  },
  {
    "path": ".paket/paket.targets",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <!-- Enable the restore command to run before builds -->\n    <RestorePackages Condition=\" '$(RestorePackages)' == '' \">true</RestorePackages>\n    <!-- Download Paket.exe if it does not already exist -->\n    <DownloadPaket Condition=\" '$(DownloadPaket)' == '' \">true</DownloadPaket>\n    <PaketToolsPath>$(MSBuildThisFileDirectory)</PaketToolsPath>\n    <PaketRootPath>$(MSBuildThisFileDirectory)..\\</PaketRootPath>\n  </PropertyGroup>\n  <PropertyGroup>\n    <!-- Paket command -->\n    <PaketExePath Condition=\" '$(PaketExePath)' == '' \">$(PaketToolsPath)paket.exe</PaketExePath>\n    <PaketBootStrapperExePath Condition=\" '$(PaketBootStrapperExePath)' == '' \">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>\n    <PaketCommand Condition=\" '$(OS)' == 'Windows_NT'\">\"$(PaketExePath)\"</PaketCommand>\n    <PaketCommand Condition=\" '$(OS)' != 'Windows_NT' \">mono --runtime=v4.0.30319 $(PaketExePath)</PaketCommand>\n    <PaketBootStrapperCommand Condition=\" '$(OS)' == 'Windows_NT'\">\"$(PaketBootStrapperExePath)\"</PaketBootStrapperCommand>\n    <PaketBootStrapperCommand Condition=\" '$(OS)' != 'Windows_NT' \">mono --runtime=v4.0.30319 $(PaketBootStrapperExePath)</PaketBootStrapperCommand>\n    <!-- Commands -->\n    <PaketReferences Condition=\"!Exists('$(MSBuildProjectFullPath).paket.references')\">$(MSBuildProjectDirectory)\\paket.references</PaketReferences>\n    <PaketReferences Condition=\"Exists('$(MSBuildProjectFullPath).paket.references')\">$(MSBuildProjectFullPath).paket.references</PaketReferences>\n    <RestoreCommand>$(PaketCommand) restore --references-files $(PaketReferences)</RestoreCommand>\n    <DownloadPaketCommand>$(PaketBootStrapperCommand)</DownloadPaketCommand>\n    <!-- We need to ensure packages are restored prior to assembly resolve -->\n    <BuildDependsOn Condition=\"$(RestorePackages) == 'true'\">RestorePackages; $(BuildDependsOn);</BuildDependsOn>\n  </PropertyGroup>\n  <Target Name=\"CheckPrerequisites\">\n    <!-- Raise an error if we're unable to locate paket.exe -->\n    <Error Condition=\"'$(DownloadPaket)' != 'true' AND !Exists('$(PaketExePath)')\" Text=\"Unable to locate '$(PaketExePath)'\" />\n    <MsBuild Targets=\"DownloadPaket\" Projects=\"$(MSBuildThisFileFullPath)\" Properties=\"Configuration=NOT_IMPORTANT;DownloadPaket=$(DownloadPaket)\" />\n  </Target>\n  <Target Name=\"DownloadPaket\">\n    <Exec Command=\"$(DownloadPaketCommand)\" Condition=\" '$(DownloadPaket)' == 'true' AND !Exists('$(PaketExePath)')\" />\n  </Target>\n  <Target Name=\"RestorePackages\" DependsOnTargets=\"CheckPrerequisites\">\n    <Exec Command=\"$(RestoreCommand)\" WorkingDirectory=\"$(PaketRootPath)\" Condition=\"Exists('$(PaketReferences)')\" />\n  </Target>\n</Project>\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: objective-c\n\nenv:\n  matrix:\n    - MONO_VERSION=\"3.10.0\"\n\nbefore_install:\n  - wget \"http://download.mono-project.com/archive/${MONO_VERSION}/macos-10-x86/MonoFramework-MDK-${MONO_VERSION}.macos10.xamarin.x86.pkg\"\n  - sudo installer -pkg \"MonoFramework-MDK-${MONO_VERSION}.macos10.xamarin.x86.pkg\" -target /\n  - mozroots --import --sync --quiet\n\nscript: \n  - ./build.sh PackageNuGetDistribution\n"
  },
  {
    "path": "LICENSE.md",
    "content": "The MIT License\n\nCopyright (c) 2012 - 2014 Nauck IT KG\t\thttp://www.nauck-it.de\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n"
  },
  {
    "path": "Portable.Licensing.nuspec",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<package xmlns=\"http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd\">\n  <metadata>\n    <id>Portable.Licensing</id>\n    <version>$version$</version>\n    <authors>Nauck IT KG</authors>\n    <owners>Daniel Nauck</owners>\n    <licenseUrl>http://opensource.org/licenses/MIT</licenseUrl>\n    <projectUrl>http://dev.nauck-it.de/projects/portable-licensing</projectUrl>\n    <iconUrl>http://www.nauck-it.de/fileadmin/Portable.Licensing/Portable.Licensing.ico</iconUrl>\n    <requireLicenseAcceptance>false</requireLicenseAcceptance>\n    <description>\n      Portable.Licensing is a cross platform software licensing framework which allows you to\n      implement licensing into your application or library. It provides you all tools to create\n      and validate licenses for your software.\n\n      Portable.Licensing is using the latest military strength, state-of-the-art cryptographic algorithm\n      to ensure that your software and thus your intellectual property is protected.\n\n      It is targeting the Portable Class Library and thus runs on nearly every .NET/Mono profile\n      including Silverlight, Windows Phone, Windows Store App, Xamarin.iOS, Xamarin.Android, Xamarin.Mac\n      and XBox 360. Use it for your Desktop- (WinForms, WPF, etc.), Console-, Service-,\n      Web- (ASP.NET, MVC, etc.), Mobile (Xamarin.iOS, Xamarin.Android) or even LightSwitch applications.\n\n\n      FEATURES\n      - runs on .NET >= 4.0.3, Silverlight 5, Windows Phone >= 8, Windows Store Apps, Mono, Xamarin.iOS, Xamarin.Android, Xamarin.Mac, XBox 360\n      - easy creation and validation of your licenses\n      - trial, standard and subscription licenses\n      - cryptographic signed licenses, no alteration possible\n      - allows you to enable/disable program modules or product features\n      - limit various parameters for your software, e.g. max transactions, etc.\n      - add additional key/value pair attributes to your licenses\n      - easily extend the fluent validation API with extension methods\n    </description>\n    <copyright>Copyright 2012-2014 Nauck IT KG</copyright>\n    <tags>Portable.Licensing PCL Portable Licensing License Key KeyGenerator Protection Signing Nauck</tags>\n    <!--<dependencies>\n      <dependency id=\"BouncyCastle\" version=\"1.7\" />\n    </dependencies>-->\n  </metadata>\n  <files>\n    <file src=\"Distribution/lib/portable-net403+sl5+netcore45+wp8+MonoAndroid1+MonoTouch1/Portable.Licensing.dll\" target=\"lib/portable-net403+sl5+netcore45+wp8+MonoAndroid1+MonoTouch1/Portable.Licensing.dll\" />\n    <file src=\"Distribution/lib/portable-net403+sl5+netcore45+wp8+MonoAndroid1+MonoTouch1/Portable.Licensing.XML\" target=\"lib/portable-net403+sl5+netcore45+wp8+MonoAndroid1+MonoTouch1/Portable.Licensing.XML\" />\n    <file src=\"Distribution/Documentation/LICENSE.md\" target=\"LICENSE.md\" />\n    <file src=\"Distribution/README.txt\" target=\"README.txt\" />\n  </files>\n</package>"
  },
  {
    "path": "README.md",
    "content": "# Documentation #\n\n----------\n\n## About Portable.Licensing ##\n\nPortable.Licensing is a cross platform software licensing framework which allows you to implement licensing into your application or library. It provides you all tools to create and validate licenses for your software.\n\nPortable.Licensing is using the latest military strength, state-of-the-art cryptographic algorithm to ensure that your software and thus your intellectual property is protected.\n\nIt is targeting the *Portable Class Library* and thus runs on nearly every .NET/Mono profile including Silverlight, Windows Phone, Windows Store App, Xamarin.iOS, Xamarin.Android, Xamarin.Mac and XBox 360. Use it for your Desktop- (WinForms, WPF, etc.), Console-, Service-, Web- (ASP.NET, MVC, etc.), Mobile (Xamarin.iOS, Xamarin.Android) or even LightSwitch applications.\n\n## Features ##\n\n- runs on .NET >= 4.0.3, Silverlight 5, Windows Phone >= 8, Windows Store Apps, Mono, Xamarin.iOS, Xamarin.Android, Xamarin.Mac, XBox 360\n- easy creation and validation of your licenses\n- trial, standard and subscription licenses\n- cryptographic signed licenses, no alteration possible\n- allows you to enable/disable program modules or product features\n- limit various parameters for your software, e.g. max transactions, etc.\n- add additional key/value pair attributes to your licenses\n- easily extend the fluent validation API with extension methods\n\n\n## Build status\n\n| Platform | Status of last build |\n| :------ | :------: | :------: |\n| **Mono** | [![Travis build status](https://travis-ci.org/dnauck/Portable.Licensing.svg)](https://travis-ci.org/dnauck/Portable.Licensing) |\n| **Windows** | [![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/ybwy7l9ooue3apqc/branch/devel?svg=true)](https://ci.appveyor.com/project/dnauck/portable-licensing) |\n\n----------\n\n## Getting started ##\n\n### License.Manager light ###\n\nA reference implementation of a management application for products, customers and licenses is available here: [https://github.com/dnauck/License.Manager-Light](https://github.com/dnauck/License.Manager-Light)\n\n### License.Manager ###\n\nLicense.Manager is a web-based management solution for Portable.Licensing developed using AngularJS and ServiceStack.\nIt enables you to manage customers, products and licenses and provides a\nREST service backend for integration with payment providers and 3rd party tools.\n\nLicense.Manager is available here: [https://github.com/dnauck/License.Manager](https://github.com/dnauck/License.Manager)\n\n### Download ###\n\n[Portable.Licensing](https://nuget.org/packages/Portable.Licensing) is distributed with the popular NuGet Packaging Manager. This will make it easier for developers to get the Portable.Licensing distribution into their project.\n\nGo to the NuGet website for more details: [http://nuget.org/](http://nuget.org/)\n\nNuGet provides several ways to get Portable.Licensing into your Project. The easiest way is to right click your project references in Visual Studio and choose the menu item \"Manage NuGet Packages\".\n\nSearch in the \"Online\" tab for \"Portable.Licensing\" and click \"Install\" on your selected packages.\n\nIt is also possible to install the Portable.Licensing packages via the \"NuGet Package Manager Console\".\n\nType the following to install the Portable.Licensing library:\n\n    PM> Install-Package Portable.Licensing\n\nOr use the following command to get a specific version:\n\n    PM> Install-Package Portable.Licensing -Version 1.0.0\n\n### Create a private and public key for your product ###\n\nPortable.Licensing uses the Elliptic Curve Digital Signature Algorithmus (ECDSA) to ensure the license cannot be altered after creation.\n\nFirst you need to create a new public/private key pair for your product:\n\n    var keyGenerator = Portable.Licensing.Security.Cryptography.KeyGenerator.Create(); \n    var keyPair = keyGenerator.GenerateKeyPair(); \n    var privateKey = keyPair.ToEncryptedPrivateKeyString(passPhrase);  \n    var publicKey = keyPair.ToPublicKeyString();\n\nStore the private key securely and distribute the public key with your product.\nNormally you create one key pair for each product, otherwise it is possible to use a license with all products using the same key pair.\nIf you want your customer to buy a new license on each major release you can create a key pair for each release and product.\n\n\n### Create the license generator ###\n\n\nNow we need something to generate licenses. This could be easily done with the *LicenseFactory*:\n\n    var license = License.New()  \n        .WithUniqueIdentifier(Guid.NewGuid())  \n        .As(LicenseType.Trial)  \n        .ExpiresAt(DateTime.Now.AddDays(30))  \n        .WithMaximumUtilization(5)  \n        .WithProductFeatures(new Dictionary<string, string>  \n                                      {  \n                                          {\"Sales Module\", \"yes\"},  \n                                          {\"Purchase Module\", \"yes\"},  \n                                          {\"Maximum Transactions\", \"10000\"}  \n                                      })  \n        .LicensedTo(\"John Doe\", \"john.doe@yourmail.here\")  \n        .CreateAndSignWithPrivateKey(privateKey, passPhrase);\n\nNow you can take the license and save it to a file:\n\n    File.WriteAllText(\"License.lic\", license.ToString(), Encoding.UTF8);\n\nor\n\n    license.Save(xmlWriter);  \n\n\n### Validate the license in your application ###\n\nThe easiest way to assert the license is in the entry point of your application.\n\nFirst load the license from a file or resource:\n\n    var license = License.Load(...);\n\nThen you can assert the license:\n\n    using Portable.Licensing.Validation;\n\n    var validationFailures = license.Validate()  \n                                    .ExpirationDate()  \n                                        .When(lic => lic.Type == LicenseType.Trial)  \n                                    .And()  \n                                    .Signature(publicKey)  \n                                    .AssertValidLicense();\n\nPortable.Licesing will not throw any Exception and just return an enumeration of validation failures.\n\nNow you can iterate over possible validation failures:\n\n    foreach (var failure in validationFailures)\n         Console.WriteLine(failure.GetType().Name + \": \" + failure.Message + \" - \" + failure.HowToResolve);\n\nOr simply check if there is any failure:\n\n    if (validationFailures.Any())\n        // ...\n\nMake sure to call `validationFailures.ToList()` or `validationFailures.ToArray()` before using the result multiple times.\n\n----------\n\n## License ##\n\nPortable.Licensing is distributed using the MIT/X11 License.\n\n## Further Information ##\n\nThe latest release and documentation can be found on the Portable.Licensing project website:\n\n[http://dev.nauck-it.de/projects/portable-licensing](http://dev.nauck-it.de/projects/portable-licensing)\n"
  },
  {
    "path": "Samples/Android.Sample/Android.Sample/Android.Sample.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>8.0.30703</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{C1669549-42DA-49E5-B88B-A6D0AD0A545F}</ProjectGuid>\n    <ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Android.Sample</RootNamespace>\n    <AssemblyName>Android.Sample</AssemblyName>\n    <FileAlignment>512</FileAlignment>\n    <AndroidApplication>true</AndroidApplication>\n    <AndroidResgenFile>Resources\\Resource.Designer.cs</AndroidResgenFile>\n    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>\n    <AndroidLinkMode>None</AndroidLinkMode>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>\n    <AndroidLinkMode>SdkOnly</AndroidLinkMode>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Mono.Android\" />\n    <Reference Include=\"mscorlib\" />\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"Portable.Licensing\">\n      <HintPath>..\\Components\\Portable.Licensing-1.0.0.0\\lib\\mobile\\Portable.Licensing.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"MainActivity.cs\" />\n    <Compile Include=\"Resources\\Resource.Designer.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"Resources\\AboutResources.txt\" />\n    <None Include=\"Assets\\AboutAssets.txt\" />\n  </ItemGroup>\n  <ItemGroup>\n    <AndroidResource Include=\"Resources\\Layout\\Main.axml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <AndroidResource Include=\"Resources\\Values\\Strings.xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <AndroidResource Include=\"Resources\\Drawable\\Icon.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <XamarinComponent Include=\"Portable.Licensing\">\n      <Visible>False</Visible>\n      <Version>1.0.0.0</Version>\n    </XamarinComponent>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildExtensionsPath)\\Xamarin\\Android\\Xamarin.Android.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n     Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <ItemGroup>\n    <XamarinComponentReference Include=\"Portable.Licensing\">\n      <InstallationInProgress>True</InstallationInProgress>\n      <Version>1.0.0.0</Version>\n      <Visible>False</Visible>\n    </XamarinComponentReference>\n  </ItemGroup>\n  <Import Project=\"..\\..\\..\\.paket\\paket.targets\" />\n</Project>"
  },
  {
    "path": "Samples/Android.Sample/Android.Sample/Assets/AboutAssets.txt",
    "content": "Any raw assets you want to be deployed with your application can be placed in\nthis directory (and child directories) and given a Build Action of \"AndroidAsset\".\n\nThese files will be deployed with you package and will be accessible using Android's\nAssetManager, like this:\n\npublic class ReadAsset : Activity\n{\n\tprotected override void OnCreate (Bundle bundle)\n\t{\n\t\tbase.OnCreate (bundle);\n\n\t\tInputStream input = Assets.Open (\"my_asset.txt\");\n\t}\n}\n\nAdditionally, some Android functions will automatically load asset files:\n\nTypeface tf = Typeface.CreateFromAsset (Context.Assets, \"fonts/samplefont.ttf\");"
  },
  {
    "path": "Samples/Android.Sample/Android.Sample/MainActivity.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Text;\nusing Android.App;\nusing Android.Content;\nusing Android.Runtime;\nusing Android.Views;\nusing Android.Widget;\nusing Android.OS;\nusing Portable.Licensing;\nusing Portable.Licensing.Validation;\n\nnamespace Android.Sample\n{\n    [Activity(Label = \"Android.Sample\", MainLauncher = true, Icon = \"@drawable/icon\")]\n    public class MainActivity : Activity\n    {\n        int count = 1;\n\n        protected override void OnCreate(Bundle bundle)\n        {\n            base.OnCreate(bundle);\n\n            var licenseContent = @\"<License>\n                                    <Id>77d4c193-6088-4c64-9663-ed7398ae8c1a</Id>\n                                    <Type>Trial</Type>\n                                    <Expiration>Thu, 31 Dec 2009 23:00:00 GMT</Expiration>\n                                    <Quantity>1</Quantity>\n                                    <Customer>\n                                    <Name>John Doe</Name>\n                                    <Email>john@doe.tld</Email>\n                                    </Customer>\n                                    <LicenseAttributes />\n                                    <ProductFeatures />\n                                    <Signature>MEUCIQDdDpq/Ddt4hZJlird/BcR6FVKLdWF/DENnd6r/0LuB3gIgVm7RSQx5mcjC32JjCoHNdoL8C+etXOtWKiYGLCT4q6w=</Signature>\n                                </License>\";\n\n            var license = License.Load(licenseContent);\n\n            var validationFailures =\n                license.Validate()\n                       .ExpirationDate()\n                            .When(lic => lic.Type == LicenseType.Trial)\n                       .And()\n                       .Signature(Resources.GetString(Resource.String.LicensePublicKey))\n                       .AssertValidLicense().ToList();\n\n            if (validationFailures.Any())\n            {\n                var dialogBuilder = new AlertDialog.Builder(this);\n                dialogBuilder.SetTitle(\"License validation failure!\");\n                dialogBuilder.SetIcon(Android.Resource.Drawable.IcDialogAlert);\n\n                var messageBuilder = new StringBuilder();\n                foreach (var validationFailure in validationFailures)\n                {\n                    messageBuilder.AppendLine(\"Failure:\");\n                    messageBuilder.AppendLine(validationFailure.Message);\n                    messageBuilder.AppendLine(\" \");\n                    messageBuilder.AppendLine(\"Resolve issue by:\");\n                    messageBuilder.AppendLine(validationFailure.HowToResolve);\n                    messageBuilder.AppendLine(\" \");\n                    messageBuilder.AppendLine(\" \");\n                }\n\n                dialogBuilder.SetMessage(messageBuilder.ToString());\n                dialogBuilder.SetNeutralButton(\"Cancel\", (sender, args) => { /* close app */ });\n\n                dialogBuilder.Show();\n            }\n\n            // Set our view from the \"main\" layout resource\n            SetContentView(Resource.Layout.Main);\n\n            // Get our button from the layout resource,\n            // and attach an event to it\n            Button button = FindViewById<Button>(Resource.Id.MyButton);\n\n            button.Click += delegate { button.Text = string.Format(\"{0} clicks!\", count++); };\n        }\n    }\n}\n\n"
  },
  {
    "path": "Samples/Android.Sample/Android.Sample/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing Android.App;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"Android.Sample\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"Android.Sample\")]\n[assembly: AssemblyCopyright(\"Copyright ©  2013\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n[assembly: ComVisible(false)]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n\n// Add some common permissions, these can be removed if not needed\n[assembly: UsesPermission(Android.Manifest.Permission.Internet)]\n[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]\n"
  },
  {
    "path": "Samples/Android.Sample/Android.Sample/Resources/AboutResources.txt",
    "content": "Images, layout descriptions, binary blobs and string dictionaries can be included \nin your application as resource files.  Various Android APIs are designed to \noperate on the resource IDs instead of dealing with images, strings or binary blobs \ndirectly.\n\nFor example, a sample Android app that contains a user interface layout (main.xml),\nan internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) \nwould keep its resources in the \"Resources\" directory of the application:\n\nResources/\n    drawable-hdpi/\n        icon.png\n\n    drawable-ldpi/\n        icon.png\n\n    drawable-mdpi/\n        icon.png\n\n    layout/\n        main.xml\n\n    values/\n        strings.xml\n\nIn order to get the build system to recognize Android resources, set the build action to\n\"AndroidResource\".  The native Android APIs do not operate directly with filenames, but \ninstead operate on resource IDs.  When you compile an Android application that uses resources, \nthe build system will package the resources for distribution and generate a class called\n\"Resource\" that contains the tokens for each one of the resources included. For example, \nfor the above Resources layout, this is what the Resource class would expose:\n\npublic class Resource {\n    public class drawable {\n        public const int icon = 0x123;\n    }\n\n    public class layout {\n        public const int main = 0x456;\n    }\n\n    public class strings {\n        public const int first_string = 0xabc;\n        public const int second_string = 0xbcd;\n    }\n}\n\nYou would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main \nto reference the layout/main.xml file, or Resource.strings.first_string to reference the first \nstring in the dictionary file values/strings.xml."
  },
  {
    "path": "Samples/Android.Sample/Android.Sample/Resources/Layout/Main.axml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"fill_parent\"\n    android:layout_height=\"fill_parent\"\n    >\n<Button  \n    android:id=\"@+id/MyButton\"\n    android:layout_width=\"fill_parent\" \n    android:layout_height=\"wrap_content\" \n    android:text=\"@string/Hello\"\n    />\n</LinearLayout>\n"
  },
  {
    "path": "Samples/Android.Sample/Android.Sample/Resources/Resource.Designer.cs",
    "content": "#pragma warning disable 1591\n//------------------------------------------------------------------------------\n// <auto-generated>\n//     This code was generated by a tool.\n//     Runtime Version:4.0.30319.18033\n//\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n// </auto-generated>\n//------------------------------------------------------------------------------\n\n[assembly: Android.Runtime.ResourceDesignerAttribute(\"Android.Sample.Resource\", IsApplication=true)]\n\nnamespace Android.Sample\n{\n\t\n\t\n\t[System.CodeDom.Compiler.GeneratedCodeAttribute(\"Xamarin.Android.Build.Tasks\", \"1.0.0.0\")]\n\tpublic partial class Resource\n\t{\n\t\t\n\t\tResource()\n\t\t{\n\t\t\tglobal::Android.Runtime.ResourceIdManager.UpdateIdValues ();\n\t\t}\n\t\t\n\t\tpublic static void UpdateIdValues()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic partial class Attribute\n\t\t{\n\t\t\t\n\t\t\tprivate Attribute()\n\t\t\t{\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic partial class Drawable\n\t\t{\n\t\t\t\n\t\t\t// aapt resource value: 0x7f020000\n\t\t\tpublic const int Icon = 2130837504;\n\t\t\t\n\t\t\tprivate Drawable()\n\t\t\t{\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic partial class Id\n\t\t{\n\t\t\t\n\t\t\t// aapt resource value: 0x7f050000\n\t\t\tpublic const int MyButton = 2131034112;\n\t\t\t\n\t\t\tprivate Id()\n\t\t\t{\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic partial class Layout\n\t\t{\n\t\t\t\n\t\t\t// aapt resource value: 0x7f030000\n\t\t\tpublic const int Main = 2130903040;\n\t\t\t\n\t\t\tprivate Layout()\n\t\t\t{\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic partial class String\n\t\t{\n\t\t\t\n\t\t\t// aapt resource value: 0x7f040002\n\t\t\tpublic const int ApplicationName = 2130968578;\n\t\t\t\n\t\t\t// aapt resource value: 0x7f040001\n\t\t\tpublic const int Hello = 2130968577;\n\t\t\t\n\t\t\t// aapt resource value: 0x7f040000\n\t\t\tpublic const int LicensePublicKey = 2130968576;\n\t\t\t\n\t\t\tprivate String()\n\t\t\t{\n\t\t\t}\n\t\t}\n\t}\n}\n#pragma warning restore 1591\n"
  },
  {
    "path": "Samples/Android.Sample/Android.Sample/Resources/Values/Strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string name=\"LicensePublicKey\">MIIBKjCB4wYHKoZIzj0CATCB1wIBATAsBgcqhkjOPQEBAiEA/////wAAAAEAAAAAAAAAAAAAAAD///////////////8wWwQg/////wAAAAEAAAAAAAAAAAAAAAD///////////////wEIFrGNdiqOpPns+u9VXaYhrxlHQawzFOw9jvOPD4n0mBLAxUAxJ02CIbnBJNqZnjhE50mt4GffpAEIQNrF9Hy4SxCR/i85uVjpEDydwN9gS3rM6D0oTlF2JjClgIhAP////8AAAAA//////////+85vqtpxeehPO5ysL8YyVRAgEBA0IABNVLQ1xKY80BFMgGXec++Vw7n8vvNrq32PaHuBiYMm0PEj2JoB7qSSWhfgcjxNVJsxqJ6gDQVWgl0r7LH4dr0KU=</string>\n    <string name=\"Hello\">Hello World, Click Me!</string>\n    <string name=\"ApplicationName\">Android.Sample</string>\n</resources>\n"
  },
  {
    "path": "Samples/Android.Sample/Android.Sample.sln",
    "content": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2012\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \".paket\", \".paket\", \"{706292EF-A192-48CF-9DB7-9FDC32CB0F0A}\"\n\tProjectSection(SolutionItems) = preProject\n\t\t..\\..\\..\\Portable.Licensing\\paket.dependencies = ..\\..\\..\\Portable.Licensing\\paket.dependencies\n\t\t..\\..\\..\\Portable.Licensing\\paket.lock = ..\\..\\..\\Portable.Licensing\\paket.lock\n\tEndProjectSection\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Android.Sample\", \"Android.Sample\\Android.Sample.csproj\", \"{C1669549-42DA-49E5-B88B-A6D0AD0A545F}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{C1669549-42DA-49E5-B88B-A6D0AD0A545F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{C1669549-42DA-49E5-B88B-A6D0AD0A545F}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{C1669549-42DA-49E5-B88B-A6D0AD0A545F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU\n\t\t{C1669549-42DA-49E5-B88B-A6D0AD0A545F}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{C1669549-42DA-49E5-B88B-A6D0AD0A545F}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{C1669549-42DA-49E5-B88B-A6D0AD0A545F}.Release|Any CPU.Deploy.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "Samples/Android.Sample/Android.Sample.sln.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:String x:Key=\"/Default/FilterSettingsManager/CoverageFilterXml/@EntryValue\">&lt;data&gt;&lt;IncludeFilters /&gt;&lt;ExcludeFilters /&gt;&lt;/data&gt;</s:String>\n\t<s:String x:Key=\"/Default/FilterSettingsManager/AttributeFilterXml/@EntryValue\">&lt;data /&gt;</s:String></wpf:ResourceDictionary>"
  },
  {
    "path": "Samples/iOS.Sample/iOS.Sample/AppDelegate.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nusing MonoTouch.Foundation;\nusing MonoTouch.UIKit;\n\nusing Portable.Licensing;\nusing Portable.Licensing.Validation;\n\nnamespace iOS.Sample\n{\n    [Register(\"AppDelegate\")]\n    public partial class AppDelegate : UIApplicationDelegate\n    {\n\t\tconst string licensePublicKey = @\"MIIBKjCB4wYHKoZIzj0CATCB1wIBATAsBgcqhkjOPQEBAiEA/////wAAAAEAAAAAAAAAAAAAAAD///////////////8wWwQg/////wAAAAEAAAAAAAAAAAAAAAD///////////////wEIFrGNdiqOpPns+u9VXaYhrxlHQawzFOw9jvOPD4n0mBLAxUAxJ02CIbnBJNqZnjhE50mt4GffpAEIQNrF9Hy4SxCR/i85uVjpEDydwN9gS3rM6D0oTlF2JjClgIhAP////8AAAAA//////////+85vqtpxeehPO5ysL8YyVRAgEBA0IABNVLQ1xKY80BFMgGXec++Vw7n8vvNrq32PaHuBiYMm0PEj2JoB7qSSWhfgcjxNVJsxqJ6gDQVWgl0r7LH4dr0KU=\";\n        UIWindow window;\n        MyViewController viewController;\n\n        public override bool FinishedLaunching(UIApplication app, NSDictionary options)\n        {\n\t\t\tvar licenseContent = @\"<License>\n                                    <Id>77d4c193-6088-4c64-9663-ed7398ae8c1a</Id>\n                                    <Type>Trial</Type>\n                                    <Expiration>Thu, 31 Dec 2009 23:00:00 GMT</Expiration>\n                                    <Quantity>1</Quantity>\n                                    <Customer>\n                                    <Name>John Doe</Name>\n                                    <Email>john@doe.tld</Email>\n                                    </Customer>\n                                    <LicenseAttributes />\n                                    <ProductFeatures />\n                                    <Signature>MEUCIQDdDpq/Ddt4hZJlird/BcR6FVKLdWF/DENnd6r/0LuB3gIgVm7RSQx5mcjC32JjCoHNdoL8C+etXOtWKiYGLCT4q6w=</Signature>\n                                </License>\";\n\n\t\t\tvar license = License.Load(licenseContent);\n\t\t\t\n\t\t\tvar validationFailures =\n\t\t\t\tlicense.Validate()\n\t\t\t\t\t.ExpirationDate()\n\t\t\t\t\t\t.When(lic => lic.Type == LicenseType.Trial)\n\t\t\t\t\t.And()\n\t\t\t\t\t.Signature(licensePublicKey)\n\t\t\t\t\t.AssertValidLicense().ToList();\n\t\t\t\n\t\t\tif (validationFailures.Any())\n\t\t\t{\n\t\t\t\tvar messageBuilder = new StringBuilder();\n\t\t\t\tforeach (var validationFailure in validationFailures)\n\t\t\t\t{\n\t\t\t\t\tmessageBuilder.AppendLine(\"Failure:\");\n\t\t\t\t\tmessageBuilder.AppendLine(validationFailure.Message);\n\t\t\t\t\tmessageBuilder.AppendLine(\" \");\n\t\t\t\t\tmessageBuilder.AppendLine(\"Resolve issue by:\");\n\t\t\t\t\tmessageBuilder.AppendLine(validationFailure.HowToResolve);\n\t\t\t\t\tmessageBuilder.AppendLine(\" \");\n\t\t\t\t\tmessageBuilder.AppendLine(\" \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tnew UIAlertView (\"License validation failure!\", messageBuilder.ToString(), null, \"Cancel\").Show();\n\t\t\t}\n\n            window = new UIWindow(UIScreen.MainScreen.Bounds);\n\n            viewController = new MyViewController();\n            window.RootViewController = viewController;\n\n            window.MakeKeyAndVisible();\n\n            return true;\n        }\n    }\n}\n\n"
  },
  {
    "path": "Samples/iOS.Sample/iOS.Sample/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>UIDeviceFamily</key>\n\t<array>\n\t\t<integer>1</integer>\n\t\t<integer>2</integer>\n\t</array>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations~ipad</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n\t<key>MinimumOSVersion</key>\n\t<string>3.2</string>\n\t<key>CFBundleDisplayName</key>\n\t<string>Licensing Sample</string>\n</dict>\n</plist>\n"
  },
  {
    "path": "Samples/iOS.Sample/iOS.Sample/Main.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nusing MonoTouch.Foundation;\nusing MonoTouch.UIKit;\n\nnamespace iOS.Sample\n{\n    public class Application\n    {\n        // This is the main entry point of the application.\n        static void Main(string[] args)\n        {\n            // if you want to use a different Application Delegate class from \"AppDelegate\"\n            // you can specify it here.\n            UIApplication.Main(args, null, \"AppDelegate\");\n        }\n    }\n}"
  },
  {
    "path": "Samples/iOS.Sample/iOS.Sample/MyViewController.cs",
    "content": "using System;\nusing MonoTouch.UIKit;\nusing System.Drawing;\n\nnamespace iOS.Sample\n{\n    public class MyViewController : UIViewController\n    {\n        UIButton button;\n        int numClicks = 0;\n        float buttonWidth = 200;\n        float buttonHeight = 50;\n\n        public MyViewController()\n        {\n        }\n\n        public override void ViewDidLoad()\n        {\n            base.ViewDidLoad();\n\n            View.Frame = UIScreen.MainScreen.Bounds;\n            View.BackgroundColor = UIColor.White;\n            View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;\n\n            button = UIButton.FromType(UIButtonType.RoundedRect);\n\n            button.Frame = new RectangleF(\n                View.Frame.Width / 2 - buttonWidth / 2,\n                View.Frame.Height / 2 - buttonHeight / 2,\n                buttonWidth,\n                buttonHeight);\n\n            button.SetTitle(\"Click me\", UIControlState.Normal);\n\n            button.TouchUpInside += (object sender, EventArgs e) =>\n            {\n                button.SetTitle(String.Format(\"clicked {0} times\", numClicks++), UIControlState.Normal);\n            };\n\n            button.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleTopMargin |\n                UIViewAutoresizing.FlexibleBottomMargin;\n\n            View.AddSubview(button);\n        }\n\n    }\n}\n\n"
  },
  {
    "path": "Samples/iOS.Sample/iOS.Sample/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"iOS.Sample\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"iOS.Sample\")]\n[assembly: AssemblyCopyright(\"Copyright ©  2013\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"20e317da-48a5-44bf-aade-5da1046bf568\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "Samples/iOS.Sample/iOS.Sample/iOS.Sample.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">iPhoneSimulator</Platform>\n    <ProductVersion>8.0.30703</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}</ProjectGuid>\n    <ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n    <OutputType>Exe</OutputType>\n    <RootNamespace>iOS.Sample</RootNamespace>\n    <IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' \">\n    <DebugSymbols>True</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>False</Optimize>\n    <OutputPath>bin\\iPhoneSimulator\\Debug</OutputPath>\n    <DefineConstants>DEBUG</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <ConsolePause>False</ConsolePause>\n    <MtouchLink>None</MtouchLink>\n    <MtouchDebug>True</MtouchDebug>\n    <AssemblyName>PortableLicensingiOSSample</AssemblyName>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' \">\n    <DebugType>none</DebugType>\n    <Optimize>True</Optimize>\n    <OutputPath>bin\\iPhoneSimulator\\Release</OutputPath>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <ConsolePause>False</ConsolePause>\n    <MtouchLink>None</MtouchLink>\n    <AssemblyName>PortableLicensingiOSSample</AssemblyName>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|iPhone' \">\n    <DebugSymbols>True</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>False</Optimize>\n    <OutputPath>bin\\iPhone\\Debug</OutputPath>\n    <DefineConstants>DEBUG</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <ConsolePause>False</ConsolePause>\n    <MtouchDebug>True</MtouchDebug>\n    <CodesignKey>iPhone Developer</CodesignKey>\n    <AssemblyName>iOS.Sample</AssemblyName>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|iPhone' \">\n    <DebugType>none</DebugType>\n    <Optimize>True</Optimize>\n    <OutputPath>bin\\iPhone\\Release</OutputPath>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <ConsolePause>False</ConsolePause>\n    <CodesignKey>iPhone Developer</CodesignKey>\n    <AssemblyName>iOS.Sample</AssemblyName>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' \">\n    <DebugType>none</DebugType>\n    <Optimize>True</Optimize>\n    <OutputPath>bin\\iPhone\\Ad-Hoc</OutputPath>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <ConsolePause>False</ConsolePause>\n    <CodesignKey>iPhone Distribution</CodesignKey>\n    <BuildIpa>True</BuildIpa>\n    <AssemblyName>iOS.Sample</AssemblyName>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' \">\n    <DebugType>none</DebugType>\n    <Optimize>True</Optimize>\n    <OutputPath>bin\\iPhone\\AppStore</OutputPath>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <ConsolePause>False</ConsolePause>\n    <CodesignKey>iPhone Distribution</CodesignKey>\n    <AssemblyName>iOS.Sample</AssemblyName>\n  </PropertyGroup>\n  <ItemGroup>\n    <Compile Include=\"Main.cs\" />\n    <Compile Include=\"AppDelegate.cs\" />\n    <None Include=\"Info.plist\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"MyViewController.cs\" />\n    <BundleResource Include=\"Resources\\Default.png\" />\n    <BundleResource Include=\"Resources\\Default%402x.png\" />\n    <BundleResource Include=\"Resources\\Default-568h%402x.png\" />\n  </ItemGroup>\n  <ItemGroup>\n    <XamarinComponent Include=\"Portable.Licensing\">\n      <Visible>False</Visible>\n      <Version>1.0.0.0</Version>\n    </XamarinComponent>\n  </ItemGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"monotouch\" />\n    <Reference Include=\"Portable.Licensing\">\n      <HintPath>..\\Components\\Portable.Licensing-1.0.0.0\\lib\\mobile\\Portable.Licensing.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildExtensionsPath)\\Xamarin\\iOS\\Xamarin.MonoTouch.CSharp.targets\" />\n  <ItemGroup>\n    <XamarinComponentReference Include=\"Portable.Licensing\">\n      <InstallationInProgress>True</InstallationInProgress>\n      <Version>1.0.0.0</Version>\n      <Visible>False</Visible>\n    </XamarinComponentReference>\n  </ItemGroup>\n  <Import Project=\"..\\..\\..\\.paket\\paket.targets\" />\n</Project>"
  },
  {
    "path": "Samples/iOS.Sample/iOS.Sample.sln",
    "content": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2012\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \".paket\", \".paket\", \"{1E85F3C2-210B-43F2-9135-CC771B654196}\"\n\tProjectSection(SolutionItems) = preProject\n\t\t..\\..\\..\\Portable.Licensing\\paket.dependencies = ..\\..\\..\\Portable.Licensing\\paket.dependencies\n\t\t..\\..\\..\\Portable.Licensing\\paket.lock = ..\\..\\..\\Portable.Licensing\\paket.lock\n\tEndProjectSection\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"iOS.Sample\", \"iOS.Sample\\iOS.Sample.csproj\", \"{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tAd-Hoc|iPhone = Ad-Hoc|iPhone\n\t\tAd-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator\n\t\tAppStore|iPhone = AppStore|iPhone\n\t\tAppStore|iPhoneSimulator = AppStore|iPhoneSimulator\n\t\tDebug|iPhone = Debug|iPhone\n\t\tDebug|iPhoneSimulator = Debug|iPhoneSimulator\n\t\tRelease|iPhone = Release|iPhone\n\t\tRelease|iPhoneSimulator = Release|iPhoneSimulator\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone\n\t\t{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone\n\t\t{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator\n\t\t{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator\n\t\t{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}.AppStore|iPhone.ActiveCfg = AppStore|iPhone\n\t\t{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}.AppStore|iPhone.Build.0 = AppStore|iPhone\n\t\t{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator\n\t\t{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator\n\t\t{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}.Debug|iPhone.ActiveCfg = Debug|iPhone\n\t\t{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}.Debug|iPhone.Build.0 = Debug|iPhone\n\t\t{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator\n\t\t{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator\n\t\t{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}.Release|iPhone.ActiveCfg = Release|iPhone\n\t\t{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}.Release|iPhone.Build.0 = Release|iPhone\n\t\t{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator\n\t\t{2C8B478A-A9A6-4C6B-81C5-EE2923B7ECCA}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "Samples/iOS.Sample/iOS.Sample.sln.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:String x:Key=\"/Default/FilterSettingsManager/CoverageFilterXml/@EntryValue\">&lt;data&gt;&lt;IncludeFilters /&gt;&lt;ExcludeFilters /&gt;&lt;/data&gt;</s:String>\n\t<s:String x:Key=\"/Default/FilterSettingsManager/AttributeFilterXml/@EntryValue\">&lt;data /&gt;</s:String></wpf:ResourceDictionary>"
  },
  {
    "path": "Tools/xpkg/xpkg",
    "content": "#!/bin/bash\nDIR=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\nmono $DIR/xpkg.exe \"$@\"\n"
  },
  {
    "path": "Xamarin/Details.md",
    "content": "Portable.Licensing is a cross platform software licensing framework which allows you to implement licensing into your application or library. It provides you all tools to create and validate licenses for your software.\n\nPortable.Licensing is using the latest military strength, state-of-the-art cryptographic algorithm to ensure that your software and thus your intellectual property is protected.\n\nIt is targeting the *Portable Class Library* and thus runs on nearly every .NET/Mono profile including Silverlight, Windows Phone, Windows Store App, Xamarin.iOS, Xamarin.Android, Xamarin.Mac and XBox 360. Use it for your Desktop- (WinForms, WPF, etc.), Console-, Service-, Web- (ASP.NET, MVC, etc.), Mobile (Xamarin.iOS, Xamarin.Android) or even LightSwitch applications.\n\n## Features ##\n\n- runs on .NET >= 4.0.3, Silverlight 5, Windows Phone >= 8, Windows Store Apps, Mono, Xamarin.iOS, Xamarin.Android, Xamarin.Mac, XBox 360\n- easy creation and validation of your licenses\n- trial, standard and subscription licenses\n- cryptographic signed licenses, no alteration possible\n- allows you to enable/disable program modules or product features\n- limit various parameters for your software, e.g. max transactions, etc.\n- add additional key/value pair attributes to your licenses\n- easily extend the fluent validation API with extension methods\n\n\n----------\n\n### License.Manager light ###\n\nA reference implementation of a management application for products, customers and licenses is available here: [https://github.com/dnauck/License.Manager-Light](https://github.com/dnauck/License.Manager-Light)\n\n### License.Manager ###\n\nLicense.Manager is a web-based management solution for Portable.Licensing developed using AngularJS and ServiceStack.\nIt enables you to manage customers, products and licenses and provides a\nREST service backend for integration with payment providers and 3rd party tools.\n\nLicense.Manager is available here: [https://github.com/dnauck/License.Manager](https://github.com/dnauck/License.Manager)\n\n### Validate the license in your application ###\n\nThe easiest way to assert the license is in the entry point of your application.\n\nFirst load the license from a file or resource:\n\n    var license = License.Load(...);\n\nThen you can assert the license:\n\n    var validationFailures = license.Validate()  \n                                    .ExpirationDate()  \n                                        .When(lic => lic.Type == LicenseType.Trial)  \n                                    .And()  \n                                    .Signature(publicKey)  \n                                    .AssertValidLicense();\n\n\n----------\n\n## License ##\n\nPortable.Licensing is distributed using the MIT/X11 License.\n\n## Further Information ##\n\nThe latest release and documentation can be found on the Portable.Licensing project website:\n\n[http://dev.nauck-it.de/projects/portable-licensing](http://dev.nauck-it.de/projects/portable-licensing)\n"
  },
  {
    "path": "Xamarin/GettingStarted.md",
    "content": "## Getting started ##\n\n### License.Manager light ###\n\nA reference implementation of a management application for products, customers and licenses is available here: [https://github.com/dnauck/License.Manager-Light](https://github.com/dnauck/License.Manager-Light)\n\n### Create a private and public key for your product ###\n\nPortable.Licensing uses the Elliptic Curve Digital Signature Algorithmus (ECDSA) to ensure the license cannot be altered after creation.\n\nFirst you need to create a new public/private key pair for your product:\n\n    var keyGenerator = Portable.Licensing.Security.Cryptography.KeyGenerator.Create(); \n    var keyPair = keyGenerator.GenerateKeyPair(); \n    var privateKey = keyPair.ToEncryptedPrivateKeyString(passPhrase);  \n    var publicKey = keyPair.ToPublicKeyString();\n\nStore the private key securely and distribute the public key with your product.\nNormally you create one key pair for each product, otherwise it is possible to use a license with all products using the same key pair.\nIf you want your customer to buy a new license on each major release you can create a key pair for each release and product.\n\n### Create the license generator ###\n\n\nNow we need something to generate licenses. This could be easily done with the *LicenseFactory*:\n\n    var license = License.New()  \n        .WithUniqueIdentifier(Guid.NewGuid())  \n        .As(LicenseType.Trial)  \n        .ExpiresAt(DateTime.Now.AddDays(30))  \n        .WithMaximumUtilization(5)  \n        .WithProductFeatures(new Dictionary<string, string>  \n                                      {  \n                                          {\"Sales Module\", \"yes\"},  \n                                          {\"Purchase Module\", \"yes\"},  \n                                          {\"Maximum Transactions\", \"10000\"}  \n                                      })  \n        .LicensedTo(\"John Doe\", \"john.doe@yourmail.here\")  \n        .CreateAndSignWithPrivateKey(privateKey, passPhrase);\n\nNow you can take the license and save it to a file:\n\n    File.WriteAllText(\"License.lic\", license.ToString(), Encoding.UTF8);\n\nor\n\n    license.Save(xmlWriter);  \n\n\n### Validate the license in your application ###\n\nThe easiest way to assert the license is in the entry point of your application.\n\nFirst load the license from a file or resource:\n\n    var license = License.Load(...);\n\nThen you can assert the license:\n\n    using Portable.Licensing.Validation;\n\n    var validationFailures = license.Validate()  \n                                    .ExpirationDate()  \n                                        .When(lic => lic.Type == LicenseType.Trial)  \n                                    .And()  \n                                    .Signature(publicKey)  \n                                    .AssertValidLicense();\n\nPortable.Licesing will not throw any Exception and just return an enumeration of validation failures.\n\nNow you can iterate over possible validation failures:\n\n    foreach (var failure in validationFailures)\n         Console.WriteLine(failure.GetType().Name + \": \" + failure.Message + \" - \" + failure.HowToResolve);\n\nOr simply check if there is any failure:\n\n    if (validationResults.Any())\n        // ...\n\nMake sure to call `validationFailures.ToList()` or `validationFailures.ToArray()` before using the result multiple times."
  },
  {
    "path": "appveyor.yml",
    "content": "init:\n  - git config --global core.autocrlf input\nbuild_script:\n  - cmd: build.bat PackageNuGetDistribution\ntest: off\nartifacts:\n  - path: bin\n    name: bin\n"
  },
  {
    "path": "build-runTests.bat",
    "content": "@echo off\ncls\n\n.paket\\paket.bootstrapper.exe prerelease\nif errorlevel 1 (\n  exit /b %errorlevel%\n)\n\n.paket\\paket.exe restore -v\nif errorlevel 1 (\n  exit /b %errorlevel%\n)\n\npackages\\FAKE\\tools\\FAKE.exe build.fsx target=Test %*\n"
  },
  {
    "path": "build.bat",
    "content": "@echo off\ncls\n\n.paket\\paket.bootstrapper.exe prerelease\nif errorlevel 1 (\n  exit /b %errorlevel%\n)\n\n.paket\\paket.exe restore -v\nif errorlevel 1 (\n  exit /b %errorlevel%\n)\n\npackages\\FAKE\\tools\\FAKE.exe build.fsx %*\n"
  },
  {
    "path": "build.fsx",
    "content": "// include Fake lib\n#I @\"packages/FAKE/tools\"\n#r @\"FakeLib.dll\"\n\nopen Fake\nopen Fake.AssemblyInfoFile\nopen System\n\n// build properties\nlet frameworkProfile = @\"portable-net403+sl5+netcore45+wp8+MonoAndroid1+MonoTouch1\" // profile 147\nlet buildTarget = getBuildParamOrDefault \"buildTarget\" \"Build\"\nlet buildConfiguration = getBuildParamOrDefault \"buildConfiguration\" \"Release\"\n\n// common path properties\nlet sourceDir = currentDirectory @@ \"src\"\nlet buildDir = currentDirectory @@ \"Build\"\nlet buildMergedDir = buildDir @@ \"merged\"\nlet buildMetricsDir = currentDirectory @@ \"BuildMetrics\"\nlet distributionDir = currentDirectory @@ \"Distribution\"\nlet publishDir = currentDirectory @@ \"Publish\"\nlet solutionFile = sourceDir @@ \"Portable.Licensing.sln\"\n\n// tools path properties\nlet toolsDir = currentDirectory @@ \"Tools\"\nlet nugetExecutable = \"packages\" @@ \"NuGet.CommandLine\" @@ \"tools\" @@ \"NuGet.exe\"\nlet mergerExecutable = toolsDir @@ \"ILRepack\" @@ \"ILRepack.exe\"\nlet xpkgExecutable = toolsDir @@ \"xpkg\" @@ \"xpkg.exe\"\n\n// common assembly info properties\nlet assemblyVersion = getBuildParamOrDefault \"assemblyVersion\" \"1.0.0.0\"\nlet assemblyFileVersion = getBuildParamOrDefault \"assemblyFileVersion\" \"1.1.0.0\"\nlet assemblyInformationalVersion = getBuildParamOrDefault \"assemblyInformationalVersion\" \"1.1.0\"\n\n// Targets\nTarget \"All\" DoNothing\n\nTarget \"Clean\" (fun _ ->\n    CleanDirs [\n        buildDir \n        buildMetricsDir\n        distributionDir\n        publishDir ]\n)\n\nTarget \"CreateAssemblyInfo\" (fun _ ->\n    CreateCSharpAssemblyInfo (sourceDir @@ \"CommonAssemblyInfo.cs\")\n        [\n        Attribute.Company \"Nauck IT KG\"\n        Attribute.Product \"Portable.Licensing\"\n        Attribute.Copyright (sprintf \"Copyright  2012 - %A Nauck IT KG\" DateTime.Now.Year)\n        Attribute.Version assemblyVersion\n        Attribute.FileVersion assemblyFileVersion\n        Attribute.InformationalVersion assemblyInformationalVersion\n        ]\n)\n\nTarget \"Build\" (fun _ ->\n    build (fun msbuild ->\n        {msbuild with\n            Targets = [buildTarget]\n            Properties = [\"Configuration\", buildConfiguration]\n        }\n    ) solutionFile\n)\n\nTarget \"Test\" (fun _ ->\n    !! (buildDir @@ \"*Tests.dll\") \n      |> NUnit (fun p ->\n          {p with\n             //DisableShadowCopy = true;\n             OutputFile = buildMetricsDir @@ \"nunit-result.xml\" })\n)\n\nTarget \"MergeAssemblies\" (fun _ ->\n    CreateDir buildMergedDir\n\n    let result =\n        ExecProcess (fun info ->\n            info.FileName <- mergerExecutable\n            info.WorkingDirectory <- buildDir\n            info.Arguments <- sprintf \"-target:library -internalize -verbose -lib:%s /out:%s %s %s\" buildDir (buildMergedDir @@ \"Portable.Licensing.dll\") \"Portable.Licensing.dll\" \"BouncyCastle.Crypto.dll\"\n            ) (TimeSpan.FromMinutes 5.)\n\n    if result <> 0 then failwithf \"Error during ILRepack execution.\"\n\n    let filesToDelete =\n        !+ (buildDir @@ \"Portable.Licensing.*\")\n        ++ (buildDir @@ \"BouncyCastle.Crypto.*\")\n        -- (buildDir @@ \"Portable.Licensing.XML\") |> Scan\n\n    DeleteFiles filesToDelete\n\n    let filesToCopy =\n        !+ (buildMergedDir @@ \"Portable.Licensing.*\") |> Scan\n\n    Copy buildDir filesToCopy\n)\n\nTarget \"PreparePackaging\" (fun _ ->\n    // create the directory structure for the deployment zip and NuGet package\n    // and copy in the files to deploy\n\n    let docsDir = distributionDir @@ \"Documentation\"\n    CreateDir docsDir\n\n    CopyFile docsDir \"Readme.md\"\n    CopyFile docsDir \"LICENSE.md\"\n\n    let libsDir = distributionDir @@ \"lib\" @@ frameworkProfile\n    CreateDir libsDir\n\n    let librariesToDeploy =\n        !+ (buildDir @@ \"Portable.Licensing.dll\")\n        ++ (buildDir @@ \"Portable.Licensing.XML\")\n        -- (buildDir @@ \"Portable.Licensing.pdb\") |> Scan\n\n    Copy libsDir librariesToDeploy\n)\n\nTarget \"PackgaeZipDistribution\" (fun _ ->\n    Zip distributionDir (publishDir @@ String.Format(@\"Portable.Licensing-{0}.zip\", assemblyInformationalVersion)) !! (distributionDir @@ \"**\")\n)\n\nTarget \"PackageNuGetDistribution\" (fun _ ->\n\n    // rename Readme.md to Readme.txt in the NuGet package, so that the file \n    // could be shown automaticly by VS during package installation\n    CopyFile distributionDir \"Readme.md\"\n    Rename (distributionDir @@ \"Readme.txt\") (distributionDir @@ \"Readme.md\")\n\n    let result =\n        ExecProcess (fun info ->\n            info.FileName <- nugetExecutable\n            info.WorkingDirectory <- \"./\"\n            info.Arguments <- sprintf \"pack Portable.Licensing.nuspec -Version %s -OutputDirectory %s\" assemblyInformationalVersion publishDir\n            ) (TimeSpan.FromMinutes 5.)\n\n    if result <> 0 then failwithf \"Error during NuGet creation.\"\n\n    // delete the renamed file\n    DeleteFile (distributionDir @@ \"Readme.txt\")\n)\n\nTarget \"PackageXamarinDistribution\" (fun _ ->\n\n    xpkgPack (fun p ->\n        {p with\n            ToolPath = xpkgExecutable;\n            Package = \"Portable.Licensing\";\n            Version = assemblyFileVersion;\n            OutputPath = publishDir\n            Project = \"Portable.Licensing\"\n            Summary = \"Portable.Licensing is a cross platform software licensing framework which allows you to implement licensing into your application or library\"\n            Publisher = \"Nauck IT KG\"\n            Website = \"http://dev.nauck-it.de/projects/portable-licensing\"\n            Details = \"./Xamarin/Details.md\"\n            License = \"License.md\"\n            GettingStarted = \"./Xamarin/GettingStarted.md\"\n            Icons = [\"./Xamarin/Portable.Licensing_512x512.png\"; \"./Xamarin/Portable.Licensing_128x128.png\"]\n            Libraries = [\"mobile\", \"./Distribution/lib/\" @@ frameworkProfile @@ \"/Portable.Licensing.dll\"]\n            Samples = [\"Android Sample. A simple sample that validates a trial license.\", \"./Samples/Android.Sample/Android.Sample.sln\";\n                        \"iOS Sample. A simple sample that validates a trial license.\", \"./Samples/iOS.Sample/iOS.Sample.sln\"]\n        }\n    )\n\n    xpkgValidate (fun p ->\n        {p with\n            ToolPath = xpkgExecutable;\n            Package = \"Portable.Licensing\";\n            Version = assemblyFileVersion;\n            OutputPath = publishDir\n            Project = \"Portable.Licensing\"\n        }\n    )\n)\n\n// Dependencies\n\"Clean\" \n    ==> \"CreateAssemblyInfo\"\n    ==> \"Build\"\n    ==> \"Test\"\n    ==> \"MergeAssemblies\"\n    ==> \"PreparePackaging\"\n    ==> \"PackgaeZipDistribution\"\n    ==> \"PackageNuGetDistribution\"\n    ==> \"PackageXamarinDistribution\"\n    ==> \"All\"\n \n// start build\nRun <| getBuildParamOrDefault \"target\" \"All\""
  },
  {
    "path": "build.sh",
    "content": "#!/bin/bash\nif test \"$OS\" = \"Windows_NT\"\nthen\n  # use .Net\n\n  .paket/paket.bootstrapper.exe prerelease\n  exit_code=$?\n  if [ $exit_code -ne 0 ]; then\n  \texit $exit_code\n  fi\n\n  .paket/paket.exe restore -v\n  exit_code=$?\n  if [ $exit_code -ne 0 ]; then\n  \texit $exit_code\n  fi\n\n  packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx \nelse\n  # use mono\n  mono .paket/paket.bootstrapper.exe prerelease\n  exit_code=$?\n  if [ $exit_code -ne 0 ]; then\n  \texit $exit_code\n  fi\n\n  mono .paket/paket.exe restore -v\n  exit_code=$?\n  if [ $exit_code -ne 0 ]; then\n  \texit $exit_code\n  fi\n  mono packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx \nfi\n"
  },
  {
    "path": "lib/License.txt",
    "content": "Please note: our license is an adaptation of the MIT X11 License and should be read as such.\n\nLICENSE\nCopyright (c) 2000 - 2011 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE 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."
  },
  {
    "path": "paket.dependencies",
    "content": "source https://nuget.org/api/v2\n\nnuget FAKE\nnuget NUnit                   \nnuget NUnit.Runners\nnuget NuGet.CommandLine"
  },
  {
    "path": "src/CommonAssemblyInfo.cs",
    "content": "﻿// <auto-generated/>\nusing System.Reflection;\n\n[assembly: AssemblyCompanyAttribute(\"Nauck IT KG\")]\n[assembly: AssemblyProductAttribute(\"Portable.Licensing\")]\n[assembly: AssemblyCopyrightAttribute(\"Copyright � 2012 - 2014 Nauck IT KG\")]\n[assembly: AssemblyVersionAttribute(\"1.0.0.0\")]\n[assembly: AssemblyFileVersionAttribute(\"1.1.0.0\")]\n[assembly: AssemblyInformationalVersionAttribute(\"1.1.0\")]\nnamespace System {\n    internal static class AssemblyVersionInformation {\n        internal const string Version = \"1.0.0.0\";\n    }\n}\n"
  },
  {
    "path": "src/Portable.Licensing/AssemblyBuildDateAttribute.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Globalization;\n\nnamespace Portable.Licensing\n{\n    /// <summary>\n    /// Defines assembly build date information for an assembly manifest.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Assembly, Inherited = false)]\n    public sealed class AssemblyBuildDateAttribute : Attribute\n    {\n        private readonly DateTime buildDate;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AssemblyBuildDateAttribute\"/> class\n        /// with the specified build date.\n        /// </summary>\n        /// <param name=\"buildDate\">The build date of the assembly.</param>\n        public AssemblyBuildDateAttribute(DateTime buildDate)\n        {\n            this.buildDate = buildDate;\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"AssemblyBuildDateAttribute\"/> class\n        /// with the specified build date string.\n        /// </summary>\n        /// <param name=\"buildDateString\">The build date of the assembly.</param>\n        public AssemblyBuildDateAttribute(string buildDateString)\n        {\n            buildDate = DateTime.Parse(buildDateString, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal);\n        }\n\n        /// <summary>\n        /// Gets the assembly build date.\n        /// </summary>\n        public DateTime BuildDate\n        {\n            get { return buildDate; }\n        }\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/Customer.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System.Xml.Linq;\n\nnamespace Portable.Licensing\n{\n    /// <summary>\n    /// The customer of a <see cref=\"License\"/>.\n    /// </summary>\n    public class Customer : LicenseAttributes\n    {\n        internal Customer(XElement xmlData)\n            : base(xmlData, \"CustomerData\")\n        {\n        }\n\n        /// <summary>\n        /// Gets or sets the Name of this <see cref=\"Customer\"/>.\n        /// </summary>\n        public string Name\n        {\n            get { return GetTag(\"Name\"); }\n            set { SetTag(\"Name\", value); }\n        }\n        \n        /// <summary>\n        /// Gets or sets the Company of this <see cref=\"Customer\"/>.\n        /// </summary>\n        public string Company\n        {\n            get { return GetTag(\"Company\"); }\n            set { SetTag(\"Company\", value); }\n        }\n\n        /// <summary>\n        /// Gets or sets the Email of this <see cref=\"Customer\"/>.\n        /// </summary>\n        public string Email\n        {\n            get { return GetTag(\"Email\"); }\n            set { SetTag(\"Email\", value); }\n        }\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/IFluentInterface.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.ComponentModel;\n\nnamespace Portable.Licensing\n{\n    /// <summary>\n    /// Interface that is used to build fluent interfaces and hides methods declared by <see cref=\"object\"/> from IntelliSense.\n    /// </summary>\n    /// <remarks>\n    /// Code that consumes implementations of this interface should expect one of two things:\n    /// <list type = \"number\">\n    ///   <item>When referencing the interface from within the same solution (project reference), you will still see the methods this interface is meant to hide.</item>\n    ///   <item>When referencing the interface through the compiled output assembly (external reference), the standard Object methods will be hidden as intended.</item>\n    /// </list>\n    /// See http://bit.ly/ifluentinterface for more information.\n    /// </remarks>\n    [EditorBrowsable(EditorBrowsableState.Never)]\n    public interface IFluentInterface\n    {\n        /// <summary>\n        /// Redeclaration that hides the <see cref=\"object.GetType()\"/> method from IntelliSense.\n        /// </summary>\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        Type GetType();\n\n        /// <summary>\n        /// Redeclaration that hides the <see cref=\"object.GetHashCode()\"/> method from IntelliSense.\n        /// </summary>\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        int GetHashCode();\n\n        /// <summary>\n        /// Redeclaration that hides the <see cref=\"object.ToString()\"/> method from IntelliSense.\n        /// </summary>\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        string ToString();\n\n        /// <summary>\n        /// Redeclaration that hides the <see cref=\"object.Equals(object)\"/> method from IntelliSense.\n        /// </summary>\n        [EditorBrowsable(EditorBrowsableState.Never)]\n        bool Equals(object obj);\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/ILicenseBuilder.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace Portable.Licensing\n{\n    /// <summary>\n    /// Fluent api to create and sign a new <see cref=\"License\"/>. \n    /// </summary>\n    public interface ILicenseBuilder : IFluentInterface\n    {\n        /// <summary>\n        /// Sets the unique identifier of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"id\">The unique identifier of the <see cref=\"License\"/>.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        ILicenseBuilder WithUniqueIdentifier(Guid id);\n\n        /// <summary>\n        /// Sets the <see cref=\"LicenseType\"/> of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"type\">The <see cref=\"LicenseType\"/> of the <see cref=\"License\"/>.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        ILicenseBuilder As(LicenseType type);\n\n        /// <summary>\n        /// Sets the expiration date of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"date\">The expiration date of the <see cref=\"License\"/>.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        ILicenseBuilder ExpiresAt(DateTime date);\n\n        /// <summary>\n        /// Sets the maximum utilization of the <see cref=\"License\"/>.\n        /// This can be the quantity of developers for a \"per-developer-license\".\n        /// </summary>\n        /// <param name=\"utilization\">The maximum utilization of the <see cref=\"License\"/>.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        ILicenseBuilder WithMaximumUtilization(int utilization);\n\n        /// <summary>\n        /// Sets the <see cref=\"Customer\">license holder</see> of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"name\">The name of the license holder.</param>\n        /// <param name=\"email\">The email of the license holder.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        ILicenseBuilder LicensedTo(string name, string email);\n\n        /// <summary>\n        /// Sets the <see cref=\"Customer\">license holder</see> of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"name\">The name of the license holder.</param>\n        /// <param name=\"email\">The email of the license holder.</param>\n        /// <param name=\"configureCustomer\">A delegate to configure the license holder.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        ILicenseBuilder LicensedTo(string name, string email, Action<Customer> configureCustomer);\n\n        /// <summary>\n        /// Sets the <see cref=\"Customer\">license holder</see> of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"configureCustomer\">A delegate to configure the license holder.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        ILicenseBuilder LicensedTo(Action<Customer> configureCustomer);\n\n        /// <summary>\n        /// Sets the licensed product features of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"productFeatures\">The licensed product features of the <see cref=\"License\"/>.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        ILicenseBuilder WithProductFeatures(IDictionary<string, string> productFeatures);\n\n        /// <summary>\n        /// Sets the licensed product features of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"configureProductFeatures\">A delegate to configure the product features.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        ILicenseBuilder WithProductFeatures(Action<LicenseAttributes> configureProductFeatures);\n\n        /// <summary>\n        /// Sets the licensed additional attributes of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"additionalAttributes\">The additional attributes of the <see cref=\"License\"/>.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        ILicenseBuilder WithAdditionalAttributes(IDictionary<string, string> additionalAttributes);\n\n        /// <summary>\n        /// Sets the licensed additional attributes of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"configureAdditionalAttributes\">A delegate to configure the additional attributes.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        ILicenseBuilder WithAdditionalAttributes(Action<LicenseAttributes> configureAdditionalAttributes);\n\n        /// <summary>\n        /// Create and sign a new <see cref=\"License\"/> with the specified\n        /// private encryption key.\n        /// </summary>\n        /// <param name=\"privateKey\">The private encryption key for the signature.</param>\n        /// <param name=\"passPhrase\">The pass phrase to decrypt the private key.</param>\n        /// <returns>The signed <see cref=\"License\"/>.</returns>\n        License CreateAndSignWithPrivateKey(string privateKey, string passPhrase);\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/License.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Globalization;\nusing System.IO;\nusing System.Text;\nusing System.Xml;\nusing System.Xml.Linq;\nusing Org.BouncyCastle.Asn1.X9;\nusing Org.BouncyCastle.Security;\nusing Portable.Licensing.Security.Cryptography;\n\nnamespace Portable.Licensing\n{\n    /// <summary>\n    /// A software license\n    /// </summary>\n    public class License\n    {\n        private readonly XElement xmlData;\n        private readonly string signatureAlgorithm = X9ObjectIdentifiers.ECDsaWithSha512.Id;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"License\"/> class.\n        /// </summary>\n        internal License()\n        {\n            xmlData = new XElement(\"License\");\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"License\"/> class\n        /// with the specified content.\n        /// </summary>\n        /// <remarks>This constructor is only used for loading from XML.</remarks>\n        /// <param name=\"xmlData\">The initial content of this <see cref=\"License\"/>.</param>\n        internal License(XElement xmlData)\n        {\n            this.xmlData = xmlData;\n        }\n\n        /// <summary>\n        /// Gets or sets the unique identifier of this <see cref=\"License\"/>.\n        /// </summary>\n        public Guid Id\n        {\n            get { return new Guid(GetTag(\"Id\") ?? Guid.Empty.ToString()); }\n            set { if (!IsSigned) SetTag(\"Id\", value.ToString()); }\n        }\n\n        /// <summary>\n        /// Gets or set the <see cref=\"LicenseType\"/> or this <see cref=\"License\"/>.\n        /// </summary>\n        public LicenseType Type\n        {\n            get\n            {\n                return\n                    (LicenseType)\n                    Enum.Parse(typeof (LicenseType), GetTag(\"Type\") ?? LicenseType.Trial.ToString(), false);\n            }\n            set { if (!IsSigned) SetTag(\"Type\", value.ToString()); }\n        }\n\n        /// <summary>\n        /// Get or sets the quantity of this license.\n        /// E.g. the count of per-developer-licenses.\n        /// </summary>\n        public int Quantity\n        {\n            get { return int.Parse(GetTag(\"Quantity\") ?? \"0\"); }\n            set { if (!IsSigned) SetTag(\"Quantity\", value.ToString()); }\n        }\n\n        /// <summary>\n        /// Gets or sets the product features of this <see cref=\"License\"/>.\n        /// </summary>\n        public LicenseAttributes ProductFeatures\n        {\n            get\n            {\n                var xmlElement = xmlData.Element(\"ProductFeatures\");\n\n                if (!IsSigned && xmlElement == null)\n                {\n                    xmlData.Add(new XElement(\"ProductFeatures\"));\n                    xmlElement = xmlData.Element(\"ProductFeatures\");\n                }\n                else if (IsSigned && xmlElement == null)\n                {\n                    return null;\n                }\n\n                return new LicenseAttributes(xmlElement, \"Feature\");\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"Customer\"/> of this <see cref=\"License\"/>.\n        /// </summary>\n        public Customer Customer\n        {\n            get\n            {\n                var xmlElement = xmlData.Element(\"Customer\");\n\n                if (!IsSigned && xmlElement == null)\n                {\n                    xmlData.Add(new XElement(\"Customer\"));\n                    xmlElement = xmlData.Element(\"Customer\");\n                }\n                else if (IsSigned && xmlElement == null)\n                {\n                    return null;\n                }\n\n                return new Customer(xmlElement);\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the additional attributes of this <see cref=\"License\"/>.\n        /// </summary>\n        public LicenseAttributes AdditionalAttributes\n        {\n            get\n            {\n                var xmlElement = xmlData.Element(\"LicenseAttributes\");\n\n                if (!IsSigned && xmlElement == null)\n                {\n                    xmlData.Add(new XElement(\"LicenseAttributes\"));\n                    xmlElement = xmlData.Element(\"LicenseAttributes\");\n                }\n                else if (IsSigned && xmlElement == null)\n                {\n                    return null;\n                }\n                \n                return new LicenseAttributes(xmlElement, \"Attribute\");\n            }\n        }\n\n        /// <summary>\n        /// Gets or sets the expiration date of this <see cref=\"License\"/>.\n        /// Use this property to set the expiration date for a trial license\n        /// or the expiration of support & subscription updates for a standard license.\n        /// </summary>\n        public DateTime Expiration\n        {\n            get\n            {\n                return\n                    DateTime.ParseExact(\n                        GetTag(\"Expiration\") ??\n                        DateTime.MaxValue.ToUniversalTime().ToString(\"r\", CultureInfo.InvariantCulture)\n                        , \"r\", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal);\n            }\n            set { if (!IsSigned) SetTag(\"Expiration\", value.ToUniversalTime().ToString(\"r\", CultureInfo.InvariantCulture)); }\n        }\n\n        /// <summary>\n        /// Gets the digital signature of this license.\n        /// </summary>\n        /// <remarks>Use the <see cref=\"License.Sign\"/> method to compute a signature.</remarks>\n        public string Signature\n        {\n            get { return GetTag(\"Signature\"); }\n        }\n\n        /// <summary>\n        /// Compute a signature and sign this <see cref=\"License\"/> with the provided key.\n        /// </summary>\n        /// <param name=\"privateKey\">The private key in xml string format to compute the signature.</param>\n        /// <param name=\"passPhrase\">The pass phrase to decrypt the private key.</param>\n        public void Sign(string privateKey, string passPhrase)\n        {\n            var signTag = xmlData.Element(\"Signature\") ?? new XElement(\"Signature\");\n\n            try\n            {\n                if (signTag.Parent != null)\n                    signTag.Remove();\n\n                var privKey = KeyFactory.FromEncryptedPrivateKeyString(privateKey, passPhrase);\n\n                var documentToSign = Encoding.UTF8.GetBytes(xmlData.ToString(SaveOptions.DisableFormatting));\n                var signer = SignerUtilities.GetSigner(signatureAlgorithm);\n                signer.Init(true, privKey);\n                signer.BlockUpdate(documentToSign, 0, documentToSign.Length);\n                var signature = signer.GenerateSignature();\n                signTag.Value = Convert.ToBase64String(signature);\n            }\n            finally\n            {\n                xmlData.Add(signTag);\n            }\n        }\n\n        /// <summary>\n        /// Determines whether the <see cref=\"License.Signature\"/> property verifies for the specified key.\n        /// </summary>\n        /// <param name=\"publicKey\">The public key in xml string format to verify the <see cref=\"License.Signature\"/>.</param>\n        /// <returns>true if the <see cref=\"License.Signature\"/> verifies; otherwise false.</returns>\n        public bool VerifySignature(string publicKey)\n        {\n            var signTag = xmlData.Element(\"Signature\");\n\n            if (signTag == null)\n                return false;\n\n            try\n            {\n                signTag.Remove();\n\n                var pubKey = KeyFactory.FromPublicKeyString(publicKey);\n\n                var documentToSign = Encoding.UTF8.GetBytes(xmlData.ToString(SaveOptions.DisableFormatting));\n                var signer = SignerUtilities.GetSigner(signatureAlgorithm);\n                signer.Init(false, pubKey);\n                signer.BlockUpdate(documentToSign, 0, documentToSign.Length);\n\n                return signer.VerifySignature(Convert.FromBase64String(signTag.Value));\n            }\n            finally\n            {\n                xmlData.Add(signTag);\n            }\n        }\n\n        /// <summary>\n        /// Create a new <see cref=\"License\"/> using the <see cref=\"ILicenseBuilder\"/>\n        /// fluent api.\n        /// </summary>\n        /// <returns>An instance of the <see cref=\"ILicenseBuilder\"/> class.</returns>\n        public static ILicenseBuilder New()\n        {\n            return new LicenseBuilder();\n        }\n\n        /// <summary>\n        /// Loads a <see cref=\"License\"/> from a string that contains XML.\n        /// </summary>\n        /// <param name=\"xmlString\">A <see cref=\"string\"/> that contains XML.</param>\n        /// <returns>A <see cref=\"License\"/> populated from the <see cref=\"string\"/> that contains XML.</returns>\n        public static License Load(string xmlString)\n        {\n            return new License(XElement.Parse(xmlString, LoadOptions.None));\n        }\n\n        /// <summary>\n        /// Loads a <see cref=\"License\"/> by using the specified <see cref=\"Stream\"/>\n        /// that contains the XML.\n        /// </summary>\n        /// <param name=\"stream\">A <see cref=\"Stream\"/> that contains the XML.</param>\n        /// <returns>A <see cref=\"License\"/> populated from the <see cref=\"Stream\"/> that contains XML.</returns>\n        public static License Load(Stream stream)\n        {\n            return new License(XElement.Load(stream, LoadOptions.None));\n        }\n\n        /// <summary>\n        /// Loads a <see cref=\"License\"/> by using the specified <see cref=\"TextReader\"/>\n        /// that contains the XML.\n        /// </summary>\n        /// <param name=\"reader\">A <see cref=\"TextReader\"/> that contains the XML.</param>\n        /// <returns>A <see cref=\"License\"/> populated from the <see cref=\"TextReader\"/> that contains XML.</returns>\n        public static License Load(TextReader reader)\n        {\n            return new License(XElement.Load(reader, LoadOptions.None));\n        }\n\n        /// <summary>\n        /// Loads a <see cref=\"License\"/> by using the specified <see cref=\"XmlReader\"/>\n        /// that contains the XML.\n        /// </summary>\n        /// <param name=\"reader\">A <see cref=\"XmlReader\"/> that contains the XML.</param>\n        /// <returns>A <see cref=\"License\"/> populated from the <see cref=\"TextReader\"/> that contains XML.</returns>\n        public static License Load(XmlReader reader)\n        {\n            return new License(XElement.Load(reader, LoadOptions.None));\n        }\n\n        /// <summary>\n        /// Serialize this <see cref=\"License\"/> to a <see cref=\"Stream\"/>.\n        /// </summary>\n        /// <param name=\"stream\">A <see cref=\"Stream\"/> that the \n        /// <see cref=\"License\"/> will be written to.</param>\n        public void Save(Stream stream)\n        {\n            xmlData.Save(stream);\n        }\n        \n        /// <summary>\n        /// Serialize this <see cref=\"License\"/> to a <see cref=\"TextWriter\"/>.\n        /// </summary>\n        /// <param name=\"textWriter\">A <see cref=\"TextWriter\"/> that the \n        /// <see cref=\"License\"/> will be written to.</param>\n        public void Save(TextWriter textWriter)\n        {\n            xmlData.Save(textWriter);\n        }\n\n        /// <summary>\n        /// Serialize this <see cref=\"License\"/> to a <see cref=\"XmlWriter\"/>.\n        /// </summary>\n        /// <param name=\"xmlWriter\">A <see cref=\"XmlWriter\"/> that the \n        /// <see cref=\"License\"/> will be written to.</param>\n        public void Save(XmlWriter xmlWriter)\n        {\n            xmlData.Save(xmlWriter);\n        }\n\n        /// <summary>\n        /// Returns the indented XML for this <see cref=\"License\"/>.\n        /// </summary>\n        /// <returns>A string containing the indented XML.</returns>\n        public override string ToString()\n        {\n            return xmlData.ToString();\n        }\n\n        /// <summary>\n        /// Gets a value indicating whether this <see cref=\"License\"/> is already signed.\n        /// </summary>\n        private bool IsSigned\n        {\n            get { return (!string.IsNullOrEmpty(Signature)); }\n        }\n\n        private void SetTag(string name, string value)\n        {\n            var element = xmlData.Element(name);\n\n            if (element == null)\n            {\n                element = new XElement(name);\n                xmlData.Add(element);\n            }\n\n            if (value != null)\n                element.Value = value;\n        }\n\n        private string GetTag(string name)\n        {\n            var element = xmlData.Element(name);\n            return element != null ? element.Value : null;\n        }\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/LicenseAttributes.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Xml.Linq;\n\nnamespace Portable.Licensing\n{\n    /// <summary>\n    /// Represents a dictionary of license attributes.\n    /// </summary>\n    public class LicenseAttributes\n    {\n        protected readonly XElement xmlData;\n        protected readonly XName childName;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LicenseAttributes\"/> class.\n        /// </summary>\n        internal LicenseAttributes(XElement xmlData, XName childName)\n        {\n            this.xmlData = xmlData ?? new XElement(\"null\");\n            this.childName = childName;\n        }\n\n        /// <summary>\n        /// Adds a new element with the specified key and value\n        /// to the collection.\n        /// </summary>\n        /// <param name=\"key\">The key of the element.</param>\n        /// <param name=\"value\">The value of the element.</param>\n        public virtual void Add(string key, string value)\n        {\n            SetChildTag(key, value);\n        }\n\n        /// <summary>\n        /// Adds all new element into the collection.\n        /// </summary>\n        /// <param name=\"features\">The dictionary of elements.</param>\n        public virtual void AddAll(IDictionary<string, string> features)\n        {\n            foreach (var feature in features)\n                Add(feature.Key, feature.Value);\n        }\n\n        /// <summary>\n        /// Removes a element with the specified key\n        /// from the collection.\n        /// </summary>\n        /// <param name=\"key\">The key of the element.</param>\n        public virtual void Remove(string key)\n        {\n            var element =\n                xmlData.Elements(childName)\n                    .FirstOrDefault(e => e.Attribute(\"name\") != null && e.Attribute(\"name\").Value == key);\n\n            if (element != null)\n                element.Remove();\n        }\n\n        /// <summary>\n        /// Removes all elements from the collection.\n        /// </summary>\n        public virtual void RemoveAll()\n        {\n            xmlData.RemoveAll();\n        }\n\n        /// <summary>\n        /// Gets the value of a element with the\n        /// specified key.\n        /// </summary>\n        /// <param name=\"key\">The key of the element.</param>\n        /// <returns>The value of the element if available; otherwise null.</returns>\n        public virtual string Get(string key)\n        {\n            return GetChildTag(key);\n        }\n\n        /// <summary>\n        /// Gets all elements.\n        /// </summary>\n        /// <returns>A dictionary of all elements in this collection.</returns>\n        public virtual IDictionary<string, string> GetAll()\n        {\n            return xmlData.Elements(childName).ToDictionary(e => e.Attribute(\"name\").Value, e => e.Value);\n        }\n\n        /// <summary>\n        /// Determines whether the specified element is in\n        /// this collection.\n        /// </summary>\n        /// <param name=\"key\">The key of the element.</param>\n        /// <returns>true if the collection contains this element; otherwise false.</returns>\n        public virtual bool Contains(string key)\n        {\n            return xmlData.Elements(childName).Any(e => e.Attribute(\"name\") != null && e.Attribute(\"name\").Value == key);\n        }\n\n        /// <summary>\n        /// Determines whether all specified elements are in\n        /// this collection.\n        /// </summary>\n        /// <param name=\"keys\">The list of keys of the elements.</param>\n        /// <returns>true if the collection contains all specified elements; otherwise false.</returns>\n        public virtual bool ContainsAll(string[] keys)\n        {\n            return xmlData.Elements(childName).All(e => e.Attribute(\"name\") != null && keys.Contains(e.Attribute(\"name\").Value));\n        }\n\n        protected virtual void SetTag(string name, string value)\n        {\n            var element = xmlData.Element(name);\n\n            if (element == null)\n            {\n                element = new XElement(name);\n                xmlData.Add(element);\n            }\n\n            if (value != null)\n                element.Value = value;\n        }\n\n        protected virtual void SetChildTag(string name, string value)\n        {\n            var element =\n                xmlData.Elements(childName)\n                    .FirstOrDefault(e => e.Attribute(\"name\") != null && e.Attribute(\"name\").Value == name);\n\n            if (element == null)\n            {\n                element = new XElement(childName);\n                element.Add(new XAttribute(\"name\", name));\n                xmlData.Add(element);\n            }\n\n            if (value != null)\n                element.Value = value;\n        }\n\n        protected virtual string GetTag(string name)\n        {\n            var element = xmlData.Element(name);\n            return element != null ? element.Value : null;\n        }\n\n        protected virtual string GetChildTag(string name)\n        {\n            var element =\n                xmlData.Elements(childName)\n                    .FirstOrDefault(e => e.Attribute(\"name\") != null && e.Attribute(\"name\").Value == name);\n\n            return element != null ? element.Value : null;\n        }\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/LicenseBuilder.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace Portable.Licensing\n{\n    /// <summary>\n    /// Implementation of the <see cref=\"ILicenseBuilder\"/>, a fluent api\n    /// to create new licenses.\n    /// </summary>\n    internal class LicenseBuilder : ILicenseBuilder\n    {\n        private readonly License license;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"LicenseBuilder\"/> class.\n        /// </summary>\n        public LicenseBuilder()\n        {\n            license = new License();\n        }\n\n        /// <summary>\n        /// Sets the unique identifier of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"id\">The unique identifier of the <see cref=\"License\"/>.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        public ILicenseBuilder WithUniqueIdentifier(Guid id)\n        {\n            license.Id = id;\n            return this;\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"LicenseType\"/> of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"type\">The <see cref=\"LicenseType\"/> of the <see cref=\"License\"/>.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        public ILicenseBuilder As(LicenseType type)\n        {\n            license.Type = type;\n            return this;\n        }\n\n        /// <summary>\n        /// Sets the expiration date of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"date\">The expiration date of the <see cref=\"License\"/>.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        public ILicenseBuilder ExpiresAt(DateTime date)\n        {\n            license.Expiration = date.ToUniversalTime();\n            return this;\n        }\n\n        /// <summary>\n        /// Sets the maximum utilization of the <see cref=\"License\"/>.\n        /// This can be the quantity of developers for a \"per-developer-license\".\n        /// </summary>\n        /// <param name=\"utilization\">The maximum utilization of the <see cref=\"License\"/>.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        public ILicenseBuilder WithMaximumUtilization(int utilization)\n        {\n            license.Quantity = utilization;\n            return this;\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"Customer\">license holder</see> of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"name\">The name of the license holder.</param>\n        /// <param name=\"email\">The email of the license holder.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        public ILicenseBuilder LicensedTo(string name, string email)\n        {\n            license.Customer.Name = name;\n            license.Customer.Email = email;\n            return this;\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"Customer\">license holder</see> of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"name\">The name of the license holder.</param>\n        /// <param name=\"email\">The email of the license holder.</param>\n        /// <param name=\"configureCustomer\">A delegate to configure the license holder.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        public ILicenseBuilder LicensedTo(string name, string email, Action<Customer> configureCustomer)\n        {\n            license.Customer.Name = name;\n            license.Customer.Email = email;\n            configureCustomer(license.Customer);\n            return this;\n        }\n\n        /// <summary>\n        /// Sets the <see cref=\"Customer\">license holder</see> of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"configureCustomer\">A delegate to configure the license holder.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        public ILicenseBuilder LicensedTo(Action<Customer> configureCustomer)\n        {\n            configureCustomer(license.Customer);\n            return this;\n        }\n\n        /// <summary>\n        /// Sets the licensed product features of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"productFeatures\">The licensed product features of the <see cref=\"License\"/>.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        public ILicenseBuilder WithProductFeatures(IDictionary<string, string> productFeatures)\n        {\n            license.ProductFeatures.AddAll(productFeatures);\n            return this;\n        }\n\n        /// <summary>\n        /// Sets the licensed product features of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"configureProductFeatures\">A delegate to configure the product features.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        public ILicenseBuilder WithProductFeatures(Action<LicenseAttributes> configureProductFeatures)\n        {\n            configureProductFeatures(license.ProductFeatures);\n            return this;\n        }\n\n        /// <summary>\n        /// Sets the licensed additional attributes of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"additionalAttributes\">The additional attributes of the <see cref=\"License\"/>.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        public ILicenseBuilder WithAdditionalAttributes(IDictionary<string, string> additionalAttributes)\n        {\n            license.AdditionalAttributes.AddAll(additionalAttributes);\n            return this;\n        }\n\n        /// <summary>\n        /// Sets the licensed additional attributes of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"configureAdditionalAttributes\">A delegate to configure the additional attributes.</param>\n        /// <returns>The <see cref=\"ILicenseBuilder\"/>.</returns>\n        public ILicenseBuilder WithAdditionalAttributes(Action<LicenseAttributes> configureAdditionalAttributes)\n        {\n            configureAdditionalAttributes(license.AdditionalAttributes);\n            return this;\n        }\n\n        /// <summary>\n        /// Create and sign a new <see cref=\"License\"/> with the specified\n        /// private encryption key.\n        /// </summary>\n        /// <param name=\"privateKey\">The private encryption key for the signature.</param>\n        /// <param name=\"passPhrase\">The pass phrase to decrypt the private key.</param>\n        /// <returns>The signed <see cref=\"License\"/>.</returns>\n        public License CreateAndSignWithPrivateKey(string privateKey, string passPhrase)\n        {\n            license.Sign(privateKey, passPhrase);\n            return license;\n        }\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/LicenseType.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nnamespace Portable.Licensing\n{\n    /// <summary>\n    /// Defines the type of a <see cref=\"License\"/>\n    /// </summary>\n    public enum LicenseType\n    {\n        /// <summary>\n        /// For trial or demo use\n        /// </summary>\n        Trial = 1,\n\n        /// <summary>\n        /// Standard license\n        /// </summary>\n        Standard = 2\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/Portable.Licensing.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <MinimumVisualStudioVersion>10.0</MinimumVisualStudioVersion>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{6D2B800C-C252-4A33-BA05-904AE5B79417}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Portable.Licensing</RootNamespace>\n    <AssemblyName>Portable.Licensing</AssemblyName>\n    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>\n    <TargetFrameworkProfile>Profile147</TargetFrameworkProfile>\n    <FileAlignment>512</FileAlignment>\n    <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>..\\..\\Build\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>..\\..\\Build\\Portable.Licensing.XML</DocumentationFile>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>..\\..\\Build\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <DocumentationFile>..\\..\\Build\\Portable.Licensing.XML</DocumentationFile>\n  </PropertyGroup>\n  <ItemGroup>\n    <!-- A reference to the entire .NET Framework is automatically included -->\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\CommonAssemblyInfo.cs\">\n      <Link>Properties\\CommonAssemblyInfo.cs</Link>\n    </Compile>\n    <Compile Include=\"AssemblyBuildDateAttribute.cs\" />\n    <Compile Include=\"Customer.cs\" />\n    <Compile Include=\"IFluentInterface.cs\" />\n    <Compile Include=\"ILicenseBuilder.cs\" />\n    <Compile Include=\"License.cs\" />\n    <Compile Include=\"LicenseAttributes.cs\" />\n    <Compile Include=\"LicenseBuilder.cs\" />\n    <Compile Include=\"LicenseType.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Security\\Cryptography\\KeyFactory.cs\" />\n    <Compile Include=\"Security\\Cryptography\\KeyGenerator.cs\" />\n    <Compile Include=\"Security\\Cryptography\\KeyPair.cs\" />\n    <Compile Include=\"Validation\\GeneralValidationFailure.cs\" />\n    <Compile Include=\"Validation\\IAddAdditionalValidationChain.cs\" />\n    <Compile Include=\"Validation\\IAssertValidation.cs\" />\n    <Compile Include=\"Validation\\ICompleteValidationChain.cs\" />\n    <Compile Include=\"Validation\\ILicenseValidator.cs\" />\n    <Compile Include=\"Validation\\InvalidSignatureValidationFailure.cs\" />\n    <Compile Include=\"Validation\\IStartValidationChain.cs\" />\n    <Compile Include=\"Validation\\IValidationChain.cs\" />\n    <Compile Include=\"Validation\\IValidationChainCondition.cs\" />\n    <Compile Include=\"Validation\\IValidationFailure.cs\" />\n    <Compile Include=\"Validation\\LicenseExpiredValidationFailure.cs\" />\n    <Compile Include=\"Validation\\LicenseValidationExtensions.cs\" />\n    <Compile Include=\"Validation\\LicenseValidator.cs\" />\n    <Compile Include=\"Validation\\ValidationChainBuilder.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Reference Include=\"BouncyCastle.Crypto\">\n      <HintPath>..\\..\\lib\\BouncyCastle.Crypto.dll</HintPath>\n    </Reference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\Portable\\$(TargetFrameworkVersion)\\Microsoft.Portable.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <Import Project=\"..\\..\\.paket\\paket.targets\" />\n</Project>"
  },
  {
    "path": "src/Portable.Licensing/Properties/AssemblyInfo.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Resources;\nusing System.Reflection;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"Portable.Licensing\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCulture(\"\")]\n[assembly: NeutralResourcesLanguage(\"en\")]\n\n[assembly: CLSCompliant(true)]"
  },
  {
    "path": "src/Portable.Licensing/Security/Cryptography/KeyFactory.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing Org.BouncyCastle.Asn1.Pkcs;\nusing Org.BouncyCastle.Crypto;\nusing Org.BouncyCastle.Security;\nusing Org.BouncyCastle.X509;\n\nnamespace Portable.Licensing.Security.Cryptography\n{\n    internal static class KeyFactory\n    {\n        private static readonly string keyEncryptionAlgorithm = PkcsObjectIdentifiers.PbeWithShaAnd3KeyTripleDesCbc.Id;\n\n        /// <summary>\n        /// Encrypts and encodes the private key.\n        /// </summary>\n        /// <param name=\"key\">The private key.</param>\n        /// <param name=\"passPhrase\">The pass phrase to encrypt the private key.</param>\n        /// <returns>The encrypted private key.</returns>\n        public static string ToEncryptedPrivateKeyString(AsymmetricKeyParameter key, string passPhrase)\n        {\n            var salt = new byte[16];\n            var secureRandom = SecureRandom.GetInstance(\"SHA256PRNG\");\n            secureRandom.SetSeed(SecureRandom.GetSeed(16)); //See Bug #135\n            secureRandom.NextBytes(salt);\n\n            return\n                Convert.ToBase64String(PrivateKeyFactory.EncryptKey(keyEncryptionAlgorithm, passPhrase.ToCharArray(),\n                                                                    salt, 10, key));\n        }\n\n        /// <summary>\n        /// Decrypts the provided private key.\n        /// </summary>\n        /// <param name=\"privateKey\">The encrypted private key.</param>\n        /// <param name=\"passPhrase\">The pass phrase to decrypt the private key.</param>\n        /// <returns>The private key.</returns>\n        public static AsymmetricKeyParameter FromEncryptedPrivateKeyString(string privateKey, string passPhrase)\n        {\n            return PrivateKeyFactory.DecryptKey(passPhrase.ToCharArray(), Convert.FromBase64String(privateKey));\n        }\n\n        /// <summary>\n        /// Encodes the public key into DER encoding.\n        /// </summary>\n        /// <param name=\"key\">The public key.</param>\n        /// <returns>The encoded public key.</returns>\n        public static string ToPublicKeyString(AsymmetricKeyParameter key)\n        {\n            return\n                Convert.ToBase64String(\n                    SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(key)\n                                               .ToAsn1Object()\n                                               .GetDerEncoded());\n        }\n\n        /// <summary>\n        /// Decoded the public key from DER encoding.\n        /// </summary>\n        /// <param name=\"publicKey\">The encoded public key.</param>\n        /// <returns>The public key.</returns>\n        public static AsymmetricKeyParameter FromPublicKeyString(string publicKey)\n        {\n            return PublicKeyFactory.CreateKey(Convert.FromBase64String(publicKey));\n        }\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/Security/Cryptography/KeyGenerator.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing Org.BouncyCastle.Crypto;\nusing Org.BouncyCastle.Crypto.Generators;\nusing Org.BouncyCastle.Security;\n\nnamespace Portable.Licensing.Security.Cryptography\n{\n    /// <summary>\n    /// Represents a generator for signature keys of <see cref=\"License\"/>.\n    /// </summary>\n    public class KeyGenerator\n    {\n        private readonly IAsymmetricCipherKeyPairGenerator keyGenerator;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"KeyGenerator\"/> class\n        /// with a key size of 256 bits.\n        /// </summary>\n        public KeyGenerator()\n            : this(256)\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"KeyGenerator\"/> class\n        /// with the specified key size.\n        /// </summary>\n        /// <remarks>Following key sizes are supported:\n        /// - 192\n        /// - 224\n        /// - 239\n        /// - 256 (default)\n        /// - 384\n        /// - 521</remarks>\n        /// <param name=\"keySize\">The key size.</param>\n        public KeyGenerator(int keySize)\n            : this(keySize, SecureRandom.GetSeed(32))\n        {\n        }\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"KeyGenerator\"/> class\n        /// with the specified key size and seed.\n        /// </summary>\n        /// <remarks>Following key sizes are supported:\n        /// - 192\n        /// - 224\n        /// - 239\n        /// - 256 (default)\n        /// - 384\n        /// - 521</remarks>\n        /// <param name=\"keySize\">The key size.</param>\n        /// <param name=\"seed\">The seed.</param>\n        public KeyGenerator(int keySize, byte[] seed)\n        {\n            var secureRandom = SecureRandom.GetInstance(\"SHA256PRNG\");\n            secureRandom.SetSeed(seed);\n\n            var keyParams = new KeyGenerationParameters(secureRandom, keySize);\n            keyGenerator = new ECKeyPairGenerator();\n            keyGenerator.Init(keyParams);\n        }\n\n        /// <summary>\n        /// Creates a new instance of the <see cref=\"KeyGenerator\"/> class.\n        /// </summary>\n        public static KeyGenerator Create()\n        {\n            return new KeyGenerator();\n        }\n\n        /// <summary>\n        /// Generates a private/public key pair for license signing.\n        /// </summary>\n        /// <returns>An <see cref=\"KeyPair\"/> containing the keys.</returns>\n        public KeyPair GenerateKeyPair()\n        {\n            return new KeyPair(keyGenerator.GenerateKeyPair());\n        }\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/Security/Cryptography/KeyPair.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing Org.BouncyCastle.Crypto;\n\nnamespace Portable.Licensing.Security.Cryptography\n{\n    /// <summary>\n    /// Represents a private/public encryption key pair.\n    /// </summary>\n    public class KeyPair\n    {\n        private readonly AsymmetricCipherKeyPair keyPair;\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"KeyPair\"/> class\n        /// with the provided asymmetric key pair.\n        /// </summary>\n        /// <param name=\"keyPair\"></param>\n        internal KeyPair(AsymmetricCipherKeyPair keyPair)\n        {\n            this.keyPair = keyPair;\n\n        }\n\n        /// <summary>\n        /// Gets the encrypted and DER encoded private key.\n        /// </summary>\n        /// <param name=\"passPhrase\">The pass phrase to encrypt the private key.</param>\n        /// <returns>The encrypted private key.</returns>\n        public string ToEncryptedPrivateKeyString(string passPhrase)\n        {\n            return KeyFactory.ToEncryptedPrivateKeyString(keyPair.Private, passPhrase);\n        }\n\n        /// <summary>\n        /// Gets the DER encoded public key.\n        /// </summary>\n        /// <returns>The public key.</returns>\n        public string ToPublicKeyString()\n        {\n            return KeyFactory.ToPublicKeyString(keyPair.Public);\n        }\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/Validation/GeneralValidationFailure.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nnamespace Portable.Licensing.Validation\n{\n    /// <summary>\n    /// Represents a general validation failure.\n    /// </summary>\n    public class GeneralValidationFailure : IValidationFailure\n    {\n        /// <summary>\n        /// Gets or sets a message that describes the validation failure.\n        /// </summary>\n        public string Message { get; set; }\n\n        /// <summary>\n        /// Gets or sets a message that describes how to recover from the validation failure.\n        /// </summary>\n        public string HowToResolve { get; set; }\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/Validation/IAddAdditionalValidationChain.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nnamespace Portable.Licensing.Validation\n{\n    /// <summary>\n    /// Interface for the fluent validation syntax.\n    /// </summary>\n    public interface IAddAdditionalValidationChain : IFluentInterface\n    {\n        /// <summary>\n        /// Adds an additional validation chain.\n        /// </summary>\n        /// <returns>An instance of <see cref=\"IStartValidationChain\"/>.</returns>\n        IStartValidationChain And();\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/Validation/IAssertValidation.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System.Collections.Generic;\n\nnamespace Portable.Licensing.Validation\n{\n    /// <summary>\n    /// Interface for the fluent validation syntax.\n    /// </summary>\n    public interface IAssertValidation : IFluentInterface\n    {\n        /// <summary>\n        /// Invokes the license assertion.\n        /// </summary>\n        /// <returns>An array is <see cref=\"IValidationFailure\"/> when the validation fails.</returns>\n        IEnumerable<IValidationFailure> AssertValidLicense();\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/Validation/ICompleteValidationChain.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nnamespace Portable.Licensing.Validation\n{\n    /// <summary>\n    /// Interface for the fluent validation syntax.\n    /// This interface is used to complete a validation chain.\n    /// </summary>\n    public interface ICompleteValidationChain : IAddAdditionalValidationChain, IAssertValidation\n    {\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/Validation/ILicenseValidator.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace Portable.Licensing.Validation\n{\n    /// <summary>\n    /// Represents a <see cref=\"License\"/> validator.\n    /// </summary>\n    public interface ILicenseValidator\n    {\n        /// <summary>\n        /// Gets or sets the predicate to determine if the <see cref=\"License\"/>\n        /// is valid.\n        /// </summary>\n        Predicate<License> Validate { get; set; }\n\n        /// <summary>\n        /// Gets or sets the predicate to determine if the <see cref=\"ILicenseValidator\"/>\n        /// should be executed.\n        /// </summary>\n        Predicate<License> ValidateWhen { get; set; }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"IValidationFailure\"/> result. The <see cref=\"IValidationFailure\"/>\n        /// will be returned to the application when the <see cref=\"ILicenseValidator\"/> fails.\n        /// </summary>\n        IValidationFailure FailureResult { get; set; }\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/Validation/IStartValidationChain.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nnamespace Portable.Licensing.Validation\n{\n    /// <summary>\n    /// Interface for the fluent validation syntax.\n    /// Validators should use this interface to start a new validation chain.\n    /// </summary>\n    public interface IStartValidationChain : IFluentInterface\n    {\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/Validation/IValidationChain.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nnamespace Portable.Licensing.Validation\n{\n    /// <summary>\n    /// Interface for the fluent validation syntax.\n    /// This interface is used to add a condition or to complete a validation chain.\n    /// </summary>\n    public interface IValidationChain : IValidationChainCondition, ICompleteValidationChain\n    {\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/Validation/IValidationChainCondition.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace Portable.Licensing.Validation\n{\n    /// <summary>\n    /// Interface for the fluent validation syntax.\n    /// </summary>\n    public interface IValidationChainCondition : IFluentInterface\n    {\n        /// <summary>\n        /// Adds a when predicate to the current validator.\n        /// </summary>\n        /// <param name=\"predicate\">The predicate that defines the conditions.</param>\n        /// <returns>An instance of <see cref=\"ICompleteValidationChain\"/>.</returns>\n        ICompleteValidationChain When(Predicate<License> predicate);\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/Validation/IValidationFailure.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nnamespace Portable.Licensing.Validation\n{\n    /// <summary>\n    /// Represents a failure of a <see cref=\"ILicenseValidator\"/>.\n    /// </summary>\n    public interface IValidationFailure\n    {\n        /// <summary>\n        /// Gets or sets a message that describes the validation failure.\n        /// </summary>\n        string Message { get; set; }\n\n        /// <summary>\n        /// Gets or sets a message that describes how to recover from the validation failure.\n        /// </summary>\n        string HowToResolve { get; set; }\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/Validation/InvalidSignatureValidationFailure.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nnamespace Portable.Licensing.Validation\n{\n    /// <summary>\n    /// Represents a failure when the <see cref=\"License.Signature\"/> is invalid.\n    /// </summary>\n    public class InvalidSignatureValidationFailure : IValidationFailure\n    {\n        /// <summary>\n        /// Gets or sets a message that describes the validation failure.\n        /// </summary>\n        public string Message { get; set; }\n\n        /// <summary>\n        /// Gets or sets a message that describes how to recover from the validation failure.\n        /// </summary>\n        public string HowToResolve { get; set; }\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/Validation/LicenseExpiredValidationFailure.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nnamespace Portable.Licensing.Validation\n{\n    /// <summary>\n    /// Represents a <see cref=\"License\"/> expired failure of a <see cref=\"ILicenseValidator\"/>.\n    /// </summary>\n    public class LicenseExpiredValidationFailure : IValidationFailure\n    {\n        /// <summary>\n        /// Gets or sets a message that describes the validation failure.\n        /// </summary>\n        public string Message { get; set; }\n\n        /// <summary>\n        /// Gets or sets a message that describes how to recover from the validation failure.\n        /// </summary>\n        public string HowToResolve { get; set; }\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/Validation/LicenseValidationExtensions.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace Portable.Licensing.Validation\n{\n    /// <summary>\n    /// Extension methods for <see cref=\"License\"/> validation.\n    /// </summary>\n    public static class LicenseValidationExtensions\n    {\n        /// <summary>\n        /// Starts the validation chain of the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"license\">The <see cref=\"License\"/> to validate.</param>\n        /// <returns>An instance of <see cref=\"IStartValidationChain\"/>.</returns>\n        public static IStartValidationChain Validate(this License license)\n        {\n            return new ValidationChainBuilder(license);\n        }\n\n        /// <summary>\n        /// Validates if the license has been expired.\n        /// </summary>\n        /// <param name=\"validationChain\">The current <see cref=\"IStartValidationChain\"/>.</param>\n        /// <returns>An instance of <see cref=\"IStartValidationChain\"/>.</returns>\n        public static IValidationChain ExpirationDate(this IStartValidationChain validationChain)\n        {\n            var validationChainBuilder = (validationChain as ValidationChainBuilder);\n            var validator = validationChainBuilder.StartValidatorChain();\n            validator.Validate = license => license.Expiration > DateTime.Now;\n\n            validator.FailureResult = new LicenseExpiredValidationFailure()\n                                          {\n                                              Message = \"Licensing for this product has expired!\",\n                                              HowToResolve = @\"Your license is expired. Please contact your distributor/vendor to renew the license.\"\n                                          };\n\n            return validationChainBuilder;\n        }\n\n        /// <summary>\n        /// Check whether the product build date of the provided assemblies\n        /// exceeded the <see cref=\"License.Expiration\"/> date.\n        /// </summary>\n        /// <param name=\"validationChain\">The current <see cref=\"IStartValidationChain\"/>.</param>\n        /// <param name=\"assemblies\">The list of assemblies to check.</param>\n        /// <returns>An instance of <see cref=\"IStartValidationChain\"/>.</returns>\n        public static IValidationChain ProductBuildDate(this IStartValidationChain validationChain, Assembly[] assemblies)\n        {\n            var validationChainBuilder = (validationChain as ValidationChainBuilder);\n            var validator = validationChainBuilder.StartValidatorChain();\n            validator.Validate = license => assemblies.All(\n                    asm =>\n                    asm.GetCustomAttributes(typeof (AssemblyBuildDateAttribute), false)\n                       .Cast<AssemblyBuildDateAttribute>()\n                       .All(a => a.BuildDate < license.Expiration));\n\n            validator.FailureResult = new LicenseExpiredValidationFailure()\n                                          {\n                                              Message = \"Licensing for this product has expired!\",\n                                              HowToResolve = @\"Your license is expired. Please contact your distributor/vendor to renew the license.\"\n                                          };\n\n            return validationChainBuilder;\n        }\n   \n        /// <summary>\n        /// Allows you to specify a custom assertion that validates the <see cref=\"License\"/>.\n        /// </summary>\n        /// <param name=\"validationChain\">The current <see cref=\"IStartValidationChain\"/>.</param>\n        /// <param name=\"predicate\">The predicate to determine of the <see cref=\"License\"/> is valid.</param>\n        /// <param name=\"failure\">The <see cref=\"IValidationFailure\"/> will be returned to the application when the <see cref=\"ILicenseValidator\"/> fails.</param>\n        /// <returns>An instance of <see cref=\"IStartValidationChain\"/>.</returns>\n        public static IValidationChain AssertThat(this IStartValidationChain validationChain, Predicate<License> predicate, IValidationFailure failure)\n        {\n            var validationChainBuilder = (validationChain as ValidationChainBuilder);\n            var validator = validationChainBuilder.StartValidatorChain();\n\n            validator.Validate = predicate;\n            validator.FailureResult = failure;\n\n            return validationChainBuilder;\n        }\n\n        /// <summary>\n        /// Validates the <see cref=\"License.Signature\"/>.\n        /// </summary>\n        /// <param name=\"validationChain\">The current <see cref=\"IStartValidationChain\"/>.</param>\n        /// <param name=\"publicKey\">The public product key to validate the signature..</param>\n        /// <returns>An instance of <see cref=\"IStartValidationChain\"/>.</returns>\n        public static IValidationChain Signature(this IStartValidationChain validationChain, string publicKey)\n        {\n            var validationChainBuilder = (validationChain as ValidationChainBuilder);\n            var validator = validationChainBuilder.StartValidatorChain();\n            validator.Validate = license => license.VerifySignature(publicKey);\n\n            validator.FailureResult = new InvalidSignatureValidationFailure()\n                                          {\n                                              Message = \"License signature validation error!\",\n                                              HowToResolve = @\"The license signature and data does not match. This usually happens when a license file is corrupted or has been altered.\"\n                                          };\n\n            return validationChainBuilder;\n        }\n    }\n}\n"
  },
  {
    "path": "src/Portable.Licensing/Validation/LicenseValidator.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System;\n\nnamespace Portable.Licensing.Validation\n{\n    /// <summary>\n    /// Represents a <see cref=\"License\"/> validator.\n    /// </summary>\n    internal class LicenseValidator : ILicenseValidator\n    {\n        /// <summary>\n        /// Gets or sets the predicate to determine if the <see cref=\"License\"/>\n        /// is valid.\n        /// </summary>\n        public Predicate<License> Validate { get; set; }\n\n        /// <summary>\n        /// Gets or sets the predicate to determine if the <see cref=\"ILicenseValidator\"/>\n        /// should be executed.\n        /// </summary>\n        public Predicate<License> ValidateWhen { get; set; }\n\n        /// <summary>\n        /// Gets or sets the <see cref=\"IValidationFailure\"/> result. The <see cref=\"IValidationFailure\"/>\n        /// will be returned to the application when the <see cref=\"ILicenseValidator\"/> fails.\n        /// </summary>\n        public IValidationFailure FailureResult { get; set; }\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing/Validation/ValidationChainBuilder.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\nnamespace Portable.Licensing.Validation\n{\n    internal class ValidationChainBuilder : IStartValidationChain, IValidationChain\n    {\n        private readonly Queue<ILicenseValidator> validators;\n        private ILicenseValidator currentValidatorChain;\n        private readonly License license;\n\n        public ValidationChainBuilder(License license)\n        {\n            this.license = license;\n            validators = new Queue<ILicenseValidator>();\n        }\n\n        public ILicenseValidator StartValidatorChain()\n        {\n            return currentValidatorChain = new LicenseValidator();\n        }\n\n        public void CompleteValidatorChain()\n        {\n            if (currentValidatorChain == null)\n                return;\n\n            validators.Enqueue(currentValidatorChain);\n            currentValidatorChain = null;\n        }\n\n        public ICompleteValidationChain When(Predicate<License> predicate)\n        {\n            currentValidatorChain.ValidateWhen = predicate;\n            return this;\n        }\n\n        public IStartValidationChain And()\n        {\n            CompleteValidatorChain();\n            return this;\n        }\n\n        public IEnumerable<IValidationFailure> AssertValidLicense()\n        {\n            CompleteValidatorChain();\n\n            while (validators.Count > 0)\n            {\n                var validator = validators.Dequeue();\n                if (validator.ValidateWhen != null && !validator.ValidateWhen(license))\n                    continue;\n\n                if (!validator.Validate(license))\n                    yield return validator.FailureResult\n                                 ?? new GeneralValidationFailure\n                                        {\n                                            Message = \"License validation failed!\"\n                                        };\n            }\n        }\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing.Tests/KeyGeneratorTests.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System.Collections.Generic;\nusing NUnit.Framework;\nusing Portable.Licensing.Security.Cryptography;\n\nnamespace Portable.Licensing.Tests\n{\n    [TestFixture]\n    public class KeyGeneratorTests\n    {\n        [Test] // See Bug #135\n        public void Ensure_To_Not_Generate_Identical_Keys()\n        {\n            var passPhrase = \"test\";\n            var privKeySet = new HashSet<string>();\n            var pubKeySet = new HashSet<string>();\n\n            // add well known key\n            privKeySet.Add(\n                \"MIICITAjBgoqhkiG9w0BDAEDMBUEEF5Fx1gxrWd+0G10a7+UbxQCAQoEggH4SUUim2C3kcHApCKVgIeXpKlZQHcaRgfWt0rVEWr8zRnzO9xT5itU2Sw7j0N3oh6cPer/QGNCmAgnRyiDatruJznDPOmMzK5Yskj6mlCaY6JEjcol+E4SBZJDgvIejy8HVCy+DOIR42JXs9oxgeq8eqB+0RZwvDMBG2hrUjnZ4/hPKRPJY134cqTH68jLv6SXglIPcrL9OxOwdzJBaq0ngSBfqhBWbLRIy/Th2btl9Q/0b+sZxG6r2b80wOxIewlr6EUqXtMaA8Bo5dgVZt1itWYafIAbLWzjZavwdO+EkUMCjZhsfvbXSCmcLRmitdJ6beG7jg7R6m6Q92DpU3qZhEio9akX3MQmOTO63Er4T2t6HHYnTzPaZPjdn8D+8lcTUntp/0vD8SvC3+Cb7tZOHSVGMUDdj7WIW+Bl/5bhdmnChE83HSxR4OsBjLATuZOpYtOefWbXyT8qsUn1IouaCjH+BYejBIPrmFVVl0WZADtbyE0LAOyHCD2quAjCpIwXXONG/gXm+XVGst5clbcuxaG4TxKWA8ifIXaio3aJgLfI+D0Izt2GscKRg6oGTlbC3YFIJg+PAH3A4qufoRSPmtREz0oR1X1ZsS6m/IKezf8vl3S+fSpmR/mUuc6uBx9qI9yJIEW/In90r5vO9fKGusEElP6svlub\");\n            pubKeySet.Add(\n                \"MIIBKjCB4wYHKoZIzj0CATCB1wIBATAsBgcqhkjOPQEBAiEA/////wAAAAEAAAAAAAAAAAAAAAD///////////////8wWwQg/////wAAAAEAAAAAAAAAAAAAAAD///////////////wEIFrGNdiqOpPns+u9VXaYhrxlHQawzFOw9jvOPD4n0mBLAxUAxJ02CIbnBJNqZnjhE50mt4GffpAEIQNrF9Hy4SxCR/i85uVjpEDydwN9gS3rM6D0oTlF2JjClgIhAP////8AAAAA//////////+85vqtpxeehPO5ysL8YyVRAgEBA0IABNVLQ1xKY80BFMgGXec++Vw7n8vvNrq32PaHuBiYMm0PEj2JoB7qSSWhfgcjxNVJsxqJ6gDQVWgl0r7LH4dr0KU=\");\n\n            for (int i = 0; i < 100; i++)\n            {\n                var keyGenerator = new KeyGenerator(256); //default key size\n                var pair = keyGenerator.GenerateKeyPair();\n                var privateKey = pair.ToEncryptedPrivateKeyString(passPhrase);\n                var publicKey = pair.ToPublicKeyString();\n\n                Assert.That(privKeySet.Add(privateKey), Is.True);\n                Assert.That(pubKeySet.Add(publicKey), Is.True);\n            }\n\n            privKeySet.Clear();\n            pubKeySet.Clear();\n        }\n    }\n}\n"
  },
  {
    "path": "src/Portable.Licensing.Tests/LicenseSignatureTests.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Xml.Linq;\nusing NUnit.Framework;\n\nnamespace Portable.Licensing.Tests\n{\n    [TestFixture]\n    public class LicenseSignatureTests\n    {\n        private string passPhrase;\n        private string privateKey;\n        private string publicKey;\n\n        [SetUp]\n        public void Init()\n        {\n            passPhrase = Guid.NewGuid().ToString();\n            var keyGenerator = Security.Cryptography.KeyGenerator.Create();\n            var keyPair = keyGenerator.GenerateKeyPair();\n            privateKey = keyPair.ToEncryptedPrivateKeyString(passPhrase);\n            publicKey = keyPair.ToPublicKeyString();\n        }\n\n        private static DateTime ConvertToRfc1123(DateTime dateTime)\n        {\n            return DateTime.ParseExact(\n                dateTime.ToUniversalTime().ToString(\"r\", CultureInfo.InvariantCulture)\n                , \"r\", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal);\n        }\n\n        [Test]\n        public void Can_Generate_And_Validate_Signature_With_Empty_License()\n        {\n            var license = License.New()\n                                 .CreateAndSignWithPrivateKey(privateKey, passPhrase);\n\n            Assert.That(license, Is.Not.Null);\n            Assert.That(license.Signature, Is.Not.Null);\n\n            // validate xml\n            var xmlElement = XElement.Parse(license.ToString(), LoadOptions.None);\n            Assert.That(xmlElement.HasElements, Is.True);\n\n            // validate default values when not set\n            Assert.That(license.Id, Is.EqualTo(Guid.Empty));\n            Assert.That(license.Type, Is.EqualTo(LicenseType.Trial));\n            Assert.That(license.Quantity, Is.EqualTo(0));\n            Assert.That(license.ProductFeatures, Is.Null);\n            Assert.That(license.Customer, Is.Null);\n            Assert.That(license.Expiration, Is.EqualTo(ConvertToRfc1123(DateTime.MaxValue)));\n\n            // verify signature\n            Assert.That(license.VerifySignature(publicKey), Is.True);\n        }\n\n        [Test]\n        public void Can_Generate_And_Validate_Signature_With_Standard_License()\n        {\n            var licenseId = Guid.NewGuid();\n            var customerName = \"Max Mustermann\";\n            var customerEmail = \"max@mustermann.tld\";\n            var expirationDate = DateTime.Now.AddYears(1);\n            var productFeatures = new Dictionary<string, string>\n                                      {\n                                          {\"Sales Module\", \"yes\"},\n                                          {\"Purchase Module\", \"yes\"},\n                                          {\"Maximum Transactions\", \"10000\"}\n                                      };\n\n            var license = License.New()\n                                 .WithUniqueIdentifier(licenseId)\n                                 .As(LicenseType.Standard)\n                                 .WithMaximumUtilization(10)\n                                 .WithProductFeatures(productFeatures)\n                                 .LicensedTo(customerName, customerEmail)\n                                 .ExpiresAt(expirationDate)\n                                 .CreateAndSignWithPrivateKey(privateKey, passPhrase);\n\n            Assert.That(license, Is.Not.Null);\n            Assert.That(license.Signature, Is.Not.Null);\n\n            // validate xml\n            var xmlElement = XElement.Parse(license.ToString(), LoadOptions.None);\n            Assert.That(xmlElement.HasElements, Is.True);\n\n            // validate default values when not set\n            Assert.That(license.Id, Is.EqualTo(licenseId));\n            Assert.That(license.Type, Is.EqualTo(LicenseType.Standard));\n            Assert.That(license.Quantity, Is.EqualTo(10));\n            Assert.That(license.ProductFeatures, Is.Not.Null);\n            Assert.That(license.ProductFeatures.GetAll(), Is.EquivalentTo(productFeatures));\n            Assert.That(license.Customer, Is.Not.Null);\n            Assert.That(license.Customer.Name, Is.EqualTo(customerName));\n            Assert.That(license.Customer.Email, Is.EqualTo(customerEmail));\n            Assert.That(license.Expiration, Is.EqualTo(ConvertToRfc1123(expirationDate)));\n\n            // verify signature\n            Assert.That(license.VerifySignature(publicKey), Is.True);\n        }\n\n        [Test]\n        public void Can_Detect_Hacked_License()\n        {\n            var licenseId = Guid.NewGuid();\n            var customerName = \"Max Mustermann\";\n            var customerEmail = \"max@mustermann.tld\";\n            var expirationDate = DateTime.Now.AddYears(1);\n            var productFeatures = new Dictionary<string, string>\n                                      {\n                                          {\"Sales Module\", \"yes\"},\n                                          {\"Purchase Module\", \"yes\"},\n                                          {\"Maximum Transactions\", \"10000\"}\n                                      };\n\n            var license = License.New()\n                                 .WithUniqueIdentifier(licenseId)\n                                 .As(LicenseType.Standard)\n                                 .WithMaximumUtilization(10)\n                                 .WithProductFeatures(productFeatures)\n                                 .LicensedTo(customerName, customerEmail)\n                                 .ExpiresAt(expirationDate)\n                                 .CreateAndSignWithPrivateKey(privateKey, passPhrase);\n\n            Assert.That(license, Is.Not.Null);\n            Assert.That(license.Signature, Is.Not.Null);\n\n            // verify signature\n            Assert.That(license.VerifySignature(publicKey), Is.True);\n\n            // validate xml\n            var xmlElement = XElement.Parse(license.ToString(), LoadOptions.None);\n            Assert.That(xmlElement.HasElements, Is.True);\n\n            // manipulate xml\n            Assert.That(xmlElement.Element(\"Quantity\"), Is.Not.Null);\n            xmlElement.Element(\"Quantity\").Value = \"11\"; // now we want to have 11 licenses\n\n            // load license from manipulated xml\n            var hackedLicense = License.Load(xmlElement.ToString());\n\n            // validate default values when not set\n            Assert.That(hackedLicense.Id, Is.EqualTo(licenseId));\n            Assert.That(hackedLicense.Type, Is.EqualTo(LicenseType.Standard));\n            Assert.That(hackedLicense.Quantity, Is.EqualTo(11)); // now with 10+1 licenses\n            Assert.That(hackedLicense.ProductFeatures, Is.Not.Null);\n            Assert.That(hackedLicense.ProductFeatures.GetAll(), Is.EquivalentTo(productFeatures));\n            Assert.That(hackedLicense.Customer, Is.Not.Null);\n            Assert.That(hackedLicense.Customer.Name, Is.EqualTo(customerName));\n            Assert.That(hackedLicense.Customer.Email, Is.EqualTo(customerEmail));\n            Assert.That(hackedLicense.Expiration, Is.EqualTo(ConvertToRfc1123(expirationDate)));\n\n            // verify signature\n            Assert.That(hackedLicense.VerifySignature(publicKey), Is.False);\n        }\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing.Tests/LicenseValidationTests.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing NUnit.Framework;\nusing Portable.Licensing.Validation;\n\nnamespace Portable.Licensing.Tests\n{\n    [TestFixture]\n    public class LicenseValidationTests\n    {\n        [Test]\n        public void Can_Validate_Valid_Signature()\n        {\n            var publicKey =\n                @\"MIIBKjCB4wYHKoZIzj0CATCB1wIBATAsBgcqhkjOPQEBAiEA/////wAAAAEAAAAAAAAAAAAAAAD///////////////8wWwQg/////wAAAAEAAAAAAAAAAAAAAAD///////////////wEIFrGNdiqOpPns+u9VXaYhrxlHQawzFOw9jvOPD4n0mBLAxUAxJ02CIbnBJNqZnjhE50mt4GffpAEIQNrF9Hy4SxCR/i85uVjpEDydwN9gS3rM6D0oTlF2JjClgIhAP////8AAAAA//////////+85vqtpxeehPO5ysL8YyVRAgEBA0IABNVLQ1xKY80BFMgGXec++Vw7n8vvNrq32PaHuBiYMm0PEj2JoB7qSSWhfgcjxNVJsxqJ6gDQVWgl0r7LH4dr0KU=\";\n            var licenseData = @\"<License>\n                                  <Id>77d4c193-6088-4c64-9663-ed7398ae8c1a</Id>\n                                  <Type>Trial</Type>\n                                  <Expiration>Sun, 31 Dec 1899 23:00:00 GMT</Expiration>\n                                  <Quantity>1</Quantity>\n                                  <Customer>\n                                    <Name>John Doe</Name>\n                                    <Email>john@doe.tld</Email>\n                                  </Customer>\n                                  <LicenseAttributes />\n                                  <ProductFeatures />\n                                  <Signature>MEUCIQCCEDAldOZHHIKvYZRDdzUP4V51y23d6deeK5jIFy27GQIgDz2CndjBh4Vb8tiC3FGQ6fn3GKt8d/P5+luJH0cWv+I=</Signature>\n                                </License>\";\n\n            var license = License.Load(licenseData);\n\n            var validationResults = license\n                .Validate()\n                .Signature(publicKey)\n                .AssertValidLicense();\n\n            Assert.That(validationResults, Is.Not.Null);\n            Assert.That(validationResults.Count(), Is.EqualTo(0));\n        }\n\n        [Test]\n        public void Can_Validate_Invalid_Signature()\n        {\n            var publicKey =\n                @\"MIIBKjCB4wYHKoZIzj0CATCB1wIBATAsBgcqhkjOPQEBAiEA/////wAAAAEAAAAAAAAAAAAAAAD///////////////8wWwQg/////wAAAAEAAAAAAAAAAAAAAAD///////////////wEIFrGNdiqOpPns+u9VXaYhrxlHQawzFOw9jvOPD4n0mBLAxUAxJ02CIbnBJNqZnjhE50mt4GffpAEIQNrF9Hy4SxCR/i85uVjpEDydwN9gS3rM6D0oTlF2JjClgIhAP////8AAAAA//////////+85vqtpxeehPO5ysL8YyVRAgEBA0IABNVLQ1xKY80BFMgGXec++Vw7n8vvNrq32PaHuBiYMm0PEj2JoB7qSSWhfgcjxNVJsxqJ6gDQVWgl0r7LH4dr0KU=\";\n            var licenseData = @\"<License>\n                                  <Id>77d4c193-6088-4c64-9663-ed7398ae8c1a</Id>\n                                  <Type>Trial</Type>\n                                  <Expiration>Sun, 31 Dec 1899 23:00:00 GMT</Expiration>\n                                  <Quantity>999</Quantity>\n                                  <Customer>\n                                    <Name>John Doe</Name>\n                                    <Email>john@doe.tld</Email>\n                                  </Customer>\n                                  <LicenseAttributes />\n                                  <ProductFeatures />\n                                  <Signature>MEUCIQCCEDAldOZHHIKvYZRDdzUP4V51y23d6deeK5jIFy27GQIgDz2CndjBh4Vb8tiC3FGQ6fn3GKt8d/P5+luJH0cWv+I=</Signature>\n                                </License>\";\n\n            var license = License.Load(licenseData);\n\n            var validationResults = license\n                .Validate()\n                .Signature(publicKey)\n                .AssertValidLicense().ToList();\n\n            Assert.That(validationResults, Is.Not.Null);\n            Assert.That(validationResults.Count(), Is.EqualTo(1));\n            Assert.That(validationResults.FirstOrDefault(), Is.TypeOf<InvalidSignatureValidationFailure>());\n        }\n\n        [Test]\n        public void Can_Validate_Expired_ExpirationDate()\n        {\n            var publicKey = \"\";\n            var licenseData = @\"<License>\n                                  <Id>77d4c193-6088-4c64-9663-ed7398ae8c1a</Id>\n                                  <Type>Trial</Type>\n                                  <Expiration>Sun, 31 Dec 1899 23:00:00 GMT</Expiration>\n                                  <Quantity>1</Quantity>\n                                  <Customer>\n                                    <Name>John Doe</Name>\n                                    <Email>john@doe.tld</Email>\n                                  </Customer>\n                                  <LicenseAttributes />\n                                  <ProductFeatures />\n                                  <Signature>MEUCIQCCEDAldOZHHIKvYZRDdzUP4V51y23d6deeK5jIFy27GQIgDz2CndjBh4Vb8tiC3FGQ6fn3GKt8d/P5+luJH0cWv+I=</Signature>\n                                </License>\";\n\n            var license = License.Load(licenseData);\n\n            var validationResults = license\n                .Validate()\n                .ExpirationDate()\n                .AssertValidLicense().ToList();\n\n            Assert.That(validationResults, Is.Not.Null);\n            Assert.That(validationResults.Count(), Is.EqualTo(1));\n            Assert.That(validationResults.FirstOrDefault(), Is.TypeOf<LicenseExpiredValidationFailure>());\n\n        }\n\n        [Test]\n        public void Can_Validate_CustomAssertion()\n        {\n            var publicKey = @\"MIIBKjCB4wYHKoZIzj0CATCB1wIBATAsBgcqhkjOPQEBAiEA/////wAAAAEAAAAAAAAAAAAAAAD///////////////8wWwQg/////wAAAAEAAAAAAAAAAAAAAAD///////////////wEIFrGNdiqOpPns+u9VXaYhrxlHQawzFOw9jvOPD4n0mBLAxUAxJ02CIbnBJNqZnjhE50mt4GffpAEIQNrF9Hy4SxCR/i85uVjpEDydwN9gS3rM6D0oTlF2JjClgIhAP////8AAAAA//////////+85vqtpxeehPO5ysL8YyVRAgEBA0IABNVLQ1xKY80BFMgGXec++Vw7n8vvNrq32PaHuBiYMm0PEj2JoB7qSSWhfgcjxNVJsxqJ6gDQVWgl0r7LH4dr0KU=\";\n            var licenseData = @\"<License>\n                              <Id>77d4c193-6088-4c64-9663-ed7398ae8c1a</Id>\n                              <Type>Trial</Type>\n                              <Expiration>Thu, 31 Dec 2009 23:00:00 GMT</Expiration>\n                              <Quantity>1</Quantity>\n                              <Customer>\n                                <Name>John Doe</Name>\n                                <Email>john@doe.tld</Email>\n                              </Customer>\n                              <LicenseAttributes>\n                                <Attribute name=\"\"Assembly Signature\"\">123456789</Attribute>\n                              </LicenseAttributes>\n                              <ProductFeatures>\n                                <Feature name=\"\"Sales Module\"\">yes</Feature>\n                                <Feature name=\"\"Workflow Module\"\">yes</Feature>\n                                <Feature name=\"\"Maximum Transactions\"\">10000</Feature>\n                              </ProductFeatures>\n                              <Signature>MEUCIQCa6A7Cts5ex4rGHAPxiXpy+2ocZzTDSP7SsddopKUx5QIgHnqv0DjoOpc+K9wALqajxxvmLCRJAywCX5vDAjmWqr8=</Signature>\n                            </License>\";\n\n            var license = License.Load(licenseData);\n\n            var validationResults = license\n                .Validate()\n                .AssertThat(lic => lic.ProductFeatures.Contains(\"Sales Module\"),\n                            new GeneralValidationFailure {Message = \"Sales Module not licensed!\"})\n                .And()\n                .AssertThat(lic => lic.AdditionalAttributes.Get(\"Assembly Signature\") == \"123456789\",\n                            new GeneralValidationFailure {Message = \"Assembly Signature does not match!\"})\n                .And()\n                .Signature(publicKey)\n                .AssertValidLicense().ToList();\n\n            Assert.That(validationResults, Is.Not.Null);\n            Assert.That(validationResults.Count(), Is.EqualTo(0));\n        }\n\n        [Test]\n        public void Do_Not_Crash_On_Invalid_Data()\n        {\n            var publicKey = \"1234\";\n            var licenseData =\n                @\"<license expiration='2013-06-30T00:00:00.0000000' type='Trial'><name>John Doe</name></license>\";\n\n            var license = License.Load(licenseData);\n\n            var validationResults = license\n                .Validate()\n                .ExpirationDate()\n                .And()\n                .Signature(publicKey)\n                .AssertValidLicense().ToList();\n\n            Assert.That(validationResults, Is.Not.Null);\n            Assert.That(validationResults.Count(), Is.EqualTo(1));\n            Assert.That(validationResults.FirstOrDefault(), Is.TypeOf<InvalidSignatureValidationFailure>());\n\n        }\n    }\n}"
  },
  {
    "path": "src/Portable.Licensing.Tests/Portable.Licensing.Tests.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{16CEEFD4-62BF-4539-9A08-0D05EC695572}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Portable.Licensing.Tests</RootNamespace>\n    <AssemblyName>Portable.Licensing.Tests</AssemblyName>\n    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <SolutionDir Condition=\"$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'\">..\\</SolutionDir>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>..\\..\\Build\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>..\\..\\Build\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Core\" />\n    <Reference Include=\"System.Xml.Linq\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"..\\CommonAssemblyInfo.cs\">\n      <Link>Properties\\CommonAssemblyInfo.cs</Link>\n    </Compile>\n    <Compile Include=\"KeyGeneratorTests.cs\" />\n    <Compile Include=\"LicenseSignatureTests.cs\" />\n    <Compile Include=\"LicenseValidationTests.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\Portable.Licensing\\Portable.Licensing.csproj\">\n      <Project>{6d2b800c-c252-4a33-ba05-904ae5b79417}</Project>\n      <Name>Portable.Licensing</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"paket.references\" />\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <Import Project=\"..\\..\\.paket\\paket.targets\" />\n  <ItemGroup>\n    <Reference Include=\"nunit.framework\">\n      <HintPath>..\\..\\packages\\NUnit\\lib\\nunit.framework.dll</HintPath>\n      <Private>True</Private>\n      <Paket>True</Paket>\n    </Reference>\n  </ItemGroup>\n</Project>"
  },
  {
    "path": "src/Portable.Licensing.Tests/Properties/AssemblyInfo.cs",
    "content": "﻿﻿//\n// Copyright © 2012 - 2013 Nauck IT KG     http://www.nauck-it.de\n//\n// Author:\n//  Daniel Nauck        <d.nauck(at)nauck-it.de>\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nusing System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"Portable.Licensing.Tests\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"ecb19417-e47a-43ec-b573-063931631cd3\")]"
  },
  {
    "path": "src/Portable.Licensing.Tests/paket.references",
    "content": "NUnit"
  },
  {
    "path": "src/Portable.Licensing.sln",
    "content": "Microsoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 2013\nVisualStudioVersion = 12.0.30723.0\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \".paket\", \".paket\", \"{476022A4-7C0A-4FC7-830E-ED32D3F82B13}\"\n\tProjectSection(SolutionItems) = preProject\n\t\t..\\paket.dependencies = ..\\paket.dependencies\n\t\t..\\paket.lock = ..\\paket.lock\n\tEndProjectSection\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Common\", \"Common\", \"{449E5271-6EE5-49BA-AB0E-370978ACD89C}\"\n\tProjectSection(SolutionItems) = preProject\n\t\t..\\build.fsx = ..\\build.fsx\n\t\t..\\LICENSE.md = ..\\LICENSE.md\n\t\t..\\Portable.Licensing.nuspec = ..\\Portable.Licensing.nuspec\n\t\t..\\README.md = ..\\README.md\n\tEndProjectSection\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Xamarin\", \"Xamarin\", \"{BB17039C-1F40-476D-8F75-DA11576E4168}\"\n\tProjectSection(SolutionItems) = preProject\n\t\t..\\Xamarin\\Details.md = ..\\Xamarin\\Details.md\n\t\t..\\Xamarin\\GettingStarted.md = ..\\Xamarin\\GettingStarted.md\n\tEndProjectSection\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Portable.Licensing\", \"Portable.Licensing\\Portable.Licensing.csproj\", \"{6D2B800C-C252-4A33-BA05-904AE5B79417}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Portable.Licensing.Tests\", \"Portable.Licensing.Tests\\Portable.Licensing.Tests.csproj\", \"{16CEEFD4-62BF-4539-9A08-0D05EC695572}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tAd-Hoc|Any CPU = Ad-Hoc|Any CPU\n\t\tAd-Hoc|iPhone = Ad-Hoc|iPhone\n\t\tAd-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator\n\t\tAd-Hoc|Mixed Platforms = Ad-Hoc|Mixed Platforms\n\t\tAppStore|Any CPU = AppStore|Any CPU\n\t\tAppStore|iPhone = AppStore|iPhone\n\t\tAppStore|iPhoneSimulator = AppStore|iPhoneSimulator\n\t\tAppStore|Mixed Platforms = AppStore|Mixed Platforms\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tDebug|iPhone = Debug|iPhone\n\t\tDebug|iPhoneSimulator = Debug|iPhoneSimulator\n\t\tDebug|Mixed Platforms = Debug|Mixed Platforms\n\t\tRelease|Any CPU = Release|Any CPU\n\t\tRelease|iPhone = Release|iPhone\n\t\tRelease|iPhoneSimulator = Release|iPhoneSimulator\n\t\tRelease|Mixed Platforms = Release|Mixed Platforms\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Ad-Hoc|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Ad-Hoc|Mixed Platforms.Build.0 = Debug|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.AppStore|Any CPU.Build.0 = Debug|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.AppStore|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.AppStore|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.AppStore|Mixed Platforms.Build.0 = Debug|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Debug|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Debug|Any CPU.Build.0 = Release|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Debug|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Release|iPhone.ActiveCfg = Release|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{6D2B800C-C252-4A33-BA05-904AE5B79417}.Release|Mixed Platforms.Build.0 = Release|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Ad-Hoc|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Ad-Hoc|Mixed Platforms.Build.0 = Debug|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.AppStore|Any CPU.Build.0 = Debug|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.AppStore|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.AppStore|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.AppStore|Mixed Platforms.Build.0 = Debug|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Debug|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Debug|Any CPU.Build.0 = Release|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Debug|iPhone.ActiveCfg = Debug|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Release|iPhone.ActiveCfg = Release|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU\n\t\t{16CEEFD4-62BF-4539-9A08-0D05EC695572}.Release|Mixed Platforms.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(NestedProjects) = preSolution\n\t\t{BB17039C-1F40-476D-8F75-DA11576E4168} = {449E5271-6EE5-49BA-AB0E-370978ACD89C}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "src/Portable.Licensing.sln.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:String x:Key=\"/Default/FilterSettingsManager/CoverageFilterXml/@EntryValue\">&lt;data&gt;&lt;IncludeFilters /&gt;&lt;ExcludeFilters /&gt;&lt;/data&gt;</s:String>\n\t<s:String x:Key=\"/Default/FilterSettingsManager/AttributeFilterXml/@EntryValue\">&lt;data /&gt;</s:String></wpf:ResourceDictionary>"
  }
]