Class Licenser
Helper class for verifying License information
Inheritance
System.Object
Licenser
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: LemonEdge.API
Assembly: API.dll
Syntax
public class Licenser
Fields
PUBLIC_RSA_XML_CRYPTO_KEY
The public RSA Crypto Key in XML form
Declaration
public const string PUBLIC_RSA_XML_CRYPTO_KEY = "<RSAKeyValue><Modulus>2+r0jyMtviNV2/slq5+o839C5eturZibnKy8ZSVwnVliMizrHPTTXp+F41i2jgoUaXsOUU+YHQ3HlT3ZkbU/zdu1aUkuvYY8252KdY5Rno28VfAK7XsX61ERA0IDZ40bYgQTXIKzXHQm8K43rIJXaql3ENBWMlKuIs7sooYNilsxJQ4dN3HlC9b6EdHQ94iEasCCpXQ9ZVoNA2HgCo8Bby/rgNx5IkKnlckOuLwIEHhiio28WUiFAY5dDlbaoyhazz7rOF8CQNR/ibTUiodKS1kmPrFVOlnbwuHSgGdRHUWYaVl+KzkS7JEodoprvE5QWDksuaUnkjsRCa71/U/lPn+vuGBbJF3933/XxNBgZlI6roCIb7Q3Q/I2SqPjCvVS3HjsY3a/Iwv+13hGs3kZos/1/O2LfSF2v8sto4Tl+RDgmwx9Y5qK7safGJvWQHkmxSeBoJd045aKsL0thpC79ahHLLOpUKdOhLzzUBywAak5Ex1xdVgw5k8dy59cPASzDsdKiSsuMr2o8R3R2HXBZIIqfavKXz/sB0TDIjgrOaC9x2bYUmIaPFD1O4+th0Y6D87RTnYSCLzSBpcEeOsg+hvZWrllaUay2Evf4t88OqKyHCzLlZFw2CAo/7P6OnLl+tGukBaL8p8zYZglb+YL3wxS/cT0FDmecPP0E8To7mXTQTQyPu6oUkMi1VFQ0K/mpva48AytivmRPipvOrjelfjNa0x4SFtTPDM8A8yH2JQi7g7FQq3wk1Lw68YI9QD0mCTW+ruHtalRjIl7AtPozcFMrbOT8rdtd4Jbe9iPjRFO809dV3mw2WJkaAoqd4jnlDTmQvkT2w8hljRkk8YKvqOxkDLJ2h54S2pQMWa0MrcU0/jl/XLwomdVcfRXkyhnv66vmFf8FGHKKDQOvGb2EmB38xgD7Vkdp+FxDvgJypK8yCqZUcbW8rU0IFWCKmtVkogb2FIqwx0fdOiOgynMl/v4LkL9ZTG4OvTprf8WdcdbI8BOobfdtybFFjrVChZLwfN02sEscltlpRBk8UU594TVb4jrS5D1luxg7qScF9CVc3a5QydL7WW81BhzaI7seuFzGOJy613YIizNkQ/RC5X6ITwnV9ZY9Z6VyiFQcsFR8RNIcHj1hK8FJw85Ra2vsp02gPTXuTbkvhA4n/xSG3GryY5j4wMs3mZb8AYDDhe9RwCZgQR6UhQUh9D2bmV5DrnG3qKkXHFIJraavI/GoCqwim7C8x3QRLNkYCGnPwB+Y8+FHY3IqsGWlfOx3E7PNMcPWRNs3LOf2/qM4xSjObHZn5p7adlX39Qqjf3vU2SDxkpQMrv3M5S6WgJmzscJe18/LWchRvt/l1oNnJGCOQ==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>"
Field Value
Type | Description |
---|---|
System.String |
RSA_KEY_LENGTH
The RSA key length used
Declaration
public const int RSA_KEY_LENGTH = 8192
Field Value
Type | Description |
---|---|
System.Int32 |
Methods
SignLicense(License, String)
Given a license and a private crypto key will return a signed version of that license
Declaration
public static string SignLicense(License license, string privateCryptoKey)
Parameters
Type | Name | Description |
---|---|---|
License | license | The license to sign |
System.String | privateCryptoKey | The private crypto key to use to sign the license |
Returns
Type | Description |
---|---|
System.String | A signed license |
Verify(License, String, String)
Indicates if the given license matches the signed license string
Declaration
public static bool Verify(License license, string signedLicense, string cryptoKey = "<RSAKeyValue><Modulus>2+r0jyMtviNV2/slq5+o839C5eturZibnKy8ZSVwnVliMizrHPTTXp+F41i2jgoUaXsOUU+YHQ3HlT3ZkbU/zdu1aUkuvYY8252KdY5Rno28VfAK7XsX61ERA0IDZ40bYgQTXIKzX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3qKkXHFIJraavI/GoCqwim7C8x3QRLNkYCGnPwB+Y8+FHY3IqsGWlfOx3E7PNMcPWRNs3LOf2/qM4xSjObHZn5p7adlX39Qqjf3vU2SDxkpQMrv3M5S6WgJmzscJe18/LWchRvt/l1oNnJGCOQ==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>")
Parameters
Type | Name | Description |
---|---|---|
License | license | The current license for this LemonEdge system |
System.String | signedLicense | A LemonEdge signed version of this license |
System.String | cryptoKey | The Public RSA Crypto Key to check the signed license with |
Returns
Type | Description |
---|---|
System.Boolean | A boolean indicating if the license is valid |