func (p Purpose) String() string {
	if value, ok := purposeMarshal[p]; ok {
		return value
	}
	return purposeMarshal[PurposeVerify]
}
String returns a human-readable, string representation for a Purpose.
Unrecognized purpose values are assumed to be PurposeVerify.
package key
import (
	"bytes"
	"fmt"
)
type Purpose int
const (
	PurposeVerify Purpose = Purpose(iota)
	PurposeSign
	PurposeEncrypt
	PurposeDecrypt
)
var (
	purposeMarshal = map[Purpose]string{
		PurposeSign:    "sign",
		PurposeVerify:  "verify",
		PurposeEncrypt: "encrypt",
		PurposeDecrypt: "decrypt",
	}
	purposeUnmarshal = map[string]Purpose{
		"sign":    PurposeSign,
		"verify":  PurposeVerify,
		"encrypt": PurposeEncrypt,
		"decrypt": PurposeDecrypt,
	}
)