Documentation
¶
Overview ¶
Package qzmq provides backend selection for different build configurations
Package qzmq provides quantum-safe encryption for ZeroMQ
Index ¶
- Variables
- func GetBackendInfo() string
- func IsQuantumEnabled() bool
- func TestPattern(t *testing.T, serverType, clientType SocketType, port int)
- func UpdateKEMFactory()
- func ValidateBackend() error
- func ValidateBackendType(backend BackendType) error
- type AEAD
- type AeadAlgorithm
- type Backend
- type BackendCapabilities
- type BackendType
- type CertificateConfig
- type Ed25519Signer
- func (s *Ed25519Signer) GenerateKey() (SigningKey, error)
- func (s *Ed25519Signer) PublicKeySize() int
- func (s *Ed25519Signer) Sign(sk SigningKey, message []byte) ([]byte, error)
- func (s *Ed25519Signer) SignatureSize() int
- func (s *Ed25519Signer) Verify(pk VerifyingKey, message, signature []byte) bool
- type HashAlgorithm
- type HybridKEM
- func (h *HybridKEM) CiphertextSize() int
- func (h *HybridKEM) Decapsulate(sk PrivateKey, ciphertext []byte) ([]byte, error)
- func (h *HybridKEM) Encapsulate(pk PublicKey) ([]byte, []byte, error)
- func (h *HybridKEM) GenerateKeyPair() (PublicKey, PrivateKey, error)
- func (h *HybridKEM) PrivateKeySize() int
- func (h *HybridKEM) PublicKeySize() int
- func (h *HybridKEM) SharedSecretSize() int
- type HybridMLKEM
- func (h *HybridMLKEM) CiphertextSize() int
- func (h *HybridMLKEM) Decapsulate(sk PrivateKey, ciphertext []byte) ([]byte, error)
- func (h *HybridMLKEM) Encapsulate(pk PublicKey) ([]byte, []byte, error)
- func (h *HybridMLKEM) GenerateKeyPair() (PublicKey, PrivateKey, error)
- func (h *HybridMLKEM) PrivateKeySize() int
- func (h *HybridMLKEM) PublicKeySize() int
- func (h *HybridMLKEM) SharedSecretSize() int
- type KEM
- type KemAlgorithm
- type KeyRotationPolicy
- type MLDSASigner
- type MLKEM768Type
- func (k *MLKEM768Type) CiphertextSize() int
- func (k *MLKEM768Type) Decapsulate(sk PrivateKey, ciphertext []byte) ([]byte, error)
- func (k *MLKEM768Type) Encapsulate(pk PublicKey) ([]byte, []byte, error)
- func (k *MLKEM768Type) GenerateKeyPair() (PublicKey, PrivateKey, error)
- func (k *MLKEM768Type) PrivateKeySize() int
- func (k *MLKEM768Type) PublicKeySize() int
- func (k *MLKEM768Type) SharedSecretSize() int
- type MLKEM1024Type
- func (k *MLKEM1024Type) CiphertextSize() int
- func (k *MLKEM1024Type) Decapsulate(sk PrivateKey, ciphertext []byte) ([]byte, error)
- func (k *MLKEM1024Type) Encapsulate(pk PublicKey) ([]byte, []byte, error)
- func (k *MLKEM1024Type) GenerateKeyPair() (PublicKey, PrivateKey, error)
- func (k *MLKEM1024Type) PrivateKeySize() int
- func (k *MLKEM1024Type) PublicKeySize() int
- func (k *MLKEM1024Type) SharedSecretSize() int
- type Mode
- type Options
- type PrivateKey
- type PublicKey
- type RealMLKEM768
- func (k *RealMLKEM768) CiphertextSize() int
- func (k *RealMLKEM768) Decapsulate(sk PrivateKey, ciphertext []byte) ([]byte, error)
- func (k *RealMLKEM768) Encapsulate(pk PublicKey) ([]byte, []byte, error)
- func (k *RealMLKEM768) GenerateKeyPair() (PublicKey, PrivateKey, error)
- func (k *RealMLKEM768) PrivateKeySize() int
- func (k *RealMLKEM768) PublicKeySize() int
- func (k *RealMLKEM768) SharedSecretSize() int
- type RealMLKEM1024
- func (k *RealMLKEM1024) CiphertextSize() int
- func (k *RealMLKEM1024) Decapsulate(sk PrivateKey, ciphertext []byte) ([]byte, error)
- func (k *RealMLKEM1024) Encapsulate(pk PublicKey) ([]byte, []byte, error)
- func (k *RealMLKEM1024) GenerateKeyPair() (PublicKey, PrivateKey, error)
- func (k *RealMLKEM1024) PrivateKeySize() int
- func (k *RealMLKEM1024) PublicKeySize() int
- func (k *RealMLKEM1024) SharedSecretSize() int
- type SignatureAlgorithm
- type Signer
- type SigningKey
- type Socket
- type SocketMetrics
- type SocketType
- type Stats
- type Suite
- type TestContext
- func (tc *TestContext) AssertMetrics(socket Socket, minMessages, minBytes int)
- func (tc *TestContext) BindSocket(socketType SocketType, port int) Socket
- func (tc *TestContext) Cleanup()
- func (tc *TestContext) ConnectSocket(socketType SocketType, port int) Socket
- func (tc *TestContext) CreatePair(serverType, clientType SocketType, port int) (Socket, Socket)
- func (tc *TestContext) CreateSocket(socketType SocketType) Socket
- func (tc *TestContext) EchoServer(socket Socket, done <-chan struct{})
- func (tc *TestContext) RouterEchoServer(router Socket, done <-chan struct{})
- func (tc *TestContext) SendRecv(sender, receiver Socket, msg []byte)
- type TimeoutConfig
- type Transport
- type VerifyMode
- type VerifyingKey
- type X25519KEM
- func (k *X25519KEM) CiphertextSize() int
- func (k *X25519KEM) Decapsulate(sk PrivateKey, ciphertext []byte) ([]byte, error)
- func (k *X25519KEM) Encapsulate(pk PublicKey) ([]byte, []byte, error)
- func (k *X25519KEM) GenerateKeyPair() (PublicKey, PrivateKey, error)
- func (k *X25519KEM) PrivateKeySize() int
- func (k *X25519KEM) PublicKeySize() int
- func (k *X25519KEM) SharedSecretSize() int
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidOptions = errors.New("invalid options") ErrHandshakeFailed = errors.New("handshake failed") ErrNotConnected = errors.New("not connected") ErrAuthenticationFailed = errors.New("authentication failed") ErrKeyRotationFailed = errors.New("key rotation failed") ErrTimeout = errors.New("operation timed out") )
Errors
Functions ¶
func GetBackendInfo ¶
func GetBackendInfo() string
GetBackendInfo returns information about the current backend
func IsQuantumEnabled ¶
func IsQuantumEnabled() bool
IsQuantumEnabled checks if quantum security features are available
func TestPattern ¶ added in v0.1.3
func TestPattern(t *testing.T, serverType, clientType SocketType, port int)
TestPattern runs a standard test for a socket pattern
func UpdateKEMFactory ¶ added in v0.1.2
func UpdateKEMFactory()
UpdateKEMFactory updates the getKEM function to use real implementations
func ValidateBackend ¶
func ValidateBackend() error
ValidateBackend checks if the selected backend is properly configured
func ValidateBackendType ¶
func ValidateBackendType(backend BackendType) error
ValidateBackendType checks if a specific backend can be used
Types ¶
type AeadAlgorithm ¶
type AeadAlgorithm int
AeadAlgorithm represents AEAD algorithms
const ( AES256GCM AeadAlgorithm = iota ChaCha20Poly1305 )
func (AeadAlgorithm) String ¶
func (a AeadAlgorithm) String() string
String returns the string representation of AeadAlgorithm
type BackendCapabilities ¶
type BackendCapabilities struct {
SupportsQuantum bool
SupportsMulticast bool
SupportsEncryption bool
RequiresCGO bool
RequiresLibrary string
MaxThroughput string
TypicalLatency string
}
BackendCapabilities describes what a backend supports
func GetBackendCapabilities ¶
func GetBackendCapabilities() BackendCapabilities
GetBackendCapabilities returns the capabilities of the current backend
type BackendType ¶
type BackendType string
BackendType represents the available backend implementations
const ( // BackendStub uses in-memory stub (no external dependencies) BackendStub BackendType = "stub" // BackendPebbe uses pebbe/zmq4 (requires libzmq and CGO) BackendPebbe BackendType = "pebbe" // BackendLuxZMQ uses luxfi/zmq (custom Lux implementation) BackendLuxZMQ BackendType = "luxzmq" // BackendCZMQ uses CZMQ (advanced ZeroMQ binding) BackendCZMQ BackendType = "czmq" )
func DetectBackend ¶
func DetectBackend() BackendType
DetectBackend detects which backend to use based on build tags and environment
func SelectBackendForEnvironment ¶
func SelectBackendForEnvironment() BackendType
SelectBackendForEnvironment chooses the best backend for the runtime environment
type CertificateConfig ¶
type CertificateConfig struct {
CACert []byte
ClientCert []byte
ClientKey []byte
ServerCert []byte
ServerKey []byte
VerifyMode VerifyMode
}
CertificateConfig holds certificate settings
type Ed25519Signer ¶ added in v0.1.3
type Ed25519Signer struct{}
Ed25519Signer implements Ed25519 signatures
func (*Ed25519Signer) GenerateKey ¶ added in v0.1.3
func (s *Ed25519Signer) GenerateKey() (SigningKey, error)
func (*Ed25519Signer) PublicKeySize ¶ added in v0.1.3
func (s *Ed25519Signer) PublicKeySize() int
func (*Ed25519Signer) Sign ¶ added in v0.1.3
func (s *Ed25519Signer) Sign(sk SigningKey, message []byte) ([]byte, error)
func (*Ed25519Signer) SignatureSize ¶ added in v0.1.3
func (s *Ed25519Signer) SignatureSize() int
func (*Ed25519Signer) Verify ¶ added in v0.1.3
func (s *Ed25519Signer) Verify(pk VerifyingKey, message, signature []byte) bool
type HashAlgorithm ¶
type HashAlgorithm int
HashAlgorithm represents hash algorithms
const ( SHA256 HashAlgorithm = iota SHA384 SHA512 BLAKE3 )
type HybridKEM ¶
type HybridKEM struct {
// contains filtered or unexported fields
}
HybridKEM combines classical and post-quantum KEMs
func NewHybridKEM ¶
func (*HybridKEM) CiphertextSize ¶
func (*HybridKEM) Decapsulate ¶
func (h *HybridKEM) Decapsulate(sk PrivateKey, ciphertext []byte) ([]byte, error)
func (*HybridKEM) Encapsulate ¶
func (*HybridKEM) GenerateKeyPair ¶
func (h *HybridKEM) GenerateKeyPair() (PublicKey, PrivateKey, error)
func (*HybridKEM) PrivateKeySize ¶
func (*HybridKEM) PublicKeySize ¶
func (*HybridKEM) SharedSecretSize ¶
type HybridMLKEM ¶ added in v0.1.2
type HybridMLKEM struct {
// contains filtered or unexported fields
}
HybridMLKEM implements hybrid X25519 + ML-KEM-768
func NewHybridMLKEM ¶ added in v0.1.2
func NewHybridMLKEM() *HybridMLKEM
func (*HybridMLKEM) CiphertextSize ¶ added in v0.1.2
func (h *HybridMLKEM) CiphertextSize() int
func (*HybridMLKEM) Decapsulate ¶ added in v0.1.2
func (h *HybridMLKEM) Decapsulate(sk PrivateKey, ciphertext []byte) ([]byte, error)
func (*HybridMLKEM) Encapsulate ¶ added in v0.1.2
func (h *HybridMLKEM) Encapsulate(pk PublicKey) ([]byte, []byte, error)
func (*HybridMLKEM) GenerateKeyPair ¶ added in v0.1.2
func (h *HybridMLKEM) GenerateKeyPair() (PublicKey, PrivateKey, error)
func (*HybridMLKEM) PrivateKeySize ¶ added in v0.1.2
func (h *HybridMLKEM) PrivateKeySize() int
func (*HybridMLKEM) PublicKeySize ¶ added in v0.1.2
func (h *HybridMLKEM) PublicKeySize() int
func (*HybridMLKEM) SharedSecretSize ¶ added in v0.1.2
func (h *HybridMLKEM) SharedSecretSize() int
type KEM ¶
type KEM interface {
GenerateKeyPair() (PublicKey, PrivateKey, error)
Encapsulate(pk PublicKey) (ciphertext []byte, sharedSecret []byte, err error)
Decapsulate(sk PrivateKey, ciphertext []byte) (sharedSecret []byte, err error)
PublicKeySize() int
PrivateKeySize() int
CiphertextSize() int
}
KEM interface for key encapsulation
type KemAlgorithm ¶
type KemAlgorithm int
KemAlgorithm represents key encapsulation mechanisms
const ( X25519 KemAlgorithm = iota MLKEM768 MLKEM1024 HybridX25519MLKEM768 HybridX25519MLKEM1024 )
func (KemAlgorithm) String ¶
func (k KemAlgorithm) String() string
String returns the string representation of KemAlgorithm
type KeyRotationPolicy ¶
KeyRotationPolicy defines when to rotate keys
type MLDSASigner ¶ added in v0.1.3
type MLDSASigner struct {
// contains filtered or unexported fields
}
MLDSASigner implements ML-DSA (Dilithium) signatures
func (*MLDSASigner) GenerateKey ¶ added in v0.1.3
func (s *MLDSASigner) GenerateKey() (SigningKey, error)
func (*MLDSASigner) PublicKeySize ¶ added in v0.1.3
func (s *MLDSASigner) PublicKeySize() int
func (*MLDSASigner) Sign ¶ added in v0.1.3
func (s *MLDSASigner) Sign(sk SigningKey, message []byte) ([]byte, error)
func (*MLDSASigner) SignatureSize ¶ added in v0.1.3
func (s *MLDSASigner) SignatureSize() int
func (*MLDSASigner) Verify ¶ added in v0.1.3
func (s *MLDSASigner) Verify(pk VerifyingKey, message, signature []byte) bool
type MLKEM768Type ¶
type MLKEM768Type struct{}
MLKEM768Type implements ML-KEM-768 (stub)
func (*MLKEM768Type) CiphertextSize ¶
func (k *MLKEM768Type) CiphertextSize() int
func (*MLKEM768Type) Decapsulate ¶
func (k *MLKEM768Type) Decapsulate(sk PrivateKey, ciphertext []byte) ([]byte, error)
func (*MLKEM768Type) Encapsulate ¶
func (k *MLKEM768Type) Encapsulate(pk PublicKey) ([]byte, []byte, error)
func (*MLKEM768Type) GenerateKeyPair ¶
func (k *MLKEM768Type) GenerateKeyPair() (PublicKey, PrivateKey, error)
func (*MLKEM768Type) PrivateKeySize ¶
func (k *MLKEM768Type) PrivateKeySize() int
func (*MLKEM768Type) PublicKeySize ¶
func (k *MLKEM768Type) PublicKeySize() int
func (*MLKEM768Type) SharedSecretSize ¶
func (k *MLKEM768Type) SharedSecretSize() int
type MLKEM1024Type ¶
type MLKEM1024Type struct{}
MLKEM1024Type implements ML-KEM-1024 (stub)
func (*MLKEM1024Type) CiphertextSize ¶
func (k *MLKEM1024Type) CiphertextSize() int
func (*MLKEM1024Type) Decapsulate ¶
func (k *MLKEM1024Type) Decapsulate(sk PrivateKey, ciphertext []byte) ([]byte, error)
func (*MLKEM1024Type) Encapsulate ¶
func (k *MLKEM1024Type) Encapsulate(pk PublicKey) ([]byte, []byte, error)
func (*MLKEM1024Type) GenerateKeyPair ¶
func (k *MLKEM1024Type) GenerateKeyPair() (PublicKey, PrivateKey, error)
func (*MLKEM1024Type) PrivateKeySize ¶
func (k *MLKEM1024Type) PrivateKeySize() int
func (*MLKEM1024Type) PublicKeySize ¶
func (k *MLKEM1024Type) PublicKeySize() int
func (*MLKEM1024Type) SharedSecretSize ¶
func (k *MLKEM1024Type) SharedSecretSize() int
type Options ¶
type Options struct {
// Backend selects the ZeroMQ implementation
Backend Backend
// Suite defines the cryptographic algorithms
Suite Suite
// Mode sets the security mode
Mode Mode
// KeyRotation configures automatic key rotation
KeyRotation KeyRotationPolicy
// AntiDoS enables DoS protection
AntiDoS bool
// ZeroRTT enables 0-RTT resumption
ZeroRTT bool
// MaxEarlyData limits 0-RTT data size
MaxEarlyData uint32
// Certificates for authentication
Certificates *CertificateConfig
// Timeouts for operations
Timeouts TimeoutConfig
}
Options configures the QZMQ transport
func ConservativeOptions ¶
func ConservativeOptions() Options
ConservativeOptions returns maximum security options
func DefaultOptions ¶
func DefaultOptions() Options
DefaultOptions returns recommended default options
func PerformanceOptions ¶
func PerformanceOptions() Options
PerformanceOptions returns high-performance options
type PrivateKey ¶
PrivateKey represents a private key
type RealMLKEM768 ¶ added in v0.1.2
type RealMLKEM768 struct{}
RealMLKEM768 implements ML-KEM-768 using the actual FIPS 203 implementation
func (*RealMLKEM768) CiphertextSize ¶ added in v0.1.2
func (k *RealMLKEM768) CiphertextSize() int
func (*RealMLKEM768) Decapsulate ¶ added in v0.1.2
func (k *RealMLKEM768) Decapsulate(sk PrivateKey, ciphertext []byte) ([]byte, error)
func (*RealMLKEM768) Encapsulate ¶ added in v0.1.2
func (k *RealMLKEM768) Encapsulate(pk PublicKey) ([]byte, []byte, error)
func (*RealMLKEM768) GenerateKeyPair ¶ added in v0.1.2
func (k *RealMLKEM768) GenerateKeyPair() (PublicKey, PrivateKey, error)
func (*RealMLKEM768) PrivateKeySize ¶ added in v0.1.2
func (k *RealMLKEM768) PrivateKeySize() int
func (*RealMLKEM768) PublicKeySize ¶ added in v0.1.2
func (k *RealMLKEM768) PublicKeySize() int
func (*RealMLKEM768) SharedSecretSize ¶ added in v0.1.2
func (k *RealMLKEM768) SharedSecretSize() int
type RealMLKEM1024 ¶ added in v0.1.2
type RealMLKEM1024 struct{}
RealMLKEM1024 implements ML-KEM-1024 using the actual FIPS 203 implementation
func (*RealMLKEM1024) CiphertextSize ¶ added in v0.1.2
func (k *RealMLKEM1024) CiphertextSize() int
func (*RealMLKEM1024) Decapsulate ¶ added in v0.1.2
func (k *RealMLKEM1024) Decapsulate(sk PrivateKey, ciphertext []byte) ([]byte, error)
func (*RealMLKEM1024) Encapsulate ¶ added in v0.1.2
func (k *RealMLKEM1024) Encapsulate(pk PublicKey) ([]byte, []byte, error)
func (*RealMLKEM1024) GenerateKeyPair ¶ added in v0.1.2
func (k *RealMLKEM1024) GenerateKeyPair() (PublicKey, PrivateKey, error)
func (*RealMLKEM1024) PrivateKeySize ¶ added in v0.1.2
func (k *RealMLKEM1024) PrivateKeySize() int
func (*RealMLKEM1024) PublicKeySize ¶ added in v0.1.2
func (k *RealMLKEM1024) PublicKeySize() int
func (*RealMLKEM1024) SharedSecretSize ¶ added in v0.1.2
func (k *RealMLKEM1024) SharedSecretSize() int
type SignatureAlgorithm ¶
type SignatureAlgorithm int
SignatureAlgorithm represents signature algorithms
const ( Ed25519 SignatureAlgorithm = iota MLDSA2 MLDSA3 )
func (SignatureAlgorithm) String ¶
func (s SignatureAlgorithm) String() string
String returns the string representation of SignatureAlgorithm
type Signer ¶ added in v0.1.3
type Signer interface {
GenerateKey() (SigningKey, error)
Sign(sk SigningKey, message []byte) ([]byte, error)
Verify(pk VerifyingKey, message, signature []byte) bool
PublicKeySize() int
SignatureSize() int
}
Signer interface for digital signatures
type SigningKey ¶ added in v0.1.3
type SigningKey interface {
Bytes() []byte
Public() VerifyingKey
}
SigningKey represents a signing private key
type Socket ¶
type Socket interface {
// Bind binds the socket to an endpoint
Bind(endpoint string) error
// Connect connects the socket to an endpoint
Connect(endpoint string) error
// Send sends an encrypted message
Send(data []byte) error
// SendMultipart sends a multipart encrypted message
SendMultipart(parts [][]byte) error
// Recv receives and decrypts a message
Recv() ([]byte, error)
// RecvMultipart receives and decrypts a multipart message
RecvMultipart() ([][]byte, error)
// Subscribe sets a subscription filter (SUB sockets only)
Subscribe(filter string) error
// Unsubscribe removes a subscription filter
Unsubscribe(filter string) error
// SetOption sets a socket option
SetOption(name string, value interface{}) error
// GetOption gets a socket option
GetOption(name string) (interface{}, error)
// Close closes the socket
Close() error
// GetMetrics returns socket metrics
GetMetrics() *SocketMetrics
}
Socket represents a QZMQ-secured ZeroMQ socket
type SocketMetrics ¶
type SocketMetrics struct {
MessagesSent uint64
MessagesReceived uint64
BytesSent uint64
BytesReceived uint64
Errors uint64
KeyUpdates uint64
AverageLatency time.Duration
}
SocketMetrics contains per-socket metrics
func NewSocketMetrics ¶
func NewSocketMetrics() *SocketMetrics
NewSocketMetrics creates a new SocketMetrics instance
type SocketType ¶
type SocketType int
SocketType represents ZeroMQ socket types
const ( REQ SocketType = iota // Request REP // Reply DEALER // Dealer ROUTER // Router PUB // Publisher SUB // Subscriber XPUB // Extended publisher XSUB // Extended subscriber PUSH // Push PULL // Pull PAIR // Pair STREAM // Stream )
func (SocketType) String ¶
func (s SocketType) String() string
String returns the string representation of SocketType
type Stats ¶
type Stats struct {
HandshakesCompleted uint64
HandshakesFailed uint64
MessagesEncrypted uint64
MessagesDecrypted uint64
BytesSent uint64
BytesReceived uint64
KeyRotations uint64
AuthFailures uint64
ReplayAttempts uint64
}
Stats contains transport statistics
type Suite ¶
type Suite struct {
KEM KemAlgorithm
Sign SignatureAlgorithm
AEAD AeadAlgorithm
Hash HashAlgorithm
}
Suite defines a cryptographic suite
type TestContext ¶ added in v0.1.3
type TestContext struct {
// contains filtered or unexported fields
}
TestContext provides common test utilities
func NewTestContext ¶ added in v0.1.3
func NewTestContext(t *testing.T, opts Options) *TestContext
NewTestContext creates a new test context
func (*TestContext) AssertMetrics ¶ added in v0.1.3
func (tc *TestContext) AssertMetrics(socket Socket, minMessages, minBytes int)
AssertMetrics checks socket metrics
func (*TestContext) BindSocket ¶ added in v0.1.3
func (tc *TestContext) BindSocket(socketType SocketType, port int) Socket
BindSocket creates, binds, and tracks a socket
func (*TestContext) Cleanup ¶ added in v0.1.3
func (tc *TestContext) Cleanup()
Cleanup closes all tracked sockets and the transport
func (*TestContext) ConnectSocket ¶ added in v0.1.3
func (tc *TestContext) ConnectSocket(socketType SocketType, port int) Socket
ConnectSocket creates, connects, and tracks a socket
func (*TestContext) CreatePair ¶ added in v0.1.3
func (tc *TestContext) CreatePair(serverType, clientType SocketType, port int) (Socket, Socket)
CreatePair creates a connected socket pair
func (*TestContext) CreateSocket ¶ added in v0.1.3
func (tc *TestContext) CreateSocket(socketType SocketType) Socket
CreateSocket creates a socket and tracks it for cleanup
func (*TestContext) EchoServer ¶ added in v0.1.3
func (tc *TestContext) EchoServer(socket Socket, done <-chan struct{})
EchoServer runs a simple echo server in the background
func (*TestContext) RouterEchoServer ¶ added in v0.1.3
func (tc *TestContext) RouterEchoServer(router Socket, done <-chan struct{})
RouterEchoServer runs a router echo server
func (*TestContext) SendRecv ¶ added in v0.1.3
func (tc *TestContext) SendRecv(sender, receiver Socket, msg []byte)
SendRecv performs a send-receive cycle
type TimeoutConfig ¶
TimeoutConfig holds timeout settings
type Transport ¶
type Transport interface {
// NewSocket creates a new QZMQ-secured socket
NewSocket(socketType SocketType) (Socket, error)
// SetOption sets a transport-level option
SetOption(name string, value interface{}) error
// GetOption gets a transport-level option
GetOption(name string) (interface{}, error)
// Close closes the transport and all sockets
Close() error
// Stats returns transport statistics
Stats() *Stats
}
Transport is the main QZMQ transport interface
type VerifyMode ¶
type VerifyMode int
VerifyMode defines certificate verification
const ( VerifyNone VerifyMode = iota VerifyPeer VerifyFailIfNoPeerCert )
type VerifyingKey ¶ added in v0.1.3
type VerifyingKey interface {
Bytes() []byte
}
VerifyingKey represents a verification public key
type X25519KEM ¶
type X25519KEM struct{}
X25519KEM implements X25519 key encapsulation
func (*X25519KEM) CiphertextSize ¶
func (*X25519KEM) Decapsulate ¶
func (k *X25519KEM) Decapsulate(sk PrivateKey, ciphertext []byte) ([]byte, error)
func (*X25519KEM) Encapsulate ¶
func (*X25519KEM) GenerateKeyPair ¶
func (k *X25519KEM) GenerateKeyPair() (PublicKey, PrivateKey, error)