/// <summary>
        ///     Saves the license key.
        /// </summary>
        public override void Save()
        {
            // Check whether vendor-authorisation is required.
            if (!this.IsPersisted || !this.ComputeHash().SequenceEqual(this.Provider.Security.License.FetchById(this.Id).ComputeHash()) || this.Status == LicenseStatus.Invalid)
            {
                // Obtain the required license key.
                LicenseKey licenseKey = LicenseKey.PrivateKey;
                if (licenseKey != null)
                {
                    this.ModifiedData.Signature = licenseKey.Sign(this.ComputeHash());
                }
            }

            this._status = null;

            // Recompute the status and save if the license has not been invalidated.
            if (this.Status != LicenseStatus.Invalid)
            {
                base.Save();
                this.Provider.Security.License.Reset();
            }
        }