auth

package
v0.0.0-...-93368d4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package auth implements functions to deal with x.509 & RSA crypto.

Many, many thanks to #mcdevs from Freenode and it's great documentation: http://wiki.vg/Protocol_Encryption http://wiki.vg/Protocol_FAQ

Index

Constants

View Source
const BaseUrl = "http://session.minecraft.net/game/checkserver.jsp?user=%s&serverId=%s"

Variables

This section is empty.

Functions

func AuthDigest

func AuthDigest(p []byte) string

AuthDigest computes a special SHA-1 digest required for Minecraft web authentication on Premium servers (online-mode=true). Source: http://wiki.vg/Protocol_Encryption#Server

Also many, many thanks to SirCmpwn and his wonderful gist (C#): https://gist.github.com/SirCmpwn/404223052379e82f91e6

func CheckUser

func CheckUser(username, sid string, ss, pk []byte) (res bool, err error)

CheckUser send's a HTTP request to session.minecraft.net to check player's authenticity. Only used by the server when online-mode=true.

func EncryptionBytes

func EncryptionBytes() []byte

EncryptionBytes returns 4 random bytes or nil. Useful for Protocol Encryption (packets 0xFC & 0xFD).

func GenerateKeyPair

func GenerateKeyPair() *rsa.PrivateKey

GenerateKeyPair generates a 1024 bit RSA keypair.

func KeyExchange

func KeyExchange(pub *rsa.PublicKey) []byte

KeyExchange marshals a RSA Public Key in ASN.1 format as defined by x.509 (serialises a public key to DER-encoded PKIX format). See crypto/x509: x509.MarshalPKIXPublicKey.

Types

This section is empty.

Jump to

Keyboard shortcuts

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