Documentation
¶
Index ¶
- Constants
- func AppidCheckVal(id, random []byte) []byte
- func BytesCombine(pBytes ...[]byte) []byte
- func BytesXor(a, b []byte) []byte
- func GetSM2PubkeyFromCert(cert *sm2.Certificate) (*sm2.PublicKey, error)
- func PKCS7Padding(origData []byte, blockSize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- func SM4DecryptCBC(key sm4.SM4Key, crypted []byte) []byte
- func SM4EncryptCBC(key sm4.SM4Key, packet []byte) []byte
- func UserIdCheckVal(uid, iv, random []byte) []byte
- type AuthCheckVal
- type AuthData
- type AuthID
- type AuthIndex
- type AuthRandom
- type AuthTables
- type Authorize
- func (this Authorize) CheckId(data *AuthData, pid AuthID) bool
- func (this Authorize) CheckVal(data *AuthData) bool
- func (this Authorize) DecPacket(packet []byte) ([]byte, int)
- func (this Authorize) EncPacket(data []byte) []byte
- func (this Authorize) GenerateAuthData(id AuthID, pubkey []byte) *AuthData
Constants ¶
View Source
const ( AppID = "AZEROTRUSTNETWORKACCESSTOANYONEL" EncOffset = 32 + 32 + 32 + 16 )
View Source
const ( AuthIndexLen = 32 AuthRandomLen = 16 AuthIdLen = 16 AuthCheckValLen = 32 )
Variables ¶
This section is empty.
Functions ¶
func AppidCheckVal ¶
func BytesCombine ¶
func GetSM2PubkeyFromCert ¶ added in v0.0.4
func GetSM2PubkeyFromCert(cert *sm2.Certificate) (*sm2.PublicKey, error)
func PKCS7Padding ¶ added in v0.0.4
func PKCS7UnPadding ¶ added in v0.0.4
func UserIdCheckVal ¶
Types ¶
type AuthCheckVal ¶
type AuthCheckVal [AuthCheckValLen]byte
func (*AuthCheckVal) SetBytes ¶
func (s *AuthCheckVal) SetBytes(data []byte)
type AuthData ¶
type AuthData struct { ClientIndex AuthIndex AppIdChk AuthCheckVal UsrIdChk AuthCheckVal Random AuthRandom }
type AuthIndex ¶ added in v0.0.4
type AuthIndex [AuthIndexLen]byte
type AuthRandom ¶
type AuthRandom [AuthRandomLen]byte
type AuthTables ¶
type AuthTables struct {
// contains filtered or unexported fields
}
func (*AuthTables) Add ¶
func (this *AuthTables) Add(ID AuthID)
func (*AuthTables) Del ¶
func (this *AuthTables) Del(ID AuthID)
func (*AuthTables) Exist ¶
func (this *AuthTables) Exist(ID AuthID) bool
Click to show internal directories.
Click to hide internal directories.