Documentation ¶
Index ¶
- Constants
- func GenerateId() (string, error)
- func GenerateTLS() (serverTLSConf *tls.Config, err error)
- func Hash(raw []byte) ([]byte, error)
- func LoadTLS(key, cert string, doGenOnFail bool) (*tls.Config, error)
- func MarshalPublicKey(x *big.Int, y *big.Int) []byte
- func NewVoucher(badge Badge, expiration time.Duration) (string, error)
- func RawIsHashMatch(raw []byte, hashed []byte) error
- func ToFormattedString(badge Badge) string
- func UnmarshalPublicKey(publicKey []byte) ecdsa.PublicKey
- func ValidateVoucher(publicKey string, voucher string) bool
- func Verify(phs PubHashSig) bool
- type Badge
- type EncodedIdentity
- type PubHashSig
- type VoucherBody
- type VoucherHeader
- type VoucherInfo
Constants ¶
View Source
const (
VoucherVersionId = 1
)
Variables ¶
This section is empty.
Functions ¶
func GenerateId ¶
func GenerateTLS ¶
func RawIsHashMatch ¶
func ToFormattedString ¶
func UnmarshalPublicKey ¶
func ValidateVoucher ¶
func Verify ¶
func Verify(phs PubHashSig) bool
Types ¶
type Badge ¶
type Badge interface { Id() string Nickname() string Sign(data *string) (PubHashSig, error) GenerateVoucher(expiration time.Duration) (string, error) ValidateVoucher(voucher string) bool PublicKey() string EncodeIdentity() EncodedIdentity EncodeIdentityString() string }
func DecodeIdentity ¶
func DecodeIdentity(eid EncodedIdentity) (Badge, error)
func DecodeIdentityString ¶
type EncodedIdentity ¶
type PubHashSig ¶
type VoucherHeader ¶
type VoucherHeader struct {
Version int
}
type VoucherInfo ¶
Click to show internal directories.
Click to hide internal directories.