server

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server is a server for TLS.

func New

func New(privateKey string) *Server

New creates a new TLS server.

func (*Server) Decrypt

func (t *Server) Decrypt(cipherbytes []byte) (plainbytes []byte, err error)

Decrypt decrypts the ciphertext with the secret.

func (*Server) Encrypt

func (t *Server) Encrypt(plainbytes []byte) (cipherbytes []byte, err error)

Encrypt encrypts the plaintext with the secret.

func (*Server) GetPrivateKey

func (t *Server) GetPrivateKey() string

GetPrivateKey returns the private key.

func (*Server) GetPublicKey

func (t *Server) GetPublicKey() string

GetPublicKey returns the public key.

func (*Server) GetSecret

func (t *Server) GetSecret() []byte

GetSecret returns the secret.

func (*Server) NegotiateVerify

func (t *Server) NegotiateVerify(hash string) (bool, error)

NegotiateVerify verifies the hash and decrypts the secret.

Jump to

Keyboard shortcuts

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