cssl

package
v0.0.2-0...-0d7cfed Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SSL_MODE_SERVER = 0
	SSL_MODE_CLIENT = 1
)
View Source
const (
	SSL_VERIFY_NONE                 uint8 = 0x00
	SSL_VERIFY_PEER                 uint8 = 0x01
	SSL_VERIFY_FAIL_IF_NO_PEER_CERT uint8 = 0x02
	SSL_VERIFY_CLIENT_ONCE          uint8 = 0x04
)
View Source
const (
	SSL_FILETYPE_PEM     = 1
	SSL_FILETYPE_ASN1    = 2
	SSL_FILETYPE_DEFAULT = 3
)
View Source
const (
	SSL_ERROR_NONE             = 0
	SSL_ERROR_SSL              = 1
	SSL_ERROR_WANT_READ        = 2
	SSL_ERROR_WANT_WRITE       = 3
	SSL_ERROR_WANT_X509_LOOKUP = 4
	SSL_ERROR_SYSCALL          = 5
	SSL_ERROR_ZERO_RETURN      = 6
	SSL_ERROR_WANT_CONNECT     = 7
)
View Source
const (
	CSSL_APP_ERR_UNKNOWN      = 0
	CSSL_APP_ERR_EOK          = 1
	CSSL_APP_ERR_WANT_READ    = 2
	CSSL_APP_ERR_WANT_WRITE   = 3
	CSSL_APP_ERR_SYSCALL      = 4
	CSSL_APP_ERR_PEERCLOSE    = 5
	CSSL_APP_ERR_RESOURCES    = 6
	CSSL_APP_ERR_INVALID_ARGS = 7
)
View Source
const (
	NID_X9_62_prime256v1 = 415
)
View Source
const (
	SSL_OP_ALL uint32 = 0x000FFFFF
)

Variables

This section is empty.

Functions

func CSSLAddFdToMap

func CSSLAddFdToMap(fd int, cssl *CSSL)

func CSSLClientConnect

func CSSLClientConnect(cssl *CSSL) uint8

Connect to the SSL server

func CSSLDelete

func CSSLDelete(cssl *CSSL)

Free the CSSL C structures

func CSSLDeleteFdMap

func CSSLDeleteFdMap(fd int)

func CSSLDoHandshake

func CSSLDoHandshake(cssl *CSSL) uint8

SSL Handshake

func CSSLEnablePeerCertValidation

func CSSLEnablePeerCertValidation(cssl *CSSL) bool

Enable peer cert validation

func CSSLGetID

func CSSLGetID(cssl *CSSL) string

func CSSLInit

func CSSLInit()

Function to initialize the SSL Library

func CSSLIsAdmin

func CSSLIsAdmin(ssl *C.struct_ssl_st) bool

func CSSLRead

func CSSLRead(cssl *CSSL) ([]byte, uint, uint8)

SSL Read returns Entire frame as present in buffer

func CSSLReadN

func CSSLReadN(cssl *CSSL, to_read uint) ([]byte, uint, uint8)

SSL Rean N bytes from the buffer

func CSSLSetAdmin

func CSSLSetAdmin(cssl *CSSL)

func CSSLSetAdminMode

func CSSLSetAdminMode(cssl *CSSL)

func CSSLSetAdminPSKCb

func CSSLSetAdminPSKCb(cb CSSLPSKCb)

Set PSK Callback for fetching key from id

func CSSLSetCipher

func CSSLSetCipher(cssl *CSSL, cipher string) bool

Function to set the Cipher from cipher string

func CSSLSetDebug

func CSSLSetDebug(flag bool)

Function to set debug level

func CSSLSetPKIInfoFile

func CSSLSetPKIInfoFile(cssl *CSSL, keypath, certpath string) bool

Set the Private key and Certificate from file

func CSSLSetPSKCb

func CSSLSetPSKCb(cb CSSLPSKCb)

Set PSK Callback for fetching key from id

func CSSLSetPSKClientID

func CSSLSetPSKClientID(cssl *CSSL, id string) bool

func CSSLSetPSKHint

func CSSLSetPSKHint(cssl *CSSL, hint string) bool

Function to set PSK hint

func CSSLSetPrivatekey

func CSSLSetPrivatekey(cssl *CSSL, key *C.struct_evp_pkey_st) bool

Set Private Key

func CSSLSetTrustStoreFile

func CSSLSetTrustStoreFile(cssl *CSSL, certstore string) bool

Set the CA Trust store file

func CSSLStoreID

func CSSLStoreID(cssl *CSSL, id string)

func CSSLTranslateSSLError

func CSSLTranslateSSLError(err uint8) uint8

Translate SSL Error to APP Error

func CSSLWrite

func CSSLWrite(cssl *CSSL, obuff []byte, size uint) uint8

SSL Write

func IsAdmin

func IsAdmin(cssl *CSSL) bool

Types

type CSSL

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

func CSSLGetByFd

func CSSLGetByFd(fd int) *CSSL

func CSSLGetNewClient

func CSSLGetNewClient(fd int) *CSSL

Function to Get new Client SSL binding

func CSSLGetNewServelet

func CSSLGetNewServelet(fd int, cssl *CSSL) (*CSSL, uint8)

Function to get a new SSL servelet

func CSSLGetNewServer

func CSSLGetNewServer(fd int) *CSSL

Function to create a new Server SSL binding

type CSSLPSKCb

type CSSLPSKCb func(id string) string

Jump to

Keyboard shortcuts

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