Documentation
¶
Index ¶
- Constants
- Variables
- func DecryptKey(sealedSecret *SealedSecret, answers Answers) ([]byte, error)
- func Encode(sealedSecret *SealedSecret) ([]byte, error)
- func ResealWithKey(sealed, secret, key []byte) ([]byte, error)
- func Seal(secret []byte, questions Questions, threshold int) ([]byte, error)
- func Unseal(input []byte, answers Answers) ([]byte, error)
- func UnsealWithKey(input, key []byte) ([]byte, error)
- type Answers
- type Question
- type Questions
- type SealedSecret
- type Share
Constants ¶
View Source
const ( MinQuestions = 2 MaxQuestions = 255 )
Variables ¶
View Source
var ( ErrTooFewQuestions = fmt.Errorf("too few questions, minimum is %d", MinQuestions) ErrTooManyQuestions = fmt.Errorf("too many questions, maximum is %d", MaxQuestions) )
View Source
var ( ErrTooFewAnswers = fmt.Errorf("too few answers, minimum is %d", MinQuestions) ErrTooManyAnswers = fmt.Errorf("too many answers, maximum is %d", MaxQuestions) )
Functions ¶
func DecryptKey ¶ added in v0.2.0
func DecryptKey(sealedSecret *SealedSecret, answers Answers) ([]byte, error)
func Encode ¶ added in v0.2.0
func Encode(sealedSecret *SealedSecret) ([]byte, error)
func ResealWithKey ¶ added in v0.2.0
func UnsealWithKey ¶ added in v0.2.0
Types ¶
type Answers ¶
func NewAnswers ¶
func NewAnswers() Answers
type Questions ¶
func NewQuestions ¶
func NewQuestions() Questions
type SealedSecret ¶
type SealedSecret struct {
Version string `json:"version"`
SealedTimestamp string `json:"sealed_timestamp"`
Encrypted []byte `json:"encrypted"`
}
func Decode ¶
func Decode(buf []byte) (*SealedSecret, error)
Click to show internal directories.
Click to hide internal directories.