Documentation
¶
Index ¶
Constants ¶
View Source
const ( RegisterPath = "/register" ValidatePath = "/validate" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LicenseDto ¶
type LicenseServerClient ¶
type LicenseServerClient interface {
Register(licenseKey, serverHost string) error
Validate(licenseKey, serverHost string) (*SignedLicenseToken, error)
}
type LicenseServerClientImpl ¶
type LicenseServerClientImpl struct {
Parent u.ComponentClient
}
func (*LicenseServerClientImpl) Register ¶
func (l *LicenseServerClientImpl) Register(licenseKey, serverHost string) error
func (*LicenseServerClientImpl) Validate ¶
func (l *LicenseServerClientImpl) Validate(licenseKey, serverHost string) (*SignedLicenseToken, error)
type LicenseToken ¶
type LicenseTokenCodec ¶
type LicenseTokenCodec interface {
EncodeLicenseToken(licenseToken LicenseToken) ([]byte, error)
DecodeLicenseToken(payloadBytes []byte) (LicenseToken, error)
}
type LicenseTokenCodecImpl ¶
type LicenseTokenCodecImpl struct{}
func (*LicenseTokenCodecImpl) DecodeLicenseToken ¶
func (c *LicenseTokenCodecImpl) DecodeLicenseToken(payloadBytes []byte) (LicenseToken, error)
func (*LicenseTokenCodecImpl) EncodeLicenseToken ¶
func (c *LicenseTokenCodecImpl) EncodeLicenseToken(licenseToken LicenseToken) ([]byte, error)
type SignedLicenseToken ¶
type SignedLicenseToken struct {
LicenseToken LicenseToken `json:"license_token"`
Signature []byte `json:"signature"`
}
type SignedLicenseTokenService ¶
type SignedLicenseTokenService interface {
SignLicenseToken(privateKey ed25519.PrivateKey, licenseToken LicenseToken) ([]byte, error)
VerifySignedLicenseTokenSignature(publicKey ed25519.PublicKey, signedLicenseToken *SignedLicenseToken) (bool, error)
}
type SignedLicenseTokenServiceImpl ¶
type SignedLicenseTokenServiceImpl struct {
Codec LicenseTokenCodec
BytesSigner u.BytesSigner
}
func (*SignedLicenseTokenServiceImpl) SignLicenseToken ¶
func (s *SignedLicenseTokenServiceImpl) SignLicenseToken(privateKey ed25519.PrivateKey, licenseToken LicenseToken) ([]byte, error)
func (*SignedLicenseTokenServiceImpl) VerifySignedLicenseTokenSignature ¶
func (s *SignedLicenseTokenServiceImpl) VerifySignedLicenseTokenSignature(publicKey ed25519.PublicKey, signedLicenseToken *SignedLicenseToken) (bool, error)
Click to show internal directories.
Click to hide internal directories.