StringLicense

Namespace: Babel.Licensing Assembly: Babel.Licensing.dll

Defines a license object that can be retrieved from an encoded string. This class cannot be inherited.

public class StringLicense : ILicense

Inheritance

objectStringLicense

Implements

ILicense

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Extension Methods

Licenseable.Build(ILicense), Licenseable.CopyFrom<StringLicense>(StringLicense, StringLicense), Licenseable.ExpiresAt<StringLicense>(StringLicense, DateTime?), Licenseable.ForAnyAssembly<StringLicense>(StringLicense), Licenseable.ForAnyComponent<StringLicense>(StringLicense), Licenseable.ForAssembly<StringLicense>(StringLicense, Assembly), Licenseable.ForAssembly<StringLicense>(StringLicense, string), Licenseable.ForBetaTesters<StringLicense>(StringLicense, string, string, DateTime?), Licenseable.ForProduct<StringLicense>(StringLicense, string, string, string, string, string), Licenseable.IssuedAt<StringLicense>(StringLicense, DateTime?), Licenseable.LicensedTo<StringLicense>(StringLicense, string, string, string, string, byte[]), Licenseable.NotForVirtualEnvironment<StringLicense>(StringLicense), Licenseable.RestrictedToProcess<StringLicense>(StringLicense, params string[]), Licenseable.SignWith(ILicense, ISignatureProvider), Licenseable.SignWithKeys(ILicense, string, string), Licenseable.SupportExpiresAt<StringLicense>(StringLicense, DateTime?), Licenseable.ToRestrictedDomain<StringLicense>(StringLicense, string, string), Licenseable.UseOnlyAt<StringLicense>(StringLicense, string), Licenseable.ValidateWith(ILicense, ISignatureProvider), Licenseable.ValidateWithPublicKey(ILicense, string), Licenseable.WithComponents<StringLicense>(StringLicense, params string[]), Licenseable.WithFeature<StringLicense>(StringLicense, string, string, byte[], DateTime?, byte[]), Licenseable.WithFeature<StringLicense>(StringLicense, Feature), Licenseable.WithFeatures<StringLicense>(StringLicense, params Feature[]), Licenseable.WithField<StringLicense>(StringLicense, string, string), Licenseable.WithFields<StringLicense>(StringLicense, IDictionary<string, string>), Licenseable.WithFields<StringLicense>(StringLicense, params Field[]), Licenseable.WithHardwareKey<StringLicense>(StringLicense, string), Licenseable.WithId<StringLicense>(StringLicense, string), Licenseable.WithMaxSites<StringLicense>(StringLicense, int), Licenseable.WithMaximumRunCount<StringLicense>(StringLicense, int?), Licenseable.WithMaximumRunningInstances<StringLicense>(StringLicense, int?), Licenseable.WithRestrictions<StringLicense>(StringLicense, params Restriction[]), Licenseable.WithTrialDays<StringLicense>(StringLicense, int?), Licenseable.WithTrialRunTime<StringLicense>(StringLicense, TimeSpan?), Licenseable.WithType<StringLicense>(StringLicense, string), Licenseable.WithUniqueId<StringLicense>(StringLicense, string, int)

Constructors

StringLicense()

Initializes a new instance of the class.

public StringLicense()

Examples

ECDsaSignature ecdsa = new ECDsaSignature();
ecdsa.CreateKeyPair();

var license = new StringLicense();

string str = license.WithId("101")
	.WithType("Std")
	.WithTrialDays(30)
	.SignWithKeys(ecdsa.PublicKey, ecdsa.PrivateKey)
	.ValidateSignature()
	.ToReadableString();

// 5CQRTBZLOIKSTJJLRSMFNRO2FFQVNEZFCQWYF

Fields

DefaultMaskSize

The default string license mask size used to randomize the generated string.

public static int DefaultMaskSize

Field Value

int

Properties

Assemblies

Gets the collection of licensed assemblies full names.

public ICollection<string> Assemblies { get; }

Property Value

ICollection<string>

Components

Gets the licensed components collection.

public ICollection<string> Components { get; }

Property Value

ICollection<string>

ExpireDate

Gets the license expire date.

public DateTime? ExpireDate { get; set; }

Property Value

DateTime?

Features

Gets the license collection.

public ICollection<Feature> Features { get; }

Property Value

ICollection<Feature>

Fields

Gets the license collection.

public ICollection<Field> Fields { get; }

Property Value

ICollection<Field>

Id

Gets the license identifier.

public string Id { get; set; }

Property Value

string

IsBeta

Gets a value indicating whether this object represents a beta license.

public bool IsBeta { get; }

Property Value

bool

IsTrial

Gets a value indicating whether this object represents a trial license.

public bool IsTrial { get; }

Property Value

bool

IssueDate

Gets the license issue date.

public DateTime? IssueDate { get; set; }

Property Value

DateTime?

LicenseKey

Gets the license key granted to this component.

public string LicenseKey { get; }

Property Value

string

Licensee

Gets the information.

public Licensee Licensee { get; set; }

Property Value

Licensee

Product

Gets the licensed product information.

public Product Product { get; set; }

Property Value

Product

Restrictions

Gets the collection of objects.

public ICollection<Restriction> Restrictions { get; }

Property Value

ICollection<Restriction>

Sites

Gets or sets the number of sites to license.

public int? Sites { get; set; }

Property Value

int?

SupportExpireDate

Gets the license support expire date.

public DateTime? SupportExpireDate { get; set; }

Property Value

DateTime?

Timestamp

Gets the date/time when this object was created.

public DateTime Timestamp { get; }

Property Value

DateTime

Type

Gets the license type.

public string Type { get; set; }

Property Value

string

Methods

Dispose()

Disposes of the resources used by the license object.

public void Dispose()

~StringLicense()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.

protected ~StringLicense()

Parse(string)

Parse the specified license string.

public static StringLicense Parse(string licenseKey)

Parameters

NameDescription

The license key.

Returns

NameDescription

An StringLicense object that corresponds to the license key.

Last updated