auth

package
v0.0.0-...-18e7427 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifySignature

func VerifySignature(profilePubKey, signature []byte) bool

VerifySignature has the same functional as net.minecraft.world.entity.player.ProfilePublicKey.Data#validateSignature

Types

type Property

type Property struct {
	Name, Value, Signature string
}

func (Property) WriteTo

func (p Property) WriteTo(w io.Writer) (n int64, err error)

type PublicKey

type PublicKey struct {
	ExpiresAt time.Time
	PubKey    *rsa.PublicKey
	Signature []byte
}

func (*PublicKey) ReadFrom

func (p *PublicKey) ReadFrom(r io.Reader) (n int64, err error)

func (*PublicKey) Verify

func (p *PublicKey) Verify() bool

func (*PublicKey) WriteTo

func (p *PublicKey) WriteTo(w io.Writer) (n int64, err error)

type Resp

type Resp struct {
	Name       string
	ID         uuid.UUID
	Properties []Property
}

Resp is the response of authentication

func Encrypt

func Encrypt(conn *net.Conn, name string, profilePubKey *rsa.PublicKey) (*Resp, error)

Encrypt a connection, with authentication

func (*Resp) Texture

func (r *Resp) Texture() (t Texture, err error)

Texture unmarshal the base64 encoded texture of Resp

type Texture

type Texture struct {
	TimeStamp int64     `json:"timestamp"`
	ID        uuid.UUID `json:"profileId"`
	Name      string    `json:"profileName"`
	Textures  struct {
		SKIN, CAPE struct {
			URL string `json:"url"`
		}
	} `json:"textures"`
}

Texture includes player's skin and cape

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL