Documentation ¶
Overview ¶
Package keychain is a generated protocol buffer package.
It is generated from these files:
libri/author/keychain/keychain.proto
It has these top-level messages:
StoredKeychain
Index ¶
Constants ¶
View Source
const ( // StandardScryptN is the N parameter of Scrypt encryption algorithm, using 256MB // memory and taking approximately 1s CPU time on a modern processor. StandardScryptN = 1 << 18 // StandardScryptP is the P parameter of Scrypt encryption algorithm, using 256MB // memory and taking approximately 1s CPU time on a modern processor. StandardScryptP = 1 // LightScryptN is the N parameter of Scrypt encryption algorithm, using 4MB // memory and taking approximately 100ms CPU time on a modern processor. LightScryptN = 1 << 12 // LightScryptP is the P parameter of Scrypt encryption algorithm, using 4MB // memory and taking approximately 100ms CPU time on a modern processor. LightScryptP = 6 )
Variables ¶
View Source
var ( // ErrEmptyKeychain indicates no keys in the keychain. ErrEmptyKeychain = errors.New("empty keychain") // ErrUnexpectedMissingKey indicates a unexpectedly missing key ErrUnexpectedMissingKey = errors.New("missing key") )
Functions ¶
Types ¶
type Getter ¶
type Getter interface { // Get returns the key with the given public key, if it exists. Otherwise, it returns nil. // The second return value indicates whether the key is present in the keychain or not. Get(publicKey []byte) (ecid.ID, bool) }
Getter is a collection of ECDSA keys that can be looked up by their public key.
type GetterSampler ¶
GetterSampler and a collection of ECDSA keys that can be both looked up and sampled.
func FromECIDs ¶
func FromECIDs(ecids []ecid.ID) GetterSampler
FromECIDs creates a Getter instance from a map of ECDSA private keys.
func Load ¶
func Load(filepath, auth string) (GetterSampler, error)
Load loads and decrypts a keychain from a file.
func New ¶
func New(n int) GetterSampler
New creates a new (plaintext) Getter with n individual keys.
type Sampler ¶
type Sampler interface { // Sample randomly selects a key from the collection. Sample() (ecid.ID, error) }
Sampler is a collection of ECDSA keys that can be sampled.
type StoredKeychain ¶
type StoredKeychain struct {
PrivateKeys [][]byte `protobuf:"bytes,1,rep,name=privateKeys,proto3" json:"privateKeys,omitempty"`
}
func (*StoredKeychain) Descriptor ¶
func (*StoredKeychain) Descriptor() ([]byte, []int)
func (*StoredKeychain) GetPrivateKeys ¶
func (m *StoredKeychain) GetPrivateKeys() [][]byte
func (*StoredKeychain) ProtoMessage ¶
func (*StoredKeychain) ProtoMessage()
func (*StoredKeychain) Reset ¶
func (m *StoredKeychain) Reset()
func (*StoredKeychain) String ¶
func (m *StoredKeychain) String() string
Click to show internal directories.
Click to hide internal directories.