utils

package
v0.0.0-...-d9604ce Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNetworkPart

func GetNetworkPart(ip string, mask int) string

GetNetworkPart allows to get the network subnet of an ip address : 192.168.1.1/24 => 192.168.1.0 if invalid ip or mask <= 0 return "0.0.0.0" if mask >= 32 return ip

func ParsePrivKey

func ParsePrivKey(AuthKeyFile string) (*rsa.PrivateKey, error)

ParsePrivKey allow to parse a private key file if the path or the content of the file is invalid return an error The function return a pointer of rsa.PrivateKey when valid

func ParsePubKey

func ParsePubKey(AuthPubFile string) (*rsa.PublicKey, error)

ParsePubKey allow to parse a public key file if the path or the content of the file is invalid return an error The function return a pointer of rsa.PublicKey when valid

Types

This section is empty.

Jump to

Keyboard shortcuts

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