Documentation ¶
Index ¶
- func BuildAbsPath(path string) string
- func EncodeRSAPrivateKey(privKey *rsa.PrivateKey) ([]byte, error)
- func EncodeRSAPublicKey(pubKey *rsa.PublicKey) ([]byte, error)
- func FileContents(path string) ([]byte, error)
- func GeneratePrivatePublicKeyPair() (*rsa.PrivateKey, *rsa.PublicKey, error)
- type OSPAFileParameters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildAbsPath ¶
Returns an absolute path from the provided path using the executable as the working directory if the provided path is relative. Otherwise it simply returns the provided path since it's absolute. If we fail to get the path of the executable we panic.
func EncodeRSAPrivateKey ¶
func EncodeRSAPrivateKey(privKey *rsa.PrivateKey) ([]byte, error)
Encodes the RSA private key to a PEM formatted byte slice
func EncodeRSAPublicKey ¶
Encodes the RSA public key to a PEM formatted byte slice
func FileContents ¶
Accepts a relative path (using the executable as the working directory) or an absolute path of a file and opens it while returning the contents.
func GeneratePrivatePublicKeyPair ¶
func GeneratePrivatePublicKeyPair() (*rsa.PrivateKey, *rsa.PublicKey, error)
Generates a RSA private/public key-pair.
Types ¶
type OSPAFileParameters ¶
type OSPAFileParameters struct { ConfigName string ClientDeviceID string ServerIP net.IP ServerPort uint16 EchoIPServer string PrivateKey *rsa.PrivateKey PublicKey *rsa.PublicKey ServerPublicKey *rsa.PublicKey }
func AskClientOSPAFileParameters ¶
func AskClientOSPAFileParameters(serverPublicKey *rsa.PublicKey) (OSPAFileParameters, error)
func (*OSPAFileParameters) Generate ¶
func (fileParam *OSPAFileParameters) Generate() ([]byte, error)
Generates the OSPA YAML file
Click to show internal directories.
Click to hide internal directories.