ILicenseBuilder

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

Interface for license builder.

public interface ILicenseBuilder

Extension Methods

Licenseable.AddLicense<ILicenseBuilder>(ILicenseBuilder, ILicense), Licenseable.Load(ILicenseBuilder, string), Licenseable.RemoveLicense<ILicenseBuilder>(ILicenseBuilder, ILicense), Licenseable.Save<ILicenseBuilder>(ILicenseBuilder, string), Licenseable.SignWith(ILicenseBuilder, ISignatureProvider), Licenseable.SignWithKeys(ILicenseBuilder, string, string), Licenseable.ToReadableString(ILicenseBuilder, string), Licenseable.ValidateSignature(ILicenseBuilder)

Properties

SignatureProvider

Gets or sets the signature provider.

ISignatureProvider SignatureProvider { get; set; }

Property Value

ISignatureProvider

Methods

AddOrUpdate(ILicense)

Adds a with a given key to the builder if the license does not already exists, or updates the if the key already exists.

void AddOrUpdate(ILicense license)

Parameters

NameDescription

The object.

Load(Stream)

Loads the license from the specified file.

void Load(Stream stream)

Parameters

NameDescription

Specify the input stream.

Remove(ILicense)

Removes a with a given key from the builder.

bool Remove(ILicense license)

Parameters

NameDescription

The object to be removed.

Returns

NameDescription

true if it succeeds, false if it fails.

Save(Stream)

Saves a copy of the license into the specified file.

void Save(Stream stream)

Parameters

NameDescription

Specify the output stream.

Sign()

Add a signature to the license object.

void Sign()

ToLicenses()

Converts the current builder state to a collection of objects.

IEnumerable<ILicense> ToLicenses()

Returns

NameDescription

The current state as a collection of objects.

Validate()

Validates the license signature.

bool Validate()

Returns

NameDescription

true if it succeeds, false if it fails.

Last updated