unioffice/common/license/license.go

48 lines
17 KiB
Go
Raw Normal View History

2020-08-23 14:15:53 +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/
// Package license helps manage commercial licenses and check if they are valid for the version of unidoc used.
2021-01-04 16:11:39 +00:00
package license ;import (_ag "bytes";_bd "compress/gzip";_g "crypto";_f "crypto/rand";_bc "crypto/rsa";_fc "crypto/sha256";_fa "crypto/sha512";_fd "crypto/x509";_bf "encoding/base64";_ba "encoding/hex";_gb "encoding/json";_ac "encoding/pem";_ee "errors";_aed "fmt";_d "github.com/unidoc/unioffice/common";_a "io";_aa "log";_e "regexp";_ae "strings";_ab "time";);const _ea ="\u000a\u002d\u002d\u002d\u002d\u002d\u0042\u0045\u0047\u0049\u004e \u0050\u0055\u0042\u004c\u0049\u0043\u0020\u004b\u0045Y\u002d\u002d\u002d\u002d\u002d\u000a\u004d\u0049I\u0042\u0049\u006a\u0041NB\u0067\u006b\u0071\u0068\u006b\u0069G\u0039\u0077\u0030\u0042\u0041\u0051\u0045\u0046A\u0041\u004f\u0043\u0041\u0051\u0038\u0041\u004d\u0049\u0049\u0042\u0043\u0067\u004b\u0043\u0041\u0051\u0045A\u006dF\u0055\u0069\u0079\u0064\u0037\u0062\u0035\u0058\u006a\u0070\u006b\u0050\u0035\u0052\u0061\u0070\u0034\u0077\u000a\u0044\u0063\u0031d\u0079\u007a\u0049\u0051\u0034\u004c\u0065\u006b\u0078\u0072\u0076\u0079\u0074\u006e\u0045\u004d\u0070\u004e\u0055\u0062\u006f\u0036i\u0041\u0037\u0034\u0056\u0038\u0072\u0075\u005a\u004f\u0076\u0072\u0053\u0063\u0073\u0066\u0032\u0051\u0065\u004e9\u002f\u0071r\u0055\u0047\u0038\u0071\u0045\u0062\u0055\u0057\u0064\u006f\u0045\u0059\u0071+\u000a\u006f\u0074\u0046\u004e\u0041\u0046N\u0078\u006c\u0047\u0062\u0078\u0062\u0044\u0048\u0063\u0064\u0047\u0056\u0061\u004d\u0030\u004f\u0058\u0064\u0058g\u0044y\u004c5\u0061\u0049\u0045\u0061\u0067\u004c\u0030\u0063\u0035\u0070\u0077\u006a\u0049\u0064\u0050G\u0049\u006e\u0034\u0036\u0066\u0037\u0038\u0065\u004d\u004a\u002b\u004a\u006b\u0064\u0063\u0070\u0044\n\u0044\u004a\u0061\u0071\u0059\u0058d\u0072\u007a5\u004b\u0065\u0073\u0068\u006aS\u0069\u0049\u0061\u0061\u0037\u006d\u0065\u006e\u0042\u0049\u0041\u0058\u0053\u0034\u0055\u0046\u0078N\u0066H\u0068\u004e\u0030\u0048\u0043\u0059\u005a\u0059\u0071\u0051\u0047\u0037\u0062K+\u0073\u0035\u0072R\u0048\u006f\u006e\u0079\u0064\u004eW\u0045\u0047\u000a\u0048\u0038M\u0079\u0076\u00722\u0070\u0079\u0061\u0032K\u0072\u004d\u0075m\u0066\u006d\u0041\u0078\u0055\u0042\u0036\u0066\u0065\u006e\u0043\u002f4\u004f\u0030\u0057\u00728\u0067\u0066\u0050\u004f\u0055\u0038R\u0069\u0074\u006d\u0062\u0044\u0076\u0051\u0050\u0049\u0052\u0058\u004fL\u0034\u0076\u0054B\u0072\u0042\u0064\u0062a\u0041\u000a9\u006e\u0077\u004e\u0050\u002b\u0069\u002f\u002f\u0032\u0030\u004d\u00542\u0062\u0078\u006d\u0065\u0057\u0042\u002b\u0067\u0070\u0063\u0045\u0068G\u0070\u0058\u005a7\u0033\u0033\u0061\u007a\u0051\u0078\u0072\u0043\u0033\u004a\u0034\u0076\u0033C\u005a\u006d\u0045\u004eS\u0074\u0044\u004b\u002f\u004b\u0044\u0053\u0050\u004b\u0055\u0047\u0066\u00756\u000a\u0066\u0077I\u0044\u0041\u0051\u0041\u0042\u000a\u002d\u002d\u002d\u002d\u002dE\u004e\u0044\u0020\u0050\u0055\u0042\u004c\u0049\u0043 \u004b\u0045Y\u002d\u002d\u002d\u002d\u002d\n";func GetLicenseKey ()*LicenseKey {if _gggd ==nil {return nil ;};_bcf :=*_gggd ;return &_bcf ;};
// MakeUnlicensedKey returns an unlicensed key.
func MakeUnlicensedKey ()*LicenseKey {_fceg :=LicenseKey {};_fceg .CustomerName ="\u0055\u006e\u006c\u0069\u0063\u0065\u006e\u0073\u0065\u0064";_fceg .Tier =LicenseTierUnlicensed ;_fceg .CreatedAt =_ab .Now ().UTC ();_fceg .CreatedAtInt =_fceg .CreatedAt .Unix ();return &_fceg ;};
// LicenseKey represents a license key for UniOffice.
type LicenseKey struct{LicenseId string `json:"license_id"`;CustomerId string `json:"customer_id"`;CustomerName string `json:"customer_name"`;Tier string `json:"tier"`;CreatedAt _ab .Time `json:"-"`;CreatedAtInt int64 `json:"created_at"`;ExpiresAt _ab .Time `json:"-"`;ExpiresAtInt int64 `json:"expires_at"`;CreatorName string `json:"creator_name"`;CreatorEmail string `json:"creator_email"`;UniPDF bool `json:"unipdf"`;UniOffice bool `json:"unioffice"`;Trial bool `json:"trial"`;};func (_ad *LicenseKey )isExpired ()bool {return _ad .getExpiryDateToCompare ().After (_ad .ExpiresAt )};func _aeb (_fcc string ,_gg string )([]byte ,error ){_dd :="\u000a\u002b\u000a";_ec :="\u000d\u000a\u002b\r\u000a";_cf :=_ae .Index (_gg ,_dd );if _cf ==-1{_cf =_ae .Index (_gg ,_ec );if _cf ==-1{return nil ,_aed .Errorf ("\u0069\u006e\u0076al\u0069\u0064\u0020\u0069\u006e\u0070\u0075\u0074\u002c \u0073i\u0067n\u0061t\u0075\u0072\u0065\u0020\u0073\u0065\u0070\u0061\u0072\u0061\u0074\u006f\u0072");};};_acd :=_gg [:_cf ];_dg :=_cf +len (_dd );_ef :=_gg [_dg :];if _acd ==""||_ef ==""{return nil ,_aed .Errorf ("\u0069n\u0076\u0061l\u0069\u0064\u0020\u0069n\u0070\u0075\u0074,\u0020\u006d\u0069\u0073\u0073\u0069\u006e\u0067\u0020or\u0069\u0067\u0069n\u0061\u006c \u006f\u0072\u0020\u0073\u0069\u0067n\u0061\u0074u\u0072\u0065");};_ga ,_fg :=_bf .StdEncoding .DecodeString (_acd );if _fg !=nil {return nil ,_aed .Errorf ("\u0069\u006e\u0076\u0061li\u0064\u0020\u0069\u006e\u0070\u0075\u0074\u0020\u006f\u0072\u0069\u0067\u0069\u006ea\u006c");};_da ,_fg :=_bf .StdEncoding .DecodeString (_ef );if _fg !=nil {return nil ,_aed .Errorf ("\u0069\u006e\u0076al\u0069\u0064\u0020\u0069\u006e\u0070\u0075\u0074\u0020\u0073\u0069\u0067\u006e\u0061\u0074\u0075\u0072\u0065");};_cb ,_ :=_ac .Decode ([]byte (_fcc ));if _cb ==nil {return nil ,_aed .Errorf ("\u0050\u0075\u0062\u004b\u0065\u0079\u0020\u0066\u0061\u0069\u006c\u0065\u0064");};_bed ,_fg :=_fd .ParsePKIXPublicKey (_cb .Bytes );if _fg !=nil {return nil ,_fg ;};_cag :=_bed .(*_bc .PublicKey );if _cag ==nil {return nil ,_aed .Errorf ("\u0050u\u0062\u004b\u0065\u0079\u0020\u0063\u006f\u006e\u0076\u0065\u0072s\u0069\u006f\u006e\u0020\u0066\u0061\u0069\u006c\u0065\u0064");};_bdd :=_fa .New ();_bdd .Write (_ga );_baf :=_bdd .Sum (nil );_fg =_bc .VerifyPKCS1v15 (_cag ,_g .SHA512 ,_baf ,_da );if _fg !=nil {return nil ,_fg ;};return _ga ,nil ;};var _bb *_bc .PublicKey ;
2020-08-23 14:15:53 +00:00
2020-11-09 01:00:18 +00:00
// TypeToString returns a string representation of the license type.
2021-01-04 16:11:39 +00:00
func (_dag *LicenseKey )TypeToString ()string {if _dag .Tier ==LicenseTierUnlicensed {return "\u0055\u006e\u006c\u0069\u0063\u0065\u006e\u0073\u0065\u0064";};if _dag .Tier ==LicenseTierCommunity {return "\u0055\u006e\u006c\u0069\u0063\u0065\u006e\u0073\u0065\u0064";};if _dag .Tier ==LicenseTierIndividual ||_dag .Tier =="\u0069\u006e\u0064i\u0065"{return "\u0043\u006f\u006dm\u0065\u0072\u0063\u0069a\u006c\u0020\u004c\u0069\u0063\u0065\u006es\u0065\u0020\u002d\u0020\u0049\u006e\u0064\u0069\u0076\u0069\u0064\u0075\u0061\u006c";};return "\u0043\u006fm\u006d\u0065\u0072\u0063\u0069\u0061\u006c\u0020\u004c\u0069\u0063\u0065\u006e\u0073\u0065\u0020\u002d\u0020\u0042\u0075\u0073\u0069ne\u0073\u0073";};var _gggd =MakeUnlicensedKey ();func _abb (_fca string ,_deee string ,_fe string )(string ,error ){_ge :=_ae .Index (_fe ,_fca );if _ge ==-1{return "",_aed .Errorf ("\u0068\u0065a\u0064\u0065\u0072 \u006e\u006f\u0074\u0020\u0066\u006f\u0075\u006e\u0064");};_ggg :=_ae .Index (_fe ,_deee );if _ggg ==-1{return "",_aed .Errorf ("\u0066\u006fo\u0074\u0065\u0072 \u006e\u006f\u0074\u0020\u0066\u006f\u0075\u006e\u0064");};_gba :=_ge +len (_fca )+1;return _fe [_gba :_ggg -1],nil ;};var _beg =_ab .Date (2010,1,1,0,0,0,0,_ab .UTC );func (_df *LicenseKey )getExpiryDateToCompare ()_ab .Time {if _df .Trial {return _ab .Now ().UTC ();};return _d .ReleasedAt ;};const (LicenseTierUnlicensed ="\u0075\u006e\u006c\u0069\u0063\u0065\u006e\u0073\u0065\u0064";LicenseTierCommunity ="\u0063o\u006d\u006d\u0075\u006e\u0069\u0074y";LicenseTierIndividual ="\u0069\u006e\u0064\u0069\u0076\u0069\u0064\u0075\u0061\u006c";LicenseTierBusiness ="\u0062\u0075\u0073\u0069\u006e\u0065\u0073\u0073";);
// ToString returns a string representing the license information.
func (_gee *LicenseKey )ToString ()string {_acc :=_aed .Sprintf ("\u004ci\u0063e\u006e\u0073\u0065\u0020\u0049\u0064\u003a\u0020\u0025\u0073\u000a",_gee .LicenseId );_acc +=_aed .Sprintf ("\u0043\u0075s\u0074\u006f\u006de\u0072\u0020\u0049\u0064\u003a\u0020\u0025\u0073\u000a",_gee .CustomerId );_acc +=_aed .Sprintf ("\u0043u\u0073t\u006f\u006d\u0065\u0072\u0020N\u0061\u006de\u003a\u0020\u0025\u0073\u000a",_gee .CustomerName );_acc +=_aed .Sprintf ("\u0054i\u0065\u0072\u003a\u0020\u0025\u0073\n",_gee .Tier );_acc +=_aed .Sprintf ("\u0043r\u0065a\u0074\u0065\u0064\u0020\u0041\u0074\u003a\u0020\u0025\u0073\u000a",_d .UtcTimeFormat (_gee .CreatedAt ));_acc +=_aed .Sprintf ("\u0045x\u0070i\u0072\u0065\u0073\u0020\u0041\u0074\u003a\u0020\u0025\u0073\u000a",_d .UtcTimeFormat (_gee .ExpiresAt ));_acc +=_aed .Sprintf ("\u0043\u0072\u0065\u0061\u0074\u006f\u0072\u003a\u0020\u0025\u0073\u0020<\u0025\u0073\u003e\u000a",_gee .CreatorName ,_gee .CreatorEmail );return _acc ;};
2020-08-31 22:58:25 +00:00
2020-12-17 22:07:08 +00:00
// LegacyLicense holds the old-style unioffice license information.
2021-01-04 16:11:39 +00:00
type LegacyLicense struct{Name string ;Signature string `json:",omitempty"`;Expiration _ab .Time ;LicenseType LegacyLicenseType ;};
2020-08-23 14:15:53 +00:00
2021-01-04 16:11:39 +00:00
// Verify verifies a license by checking the license content and signature
// against a public key.
func (_abd LegacyLicense )Verify (pubKey *_bc .PublicKey )error {_aag :=_abd ;_aag .Signature ="";_efe :=_ag .Buffer {};_cgb :=_gb .NewEncoder (&_efe );if _dfb :=_cgb .Encode (_aag );_dfb !=nil {return _dfb ;};_fdg ,_cad :=_ba .DecodeString (_abd .Signature );if _cad !=nil {return _cad ;};_efed :=_fc .Sum256 (_efe .Bytes ());_cad =_bc .VerifyPKCS1v15 (pubKey ,_g .SHA256 ,_efed [:],_fdg );return _cad ;};
2020-08-23 14:15:53 +00:00
2020-12-17 22:07:08 +00:00
// SetLegacyLicenseKey installs a legacy license code. License codes issued prior to June 2019.
// Will be removed at some point in a future major version.
2021-01-04 16:11:39 +00:00
func SetLegacyLicenseKey (s string )error {_eda :=_e .MustCompile ("\u005c\u0073");s =_eda .ReplaceAllString (s ,"");var _gcf _a .Reader ;_gcf =_ae .NewReader (s );_gcf =_bf .NewDecoder (_bf .RawURLEncoding ,_gcf );_gcf ,_dgf :=_bd .NewReader (_gcf );if _dgf !=nil {return _dgf ;};_ggff :=_gb .NewDecoder (_gcf );_fcb :=&LegacyLicense {};if _bfa :=_ggff .Decode (_fcb );_bfa !=nil {return _bfa ;};if _gae :=_fcb .Verify (_bb );_gae !=nil {return _ee .New ("\u006c\u0069\u0063en\u0073\u0065\u0020\u0076\u0061\u006c\u0069\u0064\u0061\u0074\u0069\u006e\u0020\u0065\u0072\u0072\u006f\u0072");};if _fcb .Expiration .Before (_d .ReleasedAt ){return _ee .New ("\u006ci\u0063e\u006e\u0073\u0065\u0020\u0065\u0078\u0070\u0069\u0072\u0065\u0064");};_bbb :=_ab .Now ().UTC ();_abbg :=LicenseKey {};_abbg .CreatedAt =_bbb ;_abbg .CustomerId ="\u004c\u0065\u0067\u0061\u0063\u0079";_abbg .CustomerName =_fcb .Name ;_abbg .Tier =LicenseTierBusiness ;_abbg .ExpiresAt =_fcb .Expiration ;_abbg .CreatorName ="\u0055\u006e\u0069\u0044\u006f\u0063\u0020\u0073\u0075p\u0070\u006f\u0072\u0074";_abbg .CreatorEmail ="\u0073\u0075\u0070\u0070\u006f\u0072\u0074\u0040\u0075\u006e\u0069\u0064o\u0063\u002e\u0069\u006f";_abbg .UniOffice =true ;_gggd =&_abbg ;return nil ;};
2020-08-23 14:15:53 +00:00
2021-01-04 16:11:39 +00:00
// LegacyLicenseType is the type of license
type LegacyLicenseType byte ;func init (){_cdf ,_gc :=_ba .DecodeString (_cdc );if _gc !=nil {_aa .Fatalf ("e\u0072\u0072\u006f\u0072 r\u0065a\u0064\u0069\u006e\u0067\u0020k\u0065\u0079\u003a\u0020\u0025\u0073",_gc );};_add ,_gc :=_fd .ParsePKIXPublicKey (_cdf );if _gc !=nil {_aa .Fatalf ("e\u0072\u0072\u006f\u0072 r\u0065a\u0064\u0069\u006e\u0067\u0020k\u0065\u0079\u003a\u0020\u0025\u0073",_gc );};_bb =_add .(*_bc .PublicKey );};
2020-08-23 14:15:53 +00:00
2021-01-04 16:11:39 +00:00
// IsLicensed returns true if the package is licensed.
func (_aec *LicenseKey )IsLicensed ()bool {return _aec .Tier !=LicenseTierUnlicensed };func _cg (_ed string )(LicenseKey ,error ){var _cdg LicenseKey ;_bcb ,_eb :=_abb (_dc ,_acg ,_ed );if _eb !=nil {return _cdg ,_eb ;};_fec ,_eb :=_aeb (_ea ,_bcb );if _eb !=nil {return _cdg ,_eb ;};_eb =_gb .Unmarshal (_fec ,&_cdg );if _eb !=nil {return _cdg ,_eb ;};_cdg .CreatedAt =_ab .Unix (_cdg .CreatedAtInt ,0);_cdg .ExpiresAt =_ab .Unix (_cdg .ExpiresAtInt ,0);return _cdg ,nil ;};var _dgc =false ;
2020-08-23 14:15:53 +00:00
2020-12-17 22:07:08 +00:00
// Validate returns an error if the licenseis invalid, nil otherwise.
2021-01-04 16:11:39 +00:00
func (_edf *LicenseKey )Validate ()error {if len (_edf .LicenseId )< 10{return _aed .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 (_edf .CustomerId )< 10{return _aed .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 (_edf .CustomerName )< 1{return _aed .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 _beg .After (_edf .CreatedAt ){return _aed .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 _edf .CreatedAt .After (_edf .ExpiresAt ){return _aed .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 _edf .isExpired (){return _aed .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 (_edf .CreatorName )< 1{return _aed .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 (_edf .CreatorEmail )< 1{return _aed .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 !_edf .UniOffice {return _aed .Errorf ("\u0069\u006e\u0076\u0061\u006c\u0069\u0064\u0020\u006c\u0069\u0063\u0065\u006e\u0073\u0065\u003a\u0020\u0054\u0068\u0069s\u0020\u0055\u006e\u0069\u0044\u006f\u0063\u0020\u006be\u0079\u0020\u0069\u0073\u0020\u0069\u006e\u0076\u0061\u006c\u0069\u0064\u0020f\u006f\u0072\u0020\u0055\u006e\u0069O\u0066\u0066\u0069c\u0065\u002e");};return nil ;};
2020-12-17 22:07:08 +00:00
2021-01-04 16:11:39 +00:00
// SetLicenseKey sets and validates the license key.
func SetLicenseKey (content string ,customerName string )error {if _dgc {return nil ;};_fee ,_cdb :=_cg (content );if _cdb !=nil {return _cdb ;};if _ae .ToLower (_fee .CustomerName )!=_ae .ToLower (customerName ){return _aed .Errorf ("\u0063\u0075\u0073\u0074\u006fm\u0065\u0072\u0020\u006e\u0061\u006d\u0065\u0020\u006d\u0069\u0073\u006d\u0061t\u0063\u0068\u002c\u0020\u0065\u0078\u0070\u0065\u0063\u0074\u0065\u0064\u0020\u0027\u0025\u0073\u0027\u002c\u0020\u0062\u0075\u0074\u0020\u0067\u006f\u0074\u0020\u0027\u0025\u0073'",customerName ,_fee .CustomerName );};_cdb =_fee .Validate ();if _cdb !=nil {return _cdb ;};_gggd =&_fee ;return nil ;};const _cdc ="\u0033\u0030\u0035\u0063\u0033\u0030\u0030\u00640\u0036\u0030\u0039\u0032\u0061\u0038\u00364\u0038\u0038\u0036\u0066\u0037\u0030d\u0030\u0031\u0030\u0031\u0030\u00310\u0035\u0030\u0030\u0030\u0033\u0034\u0062\u0030\u0030\u0033\u0030\u00348\u0030\u0032\u0034\u0031\u0030\u0030\u0062\u0038\u0037\u0065\u0061\u0066\u0062\u0036\u0063\u0030\u0037\u0034\u0039\u0039\u0065\u0062\u00397\u0063\u0063\u0039\u0064\u0033\u0035\u0036\u0035\u0065\u0063\u00663\u0031\u0036\u0038\u0031\u0039\u0036\u0033\u0030\u0031\u0039\u0030\u0037c\u0038\u0034\u0031\u0061\u0064\u0064c6\u0036\u0035\u0030\u0038\u0036\u0062\u0062\u0033\u0065\u0064\u0038\u0065\u0062\u0031\u0032\u0064\u0039\u0064\u0061\u0032\u0036\u0063\u0061\u0066\u0061\u0039\u0036\u00345\u0030\u00314\u0036\u0064\u0061\u0038\u0062\u0064\u0030\u0063c\u0066\u0031\u0035\u0035\u0066\u0063a\u0063\u0063\u00368\u0036\u0039\u0035\u0035\u0065\u0066\u0030\u0033\u0030\u0032\u0066\u0061\u0034\u0034\u0061\u0061\u0033\u0065\u0063\u0038\u0039\u0034\u0031\u0037\u0062\u0030\u0032\u0030\u0033\u0030\u0031\u0030\u0030\u0030\u0031";func _fce (_fae string ,_be []byte )(string ,error ){_c ,_ :=_ac .Decode ([]byte (_fae ));if _c ==nil {return "",_aed .Errorf ("\u0050\u0072\u0069\u0076\u004b\u0065\u0079\u0020\u0066a\u0069\u006c\u0065\u0064");};_gd ,_cd :=_fd .ParsePKCS1PrivateKey (_c .Bytes );if _cd !=nil {return "",_cd ;};_bfc :=_fa .New ();_bfc .Write (_be );_ca :=_bfc .Sum (nil );_af ,_cd :=_bc .SignPKCS1v15 (_f .Reader ,_gd ,_g .SHA512 ,_ca );if _cd !=nil {return "",_cd ;};_dee :=_bf .StdEncoding .EncodeToString (_be );_dee +="\u000a\u002b\u000a";_dee +=_bf .StdEncoding .EncodeToString (_af );return _dee ,nil ;};const (_dc ="\u002d\u002d\u002d--\u0042\u0045\u0047\u0049\u004e\u0020\u0055\u004e\u0049D\u004fC\u0020L\u0049C\u0045\u004e\u0053\u0045\u0020\u004b\u0045\u0059\u002d\u002d\u002d\u002d\u002d";_acg ="\u002d\u002d\u002d\u002d\u002d\u0045\u004e\u0044\u0020\u0055\u004e\u0049\u0044\u004f\u0043 \u004cI\u0043\u0045\u004e\u0053\u0045\u0020\u004b\u0045\u0059\u002d\u002d\u002d\u002d\u002d";);