|Dotfuscator > Configuring Dotfuscator via the GUI > Instrumentation (Tamper, Shelf Life, Exception, Analytics) > Shelf Life Token Overview|
Shelf Life is an application inventory management function that allows you to embed expiration and notification logic into an application. Dotfuscator injects code that reacts to application expiration by exiting the application and/or sending a PreEmptive Analytics message. This feature is particularly helpful with beta applications. Users can schedule an application’s expiration/de-activation for a specific date and optionally issue warnings to users that the application will expire/de-activate in a specific number of days.
A Shelf Life Token is an encrypted set of data containing application and expiration information that is injected into the application binary at obfuscation time, or it can be stored as a string outside of the application binary so that it can be updated to extend the expiration date.
Using a Private Key File and password is an option that provides additional defense in depth of a Shelf Life token by signing the token data with the user provided private key. Only the necessary public key information necessary to provide signature validation is stored in the Shelf Life Token.
There are two methods of providing the Shelf Life Token to the Shelf Life runtime code that is injected into the application. The default method is for Dotfuscator to directly embed the encrypted data into the binary during the obfuscation process. An alternative method is for the application developer to provide for their own persistence of the Shelf Life Token data and to provide a string representation of that Shelf Life Token data to the injected runtime code via custom methods, properties, etc. as set in the ShelfLifeTokenSource properties. The advantage of persisting the Shelf Life Token data outside of the binary allows for easier extensions of expiration dates without distributing a newly instrumented binary but, it does so at the cost of making the Shelf Life Token Data more visible to the end user.