LicenceMetadata

Description

sealed class Tinman.Core.Licensing.LicenceMetadata

Derived from

IEquatable<LicenceMetadata>

Represents licence metadata information.

Licence metadata information is gathered from these sources:

Public / Constants

None


[ShutdownSurvive]
public static readonly attribute None → (LicenceMetadata)

Empty licence metadata.

Public / Constructors

Current


public static method Current → (1)

licenceFlags opt : LicenceFlags = LicenceFlags.All

The licence metadata binding flags.

returns → LicenceMetadata

The licence metadata.

Fetches current licence metadata values from the execution context.

From​Request


public static method FromRequest → (1)

licenceRequest in : Path

[not-null]
Path to licence request file.

returns → LicenceMetadata

The licence metadata.

Creates a new instance of LicenceMetadata from the given licence request.

IOException

If an I/O error has occurred.

ValidatingException

If the contents of licenceRequest in are malformed.

Public / Methods

Is​Valid​For


public method IsValidFor → (1)

bindings in : LicenceFlags

The licence metadata bindings.

returns → bool

true if all metadata values are valid for bindings in, false if not.

Are the metadata values valid for the given licence bindings?

Is​Valid​For​Debug


[Pure]
public static method IsValidForDebug → (1)

bindings in : LicenceFlags

The licence metadata bindings.

returns → bool

true if bindings in can unlock a licence domain in DEBUG mode,
false if they will only unlock the domain in non-DEBUG mode.

Checks if the given licence metadata bindings will unlock DEBUG mode.

If no licence metadata bindings are present or if any of the following licence metadata bindings are present, unlocking a licence domain in DEBUG mode will not be possible:

See also

LowLevel.IsDebug

Normalize​In


[Pure]
public static method NormalizeIn → (1)

value in : string

The raw metadata input value.

returns → string

The normalized input metadata value.

Returns the normalized input metadata value for the given raw value.

This method will be called automatically. It is not necessary to normalize raw values before passing them to the LicenceMetadata class.

Normalize​Out


[Pure]
public static method NormalizeOut → (1)

value in : string

The normalized input metadata value, as returned by NormalizeIn.

returns → string

The normalized output metadata value.

Returns the normalized output metadata value that will be used for licence checking.

Reduce


public method Reduce → (1)

bindings in : LicenceFlags

The licence metadata binding flags to reduce to.

returns → LicenceMetadata

The reduced metadata that contains placeholders for metadata information that is not included in the given licence metadata bindings in.

Reduces this licence metadata to the given licence metadata binding flags.

Use​Legal


[Pure]
public method UseLegal → (4)

company in : string

The new LegalCompany value or null for any.

copyright in : string

The new LegalCopyright value or null for any.

product in : string

The new LegalProduct value or null for any.

trademark in : string

The new LegalTrademark value or null for any.

returns → LicenceMetadata

The updated metadata.

Updates the LicenceFlags.Legal binding value of this metadata.

Use​Machine


[Pure]
public method UseMachine → (3)

code in : string

The new MachineCode value null for any.

domain in : string

The new MachineDomain value null for any.

user in : string

The new MachineUser value null for any.

returns → LicenceMetadata

The updated metadata.

Updates the LicenceFlags.Machine binding value of this metadata.

Use​Program


[Pure]
public method UseProgram → (4)

file in : string

The new ProgramFile value null for any.

hash in : string

The new ProgramHash value null for any.

title in : string

The new ProgramTitle value null for any.

version in : string

The new ProgramVersion value null for any.

returns → LicenceMetadata

The updated metadata.

Updates the LicenceFlags.Legal binding value of this metadata.

Use​Timestamp


[Pure]
public method UseTimestamp → (1)

timestamp in : int32

The new Timestamp value.

returns → LicenceMetadata

The updated metadata.

Updates the Timestamp binding value of this metadata.

Public / Attributes

Flags


public readonly attribute Flags → (LicenceFlags)

The licence metadata binding flags.

Legal​Company


public readonly attribute LegalCompany → (string)

The legal company name or '*' for any, obtained from:

  • VERSIONINFO.CompanyName

  • System.Reflection.AssemblyCompanyAttribute

Legal​Copyright


public readonly attribute LegalCopyright → (string)

The legal copyright notice or '*' for any, obtained from:

  • VERSIONINFO.LegalCopyright

  • System.Reflection.AssemblyCopyrightAttribute

Legal​Product


public readonly attribute LegalProduct → (string)

The legal product name or '*' for any, obtained from:

  • VERSIONINFO.ProductName

  • System.Reflection.AssemblyProductAttribute

Legal​Trademark


public readonly attribute LegalTrademark → (string)

The legal trademark notice or '*' for any, obtained from:

  • VERSIONINFO.LegalTrademarks

  • System.Reflection.AssemblyTrademarkAttribute

Machine​Code


public readonly attribute MachineCode → (string)

The machine hardware identifier or '*' for any.

Machine​Domain


public readonly attribute MachineDomain → (string)

The user name of the machine login or '*' for any.

Machine​User


public readonly attribute MachineUser → (string)

The domain name of the machine login or '*' for any.

Program​File


public readonly attribute ProgramFile → (string)

The program binary file name or '*' for any.

Program​Hash


public readonly attribute ProgramHash → (string)

The program binary hash or '*' for any.

Program​Title


public readonly attribute ProgramTitle → (string)

The program title or '*' for any, obtained from:

  • VERSIONINFO.FileDescription

  • System.Reflection.AssemblyTitleAttribute

Program​Version


public readonly attribute ProgramVersion → (string)

The program version or '*' for any, obtained from:

  • VERSIONINFO.FileVersion

  • System.Reflection.AssemblyVersionAttribute

Timestamp


public readonly attribute Timestamp → (int32)

The timestamp index.