Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Portable.Licensing.Tests/LicenseValidationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void Can_Validate_Invalid_Signature()
[Test]
public void Can_Validate_Expired_ExpirationDate()
{
var publicKey = "";
//var publicKey = "";
var licenseData = @"<License>
<Id>77d4c193-6088-4c64-9663-ed7398ae8c1a</Id>
<Type>Trial</Type>
Expand Down
9 changes: 8 additions & 1 deletion src/Portable.Licensing/ILicenseBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ namespace Portable.Licensing
/// Fluent api to create and sign a new <see cref="License"/>.
/// </summary>
public interface ILicenseBuilder : IFluentInterface
{
{
/// <summary>
/// Sets the product name of the <see cref="License"/>.
/// </summary>
/// <param name="product">The product name of the <see cref="License"/>.</param>
/// <returns>The <see cref="ILicenseBuilder"/>.</returns>
ILicenseBuilder WithProduct(string product);

/// <summary>
/// Sets the unique identifier of the <see cref="License"/>.
/// </summary>
Expand Down
11 changes: 10 additions & 1 deletion src/Portable.Licensing/License.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ public Guid Id
{
get { return new Guid(GetTag("Id") ?? Guid.Empty.ToString()); }
set { if (!IsSigned) SetTag("Id", value.ToString()); }
}

/// <summary>
/// Gets or sets the product name this <see cref="License"/> applies to.
/// </summary>
public String Product
{
get { return GetTag("Product") ?? ""; }
set { if (!IsSigned) SetTag("Product", value); }
}

/// <summary>
Expand Down Expand Up @@ -167,7 +176,7 @@ public LicenseAttributes AdditionalAttributes
/// <summary>
/// Gets or sets the expiration date of this <see cref="License"/>.
/// Use this property to set the expiration date for a trial license
/// or the expiration of support & subscription updates for a standard license.
/// or the expiration of support and subscription updates for a standard license.
/// </summary>
public DateTime Expiration
{
Expand Down
12 changes: 12 additions & 0 deletions src/Portable.Licensing/LicenseBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ internal class LicenseBuilder : ILicenseBuilder
public LicenseBuilder()
{
license = new License();
}


/// <summary>
/// Sets the product name of the <see cref="License"/>.
/// </summary>
/// <param name="product">The product name of the <see cref="License"/>.</param>
/// <returns>The <see cref="ILicenseBuilder"/>.</returns>
public ILicenseBuilder WithProduct(string product)
{
license.Product = product;
return this;
}

/// <summary>
Expand Down