noise

package
v0.0.0-...-cd54735 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 15 Imported by: 3

Documentation

Index

Constants

DefaultProto is the protobuf enum value that specifies what noise protocol should be in use.

View Source
const Header = "DRPC!N!1"

Header is the drpcmigrate.Header prefix for DRPC over Noise.

Variables

View Source
var (

	// Error is a noise error class.
	Error = errs.Class("noise")
)

Functions

func ConfigToInfo

func ConfigToInfo(cfg noise.Config) (*pb.NoiseInfo, error)

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

func GenerateInitiatorConf(peer *pb.NoiseInfo) (noise.Config, error)

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.

Types

type Config

type Config = noise.Config

Config is useful for noiseconn Conns.

Jump to

Keyboard shortcuts

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