user

package
v0.0.0-...-c10fe95 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

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 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

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

type Property

type Property struct {
	Name, Value, Signature string
}

func (*Property) ReadFrom

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

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) VerifyMessage

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

func (PublicKey) WriteTo

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

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