Documentation
¶
Index ¶
- Constants
- func DecryptTime(encryptedStr string, machineID string) (int64, error)
- func EncryptTime(ts int64, machineID string) string
- func GetMachineID() (string, error)
- func SignLicense(privateKeyBase64 string, machineID string) (string, error)
- func VerifyLicense(licenseStr string, machineID string) bool
Constants ¶
const PublicKeyStr = "3yUKKkTZq2wXqstDTiUo91+ahuvSkYCL9F5xfdlYTlY="
Variables ¶
This section is empty.
Functions ¶
func DecryptTime ¶
DecryptTime decrypts the obfuscated time string.
func EncryptTime ¶
EncryptTime encrypts a timestamp using the machineID as a salt. Format: Base64( XOR( timestamp_string, machineID_part ) )
func GetMachineID ¶
GetMachineID generates a unique identifier for the machine Priority: UUID > CPU+Disk(Sorted) > Hostname
func SignLicense ¶
SignLicense is a helper for the pay server (though pay server is separate, having it here might be useful if we share code, but we likely won't link this package in pay server to avoid bloating it, but it's fine for reference). The pay server will likely implement its own signing using the private key.
func VerifyLicense ¶
VerifyLicense checks if the license (signature) is valid for the given machineID.
Types ¶
This section is empty.