View Source kpro_scram (kafka_protocol v4.2.2)

This module is a simplified SCRAM client side implementation. SCRAM: Salted Challenge Response Authentication Mechanism. REF: https://tools.ietf.org/html/rfc5802 NOTE: Assumptions made in this implementation 1. User names contain ascii codes only 2. User names do not contain '=' or ','

Summary

Functions

Make client's final message.

Make the fist client message.

Initialize a scram context.

Parse server first message.

Validate server's signature.

Types

scram/0

-opaque scram()

Functions

final(_)

-spec final(scram()) -> binary().

Make client's final message.

first(_)

-spec first(scram()) -> binary().

Make the fist client message.

init(Sha, User, Pass)

-spec init(sha256 | sha512, binary(), binary()) -> scram().

Initialize a scram context.

parse(_, ServerFirstMsg)

-spec parse(scram(), binary()) -> scram().

Parse server first message.

validate(Scram, ServerFinalMsg)

-spec validate(scram(), binary()) -> ok.

Validate server's signature.