blob: 020ea574e38dfabd4f756ab99f151e306ff026b5 [file] [log] [blame]
package principal
import (
"encoding/base64"
"veyron.io/veyron/veyron2/security"
)
type BlessingsHandle struct {
Handle int32
PublicKey string
}
func ConvertBlessingsToHandle(blessings security.Blessings, handle int32) *BlessingsHandle {
bytes, err := blessings.PublicKey().MarshalBinary()
if err != nil {
panic(err)
}
return &BlessingsHandle{
Handle: handle,
PublicKey: base64.StdEncoding.EncodeToString(bytes),
}
}