user

package
v1.20.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 15 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServicesURL = "https://api.minecraftservices.com"

Functions

func VerifySignature added in v1.19.3

func VerifySignature(profilePubKey, signature []byte) bool

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

Types

type KeyPairResp

type KeyPairResp struct {
	KeyPair struct {
		PrivateKey string `json:"privateKey"`
		PublicKey  string `json:"publicKey"`
	} `json:"keyPair"`
	PublicKeySignature   string    `json:"publicKeySignature"`
	PublicKeySignatureV2 string    `json:"publicKeySignatureV2"`
	ExpiresAt            time.Time `json:"expiresAt"`
	RefreshedAfter       time.Time `json:"refreshedAfter"`
}

func GetOrFetchKeyPair

func GetOrFetchKeyPair(accessToken string) (KeyPairResp, error)

func (KeyPairResp) WriteTo added in v1.19.2

func (k KeyPairResp) WriteTo(w io.Writer) (int64, error)

type Property added in v1.19.3

type Property struct {
	Name, Value, Signature string
}

func (*Property) ReadFrom added in v1.19.3

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

func (Property) WriteTo added in v1.19.3

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

type PublicKey added in v1.19.3

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

func (*PublicKey) ReadFrom added in v1.19.3

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

func (*PublicKey) Verify added in v1.19.3

func (p *PublicKey) Verify() bool

func (*PublicKey) VerifyMessage added in v1.19.3

func (p *PublicKey) VerifyMessage(hash, signature []byte) error

func (PublicKey) WriteTo added in v1.19.3

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

type Texture added in v1.19.3

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