Versions in this module Expand all Collapse all v1 v1.0.0 Jun 7, 2023 Changes in this version + func WithProcessRequestExpectReply(expectReply bool) func(*ProcessRequestOptions) + type Action uint8 + const ActionFetchKey + const ActionHello + const ActionProcess + const ActionSetup + func (a Action) String() string + type ErrorCode uint32 + const ErrorCodeMalformedRequest + const ErrorCodeServerError + const ErrorCodeUnknownClient + const ErrorCodeUnsupportedVersion + type ErrorResponse struct + func NewErrorResponse(errorCode ErrorCode, errorMessage string) ErrorResponse + func ParseErrorResponse(r io.Reader, responseCommon ResponseCommon) (ErrorResponse, error) + func (e ErrorResponse) Bytes() []byte + func (e ErrorResponse) ErrorCode() ErrorCode + func (e ErrorResponse) ErrorMessage() string + type FetchKeyRequest struct + func NewFetchKeyRequest() FetchKeyRequest + type FetchKeyResponse struct + func NewFetchKeyResponse(keyAlgorithm KeyAlgorithm, publicKey []byte) FetchKeyResponse + func ParseFetchKeyResponse(r io.Reader, responseCommon ResponseCommon) (FetchKeyResponse, error) + func (g FetchKeyResponse) Bytes() []byte + func (g FetchKeyResponse) KeyAlgorithm() KeyAlgorithm + func (g FetchKeyResponse) PublicKey() []byte + type HashType uint8 + const HashTypeSHA1 + const HashTypeSHA256 + const HashTypeSHA384 + const HashTypeSHA512 + func NewHashType(h crypto.Hash) HashType + func (h HashType) CryptoHash() crypto.Hash + func (h HashType) String() string + type HelloRequest struct + func NewHelloRequest() HelloRequest + type HelloResponse struct + func NewHelloResponse() HelloResponse + type KeyAlgorithm uint8 + const KeyAlgorithmECDSA + const KeyAlgorithmED25519 + const KeyAlgorithmRSA + func (k KeyAlgorithm) String() string + type ProcessRequest struct + func NewProcessRequest(id [16]byte, message []byte, optFuncs ...func(*ProcessRequestOptions)) ProcessRequest + func ParseProcessRequest(requestCommon RequestCommon, r io.Reader) (ProcessRequest, error) + func (g ProcessRequest) Bytes() []byte + func (g ProcessRequest) ExpectReply() bool + func (g ProcessRequest) ID() [16]byte + func (g ProcessRequest) Message() []byte + type ProcessRequestOptions struct + type ProcessResponse struct + func NewProcessResponse(message []byte) ProcessResponse + func ParseProcessResponse(r io.Reader, responseCommon ResponseCommon) (ProcessResponse, error) + func (g ProcessResponse) Bytes() []byte + func (g ProcessResponse) Message() []byte + type RequestCommon struct + func ParseRequestCommon(r io.Reader) (RequestCommon, error) + func (r RequestCommon) Action() Action + func (r RequestCommon) Bytes() []byte + func (r RequestCommon) Version() Version + type ResponseCommon struct + func ParseResponseCommon(r io.Reader) (ResponseCommon, error) + func (r ResponseCommon) Bytes() []byte + func (r ResponseCommon) Success() bool + type SetupRequest struct + func NewSetupRequest(id [16]byte, publicKey *ecdh.PublicKey) SetupRequest + func ParseSetupRequest(requestCommon RequestCommon, r io.Reader) (SetupRequest, error) + func (s SetupRequest) Bytes() []byte + func (s SetupRequest) ID() [16]byte + func (s SetupRequest) PublicKey() *ecdh.PublicKey + type SetupResponse struct + func NewSetupResponse(publicKey *ecdh.PublicKey) SetupResponse + func ParseSetupResponse(responseCommon ResponseCommon, r io.Reader) (SetupResponse, error) + func (s *SetupResponse) SetSignature(hashType HashType, signature []byte) + func (s SetupResponse) Bytes() []byte + func (s SetupResponse) HashType() HashType + func (s SetupResponse) PublicKey() *ecdh.PublicKey + func (s SetupResponse) Signature() []byte + type Version uint8 + const Version1