Search Results for

    Show / Hide Table of Contents

    Class Data

    Methods that perform operations on a data object. A complete list can be found here: https://app.cryptolens.io/docs/api/v3/Data

    Inheritance
    object
    Data
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: SKM.V3.Methods
    Assembly: Cryptolens.Licensing.CrossPlatform.dll
    Syntax
    public class Data
    Examples
    var token = "{acesstoken to GetKey, IncrementIntValue, ListDataObjects, AddDataObjects, and Key Lock = -1 (or zero)}".
    var license = new LicenseKey { ProductId = 3349, Key = "GEBNC-WZZJD-VJIHG-GCMVD" };
    license.Refresh(token);
    
    if(license.DataObjects.Contains("usagecount"))
    {
        // attempt to increment. true means we succeed.
        var dataObj = license.DataObjects.Get("usagecount");
        if (dataObj.IncrementIntValue(token: token,
                                     incrementValue: 1,
                                     enableBound: true,
                                     upperBound: 2))
        {
            // success, we can keep using this feature
        }
        else
        {
            // fail, the the user has already used it 10 times.
        }
    
    }
    else
    {
        // if it does not exist, add a new one.
        license.AddDataObject(tokenDObj, new DataObject { Name = "usagecount", IntValue = 0 });
    }

    Methods

    | Edit this page View Source

    AddDataObject(string, AddDataObjectModel)

    Creates a new DataObject.

    Declaration
    public static DataObjectIdResult AddDataObject(string token, AddDataObjectModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    AddDataObjectModel parameters

    The parameters that the method needs

    Returns
    Type Description
    DataObjectIdResult

    Returns DataObjectIdResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/AddDataObject

    | Edit this page View Source

    AddDataObject(string, AddDataObjectToKeyModel)

    Creates a new DataObject for a key.

    Declaration
    public static DataObjectIdResult AddDataObject(string token, AddDataObjectToKeyModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    AddDataObjectToKeyModel parameters

    The parameters that the method needs

    Returns
    Type Description
    DataObjectIdResult

    Returns DataObjectIdResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/AddDataObject

    | Edit this page View Source

    AddDataObject(string, AddDataObjectToMachineCodeModel)

    Creates a new DataObject for a machine code.

    Declaration
    public static DataObjectIdResult AddDataObject(string token, AddDataObjectToMachineCodeModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    AddDataObjectToMachineCodeModel parameters

    The parameters that the method needs

    Returns
    Type Description
    DataObjectIdResult

    Returns DataObjectIdResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/AddDataObject

    | Edit this page View Source

    DecrementIntValue(string, ChangeIntValueModel)

    This method will decrement the current int value by the one specified as an input parameter, i.e. IntValue.

    Declaration
    public static BasicResult DecrementIntValue(string token, ChangeIntValueModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    ChangeIntValueModel parameters

    The parameters that the method needs

    Returns
    Type Description
    BasicResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/DecrementIntValue

    | Edit this page View Source

    DecrementIntValue(string, ChangeIntValueToKeyModel)

    This method will decrement the current int value by the one specified as an input parameter, i.e. IntValue.

    Declaration
    public static BasicResult DecrementIntValue(string token, ChangeIntValueToKeyModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    ChangeIntValueToKeyModel parameters

    The parameters that the method needs

    Returns
    Type Description
    BasicResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/DecrementIntValue

    | Edit this page View Source

    DecrementIntValue(string, ChangeIntValueToMachineCodeModel)

    This method will decrement the current int value by the one specified as an input parameter, i.e. IntValue.

    Declaration
    public static BasicResult DecrementIntValue(string token, ChangeIntValueToMachineCodeModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    ChangeIntValueToMachineCodeModel parameters

    The parameters that the method needs

    Returns
    Type Description
    BasicResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/DecrementIntValue

    | Edit this page View Source

    IncrementIntValue(string, ChangeIntValueModel)

    This method will increment the current int value by the one specified as an input parameter, i.e. IntValue.

    Declaration
    public static BasicResult IncrementIntValue(string token, ChangeIntValueModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    ChangeIntValueModel parameters

    The parameters that the method needs

    Returns
    Type Description
    BasicResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/IncrementIntValue

    | Edit this page View Source

    IncrementIntValue(string, ChangeIntValueToKeyModel)

    This method will increment the current int value by the one specified as an input parameter, i.e. IntValue.

    Declaration
    public static BasicResult IncrementIntValue(string token, ChangeIntValueToKeyModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    ChangeIntValueToKeyModel parameters

    The parameters that the method needs

    Returns
    Type Description
    BasicResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/IncrementIntValue

    | Edit this page View Source

    IncrementIntValue(string, ChangeIntValueToMachineCodeModel)

    This method will increment the current int value by the one specified as an input parameter, i.e. IntValue.

    Declaration
    public static BasicResult IncrementIntValue(string token, ChangeIntValueToMachineCodeModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    ChangeIntValueToMachineCodeModel parameters

    The parameters that the method needs

    Returns
    Type Description
    BasicResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/IncrementIntValue

    | Edit this page View Source

    ListDataObjects(string, ListDataObjectsModel)

    This method lists either all Data Object associated with a license key, a product or your entire account, or all of them at once.

    Declaration
    public static ListOfDataObjectsResult ListDataObjects(string token, ListDataObjectsModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    ListDataObjectsModel parameters

    The parameters that the method needs

    Returns
    Type Description
    ListOfDataObjectsResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/ListDataObjects

    | Edit this page View Source

    ListDataObjects(string, ListDataObjectsToKeyModel)

    This method lists all data objects associated with a license key only.

    Declaration
    public static ListOfDataObjectsResult ListDataObjects(string token, ListDataObjectsToKeyModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    ListDataObjectsToKeyModel parameters

    The parameters that the method needs

    Returns
    Type Description
    ListOfDataObjectsResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/ListDataObjects

    | Edit this page View Source

    ListDataObjects(string, ListDataObjectsToMachineCodeModel)

    This method lists all data objects associated with a machine code only.

    Declaration
    public static ListOfDataObjectsResult ListDataObjects(string token, ListDataObjectsToMachineCodeModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    ListDataObjectsToMachineCodeModel parameters

    The parameters that the method needs

    Returns
    Type Description
    ListOfDataObjectsResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/ListDataObjects

    | Edit this page View Source

    RemoveDataObject(string, RemoveDataObjectModel)

    This method will remove an existing data object.

    Declaration
    public static BasicResult RemoveDataObject(string token, RemoveDataObjectModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    RemoveDataObjectModel parameters

    The parameters that the method needs

    Returns
    Type Description
    BasicResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/RemoveDataObject

    | Edit this page View Source

    RemoveDataObject(string, RemoveDataObjectToKeyModel)

    This method will remove an existing data object.

    Declaration
    public static BasicResult RemoveDataObject(string token, RemoveDataObjectToKeyModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    RemoveDataObjectToKeyModel parameters

    The parameters that the method needs

    Returns
    Type Description
    BasicResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/RemoveDataObject

    | Edit this page View Source

    RemoveDataObject(string, RemoveDataObjectToMachineCodeModel)

    This method will remove an existing data object.

    Declaration
    public static BasicResult RemoveDataObject(string token, RemoveDataObjectToMachineCodeModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    RemoveDataObjectToMachineCodeModel parameters

    The parameters that the method needs

    Returns
    Type Description
    BasicResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/RemoveDataObject

    | Edit this page View Source

    SetIntValue(string, ChangeIntValueModel)

    This method will set the int value to a new one.

    Declaration
    public static BasicResult SetIntValue(string token, ChangeIntValueModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    ChangeIntValueModel parameters

    The parameters that the method needs

    Returns
    Type Description
    BasicResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/SetIntValue
    Note also: Integer overflows are not allowed. If you attempt to assign an int value that is beyond the limits of an int32, zero will be assigned to the data object's IntValue.

    | Edit this page View Source

    SetIntValue(string, ChangeIntValueToKeyModel)

    This method will set the int value to a new one.

    Declaration
    public static BasicResult SetIntValue(string token, ChangeIntValueToKeyModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    ChangeIntValueToKeyModel parameters

    The parameters that the method needs

    Returns
    Type Description
    BasicResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/SetIntValue
    Note also: Integer overflows are not allowed. If you attempt to assign an int value that is beyond the limits of an int32, zero will be assigned to the data object's IntValue.

    | Edit this page View Source

    SetIntValue(string, ChangeIntValueToMachineCodeModel)

    This method will set the int value to a new one.

    Declaration
    public static BasicResult SetIntValue(string token, ChangeIntValueToMachineCodeModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    ChangeIntValueToMachineCodeModel parameters

    The parameters that the method needs

    Returns
    Type Description
    BasicResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/SetIntValue
    Note also: Integer overflows are not allowed. If you attempt to assign an int value that is beyond the limits of an int32, zero will be assigned to the data object's IntValue.

    | Edit this page View Source

    SetStringValue(string, ChangeStringValueModel)

    This method will set the string value to a new one.

    Declaration
    public static BasicResult SetStringValue(string token, ChangeStringValueModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    ChangeStringValueModel parameters

    The parameters that the method needs

    Returns
    Type Description
    BasicResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/SetStringValue

    | Edit this page View Source

    SetStringValue(string, ChangeStringValueToKeyModel)

    This method will set the string value to a new one.

    Declaration
    public static BasicResult SetStringValue(string token, ChangeStringValueToKeyModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    ChangeStringValueToKeyModel parameters

    The parameters that the method needs

    Returns
    Type Description
    BasicResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/SetStringValue

    | Edit this page View Source

    SetStringValue(string, ChangeStringValueToMachineCodeModel)

    This method will set the string value to a new one.

    Declaration
    public static BasicResult SetStringValue(string token, ChangeStringValueToMachineCodeModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    ChangeStringValueToMachineCodeModel parameters

    The parameters that the method needs

    Returns
    Type Description
    BasicResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/SetStringValue

    | Edit this page View Source

    UploadValues(string, UploadValuesToKeyModel)

    This method will extract content from a Cryptolens log (used in offline licensing) and update existing data objects (either by incrementing or decrementing them). To call this method, you either need an "Increment Int Value" and/or "Decrement Int Value" permission, depending on if the log that you submit increases or decreases an int value of a data object. Note: for the time being, the limit of the number of entries in the log is 1000. i.e. IntValue.

    Declaration
    public static BasicResult UploadValues(string token, UploadValuesToKeyModel parameters)
    Parameters
    Type Name Description
    string token

    The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth

    UploadValuesToKeyModel parameters

    The parameters that the method needs

    Returns
    Type Description
    BasicResult

    Returns ListOfDataObjectsResult or null.

    Remarks

    Note: for more details, please see https://app.cryptolens.io/docs/api/v3/UploadValues

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © Cryptolens AB