func LoadPub(filename string) (pub stoutbox.PublicKey, ok bool) {
	filename = strings.TrimSpace(filename)
	spub, err := sshkey.LoadPublicKeyFile(filename, true)
	if err != nil {
		return
	}
	if spub.Type != sshkey.KEY_ECDSA {
		return
	} else if spub.Key.(*ecdsa.PublicKey).Curve != elliptic.P521() {
		return
	}
	pub, err = cbecdsa.ECDSAToStoutboxPublic(spub.Key.(*ecdsa.PublicKey))
	if err != nil {
		return
	}
	ok = true
	return
}
LoadPub loads an SSH public key from the filename.
package common
import (
	"bufio"
	"crypto/ecdsa"
	"crypto/elliptic"
	"encoding/pem"
	"fmt"
	"github.com/cryptobox/cbecdsa"
	"github.com/cryptobox/gocryptobox/stoutbox"
	"github.com/gokyle/sshkey"
	"os"
	"path/filepath"
	"strings"
)
var Version = "0.2"
var pemSealed = "STOUTBOX SEALED MESSAGE"
var pemSigned = "STOUTBOX SIGNATURE"
func ReadPrompt(prompt string) (in string, err error) {
	fmt.Printf("%s", prompt)
	rd := bufio.NewReader(os.Stdin)
	line, err := rd.ReadString('\n')
	if err != nil {
		return
	}
	in = strings.TrimSpace(line)
	return
}
func Zero(in []byte) {
	if in == nil {
		return
	}
	inLen := len(in)
	for i := 0; i < inLen; i++ {
		in[i] ^= in[i]
	}
}
func BoxIsShared(box []byte) bool {
	switch box[0] {
	case stoutbox.BoxShared:
		return true
	case stoutbox.BoxSharedSigned:
		return true
	default:
		return false
	}
}
func DefaultKeyFile() string {
	home := os.Getenv("HOME")
	return filepath.Join(home, ".ssh", "id_ecdsa")
}
func armour(box []byte, pemType string) []byte {
	var block pem.Block
	block.Type = pemType
	block.Bytes = box
	block.Headers = make(map[string]string)
	block.Headers["VERSION"] = fmt.Sprintf("%s-%s", stoutbox.VersionString,
		Version)
	return pem.EncodeToMemory(&block)
}
func ArmourCrypt(box []byte) []byte {
	return armour(box, pemSealed)
}
func ArmourSigned(sig []byte) []byte {
	return armour(sig, pemSigned)
}
func unarmour(box []byte, pemType string) ([]byte, bool) {
	blk, _ := pem.Decode(box)
	if blk == nil {
		return nil, false
	} else if blk.Type != pemType {
		return nil, false
	}
	return blk.Bytes, true
}
func UnarmourCrypt(box []byte) ([]byte, bool) {
	return unarmour(box, pemSealed)
}
func UnarmourSigned(box []byte) ([]byte, bool) {
	return unarmour(box, pemSigned)
}