Documentation
¶
Index ¶
- func EncodePrivateKeyToPEM(privateKey *rsa.PrivateKey) []byte
- func EncodePublicKeyToSSH(pubkey *rsa.PublicKey) ([]byte, error)
- func GenerateRSAPrivateKey(size int) (*rsa.PrivateKey, error)
- func GenerateSSHKeyPair(size int) (privkey string, pubkey string, err error)
- func IsBuildError(e error) bool
- func Throw(err error, reason string, vars *V) error
- func WriteKeyfile(keyBytes []byte, saveFileTo string) error
- type BuildError
- type BuildIssue
- type V
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodePrivateKeyToPEM ¶
func EncodePrivateKeyToPEM(privateKey *rsa.PrivateKey) []byte
EncodePrivateKeyToPEM encodes Private Key from RSA to PEM format
func EncodePublicKeyToSSH ¶
EncodePublicKeyToSSH takes a rsa.PublicKey and return bytes suitable for writing to .pub file returns in the format "ssh-rsa ..."
func GenerateRSAPrivateKey ¶
func GenerateRSAPrivateKey(size int) (*rsa.PrivateKey, error)
GenerateRSAPrivateKey creates a RSA Private Key of specified byte size
func GenerateSSHKeyPair ¶
GenerateSSHKeyPair is a small helper function that just returns an SSH key pair of a given size easily
func IsBuildError ¶
IsBuildError is a convenience function to tell you if an Error is a BuildErro
func Throw ¶
Throw creates a build error with some additional information that will be passed to the user.
func WriteKeyfile ¶
WriteKeyfile writes keys to a file
Types ¶
type BuildError ¶
type BuildError []BuildIssue
BuildError represents a chain of build errors
func (BuildError) Bottom ¶
func (b BuildError) Bottom() *BuildIssue
Bottom retrieves the the last element in the build error stack
func (BuildError) Stack ¶
func (b BuildError) Stack(addition BuildError) BuildError
Stack pushes a new Call stack (n) down onto the original Call stack (c)
func (BuildError) String ¶
func (b BuildError) String() string
String implements the stringer interface
func (BuildError) Top ¶
func (b BuildError) Top() *BuildIssue
Top retrieves the the first element in the build error stack
type BuildIssue ¶
BuildIssue is specially crafted error to help in debugging
func (BuildIssue) String ¶
func (b BuildIssue) String() string
String implements the stringer interface