Involved Source Files
Package scram implements a SCRAM-{SHA-1,etc} client per RFC5802.
http://tools.ietf.org/html/rfc5802
Package-Level Type Names (only one, which is exported)
/* sort exporteds by: | */
Client implements a SCRAM-* client (SCRAM-SHA-1, SCRAM-SHA-256, etc).
A Client may be used within a SASL conversation with logic resembling:
var in []byte
var client = scram.NewClient(sha1.New, user, pass)
for client.Step(in) {
out := client.Out()
// send out to server
in := serverOut
}
if client.Err() != nil {
// auth failed
}
authMsgbytes.BufferclientNonce[]byteerrerrornewHashfunc() hash.Hashoutbytes.BufferpassstringsaltedPass[]byteserverNonce[]bytestepintuserstring
Err returns the error that occurred, or nil if there were no errors.
Out returns the data to be sent to the server in the current step.
SetNonce sets the client nonce to the provided value.
If not set, the nonce is generated automatically out of crypto/rand on the first step.
Step processes the incoming data from the server and makes the
next round of data for the server available via Client.Out.
Step returns false if there are no errors and more data is
still expected.
(*T) clientProof() []byte(*T) saltPassword(salt []byte, iterCount int)(*T) serverSignature() []byte(*T) step1(in []byte) error(*T) step2(in []byte) error(*T) step3(in []byte) error
func NewClient(newHash func() hash.Hash, user, pass string) *Client
Package-Level Functions (only one, which is exported)
NewClient returns a new SCRAM-* client with the provided hash algorithm.
For SCRAM-SHA-256, for example, use:
client := scram.NewClient(sha256.New, user, pass)
Package-Level Variables (total 2, neither is exported)
The pages are generated with Goldsv0.3.2-preview. (GOOS=darwin GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.