Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigToInfo(cfg noise.Config) (*pb.NoiseInfo, error)
- func ConfigToProto(cfg noise.Config) (pb.NoiseProtocol, error)
- func GenerateInitiatorConf(peer *pb.NoiseInfo) (noise.Config, error)
- func GenerateKeyAttestation(ctx context.Context, ident *identity.FullIdentity, info *pb.NoiseInfo) (_ *pb.NoiseKeyAttestation, err error)
- func GenerateServerConf(proto pb.NoiseProtocol, ident *identity.FullIdentity) (noise.Config, error)
- func GenerateSessionAttestation(ctx context.Context, ident *identity.FullIdentity, handshakeHash []byte) (_ *pb.NoiseSessionAttestation, err error)
- func ProtoToConfig(proto pb.NoiseProtocol) (noise.Config, error)
- func ValidateKeyAttestation(ctx context.Context, attestation *pb.NoiseKeyAttestation, ...) (err error)
- func ValidateSessionAttestation(ctx context.Context, attestation *pb.NoiseSessionAttestation, ...) (err error)
- type Config
Constants ¶
const DefaultProto = pb.NoiseProtocol_NOISE_IK_25519_CHACHAPOLY_BLAKE2B
DefaultProto is the protobuf enum value that specifies what noise protocol should be in use.
const Header = "DRPC!N!1"
Header is the drpcmigrate.Header prefix for DRPC over Noise.
Variables ¶
var ( // Error is a noise error class. Error = errs.Class("noise") )
Functions ¶
func ConfigToInfo ¶
ConfigToInfo turns a server-side noise Config into a *pb.NoiseInfo.
func ConfigToProto ¶
func ConfigToProto(cfg noise.Config) (pb.NoiseProtocol, error)
ConfigToProto is the inverse of ProtoToConfig.
func GenerateInitiatorConf ¶
GenerateInitiatorConf makes an initiator noise.Config that talks to the provided peer.
func GenerateKeyAttestation ¶
func GenerateKeyAttestation(ctx context.Context, ident *identity.FullIdentity, info *pb.NoiseInfo) (_ *pb.NoiseKeyAttestation, err error)
GenerateKeyAttestation will sign a given Noise public key using the Node's leaf key and certificate chain, generating a pb.NoiseKeyAttestation.
func GenerateServerConf ¶
func GenerateServerConf(proto pb.NoiseProtocol, ident *identity.FullIdentity) (noise.Config, error)
GenerateServerConf makes a server-side noise.Config from a full identity.
func GenerateSessionAttestation ¶
func GenerateSessionAttestation(ctx context.Context, ident *identity.FullIdentity, handshakeHash []byte) (_ *pb.NoiseSessionAttestation, err error)
GenerateSessionAttestation will sign a given Noise session handshake hash using the Node's leaf key and certificate chain, generating a pb.NoiseSessionAttestation.
func ProtoToConfig ¶
func ProtoToConfig(proto pb.NoiseProtocol) (noise.Config, error)
ProtoToConfig takes a pb.NoiseProtocol and returns a noise.Config that matches.
func ValidateKeyAttestation ¶
func ValidateKeyAttestation(ctx context.Context, attestation *pb.NoiseKeyAttestation, expectedNodeID storj.NodeID) (err error)
ValidateKeyAttestation will confirm that a provided *pb.NoiseKeyAttestation was signed correctly.
func ValidateSessionAttestation ¶
func ValidateSessionAttestation(ctx context.Context, attestation *pb.NoiseSessionAttestation, expectedNodeID storj.NodeID) (err error)
ValidateSessionAttestation will confirm that a provided *pb.NoiseSessionAttestation was signed correctly.