2021-03-16 20:51:18 +00:00
|
|
|
//
|
|
|
|
// Copyright 2020 FoxyUtils ehf. All rights reserved.
|
|
|
|
//
|
|
|
|
// This is a commercial product and requires a license to operate.
|
|
|
|
// A trial license can be obtained at https://unidoc.io
|
|
|
|
//
|
|
|
|
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
|
|
|
|
//
|
|
|
|
// Use of this source code is governed by the UniDoc End User License Agreement
|
|
|
|
// terms that can be accessed at https://unidoc.io/eula/
|
|
|
|
|
2022-06-27 19:44:23 +00:00
|
|
|
package license ;import (_ac "bytes";_f "compress/gzip";_cd "crypto";_gb "crypto/aes";_gg "crypto/cipher";_ec "crypto/rand";_be "crypto/rsa";_aa "crypto/sha256";_ceda "crypto/sha512";_cea "crypto/x509";_ed "encoding/base64";_ceg "encoding/binary";_eda "encoding/hex";_cdg "encoding/json";_b "encoding/pem";_e "errors";_dd "fmt";_fee "github.com/unidoc/unioffice/common";_bc "github.com/unidoc/unioffice/common/logger";_a "io";_fe "io/ioutil";_ffa "log";_ff "net";_ced "net/http";_cg "os";_cb "path/filepath";_ce "regexp";_g "sort";_cf "strings";_cc "sync";_d "time";);type reportState struct{Instance string `json:"inst"`;Next string `json:"n"`;Docs int64 `json:"d"`;NumErrors int64 `json:"e"`;LimitDocs bool `json:"ld"`;RemainingDocs int64 `json:"rd"`;LastReported _d .Time `json:"lr"`;LastWritten _d .Time `json:"lw"`;Usage map[string ]int `json:"u"`;};var _bfd *_be .PublicKey ;var _cef =false ;type meteredUsageCheckinResp struct{Instance string `json:"inst"`;Next string `json:"next"`;Success bool `json:"success"`;Message string `json:"message"`;RemainingDocs int `json:"rd"`;LimitDocs bool `json:"ld"`;};func GetLicenseKey ()*LicenseKey {if _aee ==nil {return nil ;};_ccg :=*_aee ;return &_ccg ;};func (_dec *LicenseKey )Validate ()error {if _dec ._abf {return nil ;};if len (_dec .LicenseId )< 10{return _dd .Errorf ("i\u006e\u0076\u0061\u006c\u0069\u0064 \u006c\u0069\u0063\u0065\u006e\u0073\u0065\u003a\u0020L\u0069\u0063\u0065n\u0073e\u0020\u0049\u0064");};if len (_dec .CustomerId )< 10{return _dd .Errorf ("\u0069\u006e\u0076\u0061l\u0069\u0064\u0020\u006c\u0069\u0063\u0065\u006e\u0073\u0065:\u0020C\u0075\u0073\u0074\u006f\u006d\u0065\u0072 \u0049\u0064");};if len (_dec .CustomerName )< 1{return _dd .Errorf ("\u0069\u006e\u0076\u0061\u006c\u0069\u0064\u0020\u006c\u0069c\u0065\u006e\u0073\u0065\u003a\u0020\u0043u\u0073\u0074\u006f\u006d\u0065\u0072\u0020\u004e\u0061\u006d\u0065");};if _aca .After (_dec .CreatedAt ){return _dd .Errorf ("\u0069\u006e\u0076\u0061\u006c\u0069\u0064\u0020\u006c\u0069\u0063\u0065\u006e\u0073\u0065\u003a\u0020\u0043\u0072\u0065\u0061\u0074\u0065\u0064 \u0041\u0074\u0020\u0069\u0073 \u0069\u006ev\u0061\u006c\u0069\u0064");};if _dec .ExpiresAt .IsZero (){_df :=_dec .CreatedAt .AddDate (1,0,0);if _gde .After (_df ){_df =_gde ;};_dec .ExpiresAt =_df ;};if _dec .CreatedAt .After (_dec .ExpiresAt ){return _dd .Errorf ("i\u006e\u0076\u0061\u006c\u0069\u0064\u0020\u006c\u0069\u0063\u0065\u006e\u0073\u0065\u003a\u0020\u0043\u0072\u0065\u0061\u0074\u0065\u0064\u0020\u0041\u0074 \u0063a\u006e\u006e\u006f\u0074 \u0062\u0065 \u0047\u0072\u0065\u0061\u0074\u0065\u0072\u0020\u0074\u0068\u0061\u006e\u0020\u0045\u0078\u0070\u0069\u0072\u0065\u0073\u0020\u0041\u0074");};if _dec .isExpired (){return _dd .Errorf ("\u0069\u006e\u0076\u0061\u006c\u0069\u0064\u0020l\u0069\u0063\u0065ns\u0065\u003a\u0020\u0054\u0068\u0065 \u006c\u0069\u0063\u0065\u006e\u0073\u0065\u0020\u0068\u0061\u0073\u0020\u0061\u006c\u0072e\u0061\u0064\u0079\u0020\u0065\u0078\u0070\u0069r\u0065\u0064");};if len (_dec .CreatorName )< 1{return _dd .Errorf ("\u0069\u006ev\u0061\u006c\u0069\u0064\u0020\u006c\u0069\u0063\u0065\u006e\u0073\u0065\u003a\u0020\u0043\u0072\u0065\u0061\u0074\u006f\u0072\u0020na\u006d\u0065");};if len (_dec .CreatorEmail )< 1{return _dd .Errorf ("\u0069\u006e\u0076\u0061\u006c\u0069\u0064\u0020\u006c\u0069c\u0065\u006e\u0073\u0065\u003a\u0020\u0043r\u0065\u0061\u0074\u006f\u0072\u0020\u0065\u006d\u0061\u0069\u006c");};if _dec .CreatedAt .After (_cgd ){if !_dec .UniOffice {return _dd .Errorf ("\u0069\u006e\u0076\u0061l\u0069\u0064\u0020\u006c\u0069\u0063\u0065\u006e\u0073e\u003a\u0020\u0054\u0068\u0069\u0073\u0020\u0055\u006e\u0069\u0044\u006f\u0063\u0020\u006b\u0065\u0079\u0020i\u0073\u0020\u0069\u006e\u0076a\u006c\u0069\u0064\u0020\u0066\u006f\u0072\u0020\u0055\u006e\u0069\u004f\u0066\u0066\u0069\u0063\u0065");};};return nil ;};func GetMeteredState ()(MeteredStatus ,error ){if _aee ==nil {return MeteredStatus {},_e .New ("\u006c\u0069\u0063\u0065ns\u0065\u0020\u006b\u0065\u0079\u0020\u006e\u006f\u0074\u0020\u0073\u0065\u0074");};if !_ae
|