Documentation
¶
Index ¶
- Variables
- type Envelope
- func (m *Envelope) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *Envelope) CloneVT() *Envelope
- func (this *Envelope) EqualMessageVT(thatMsg any) bool
- func (this *Envelope) EqualVT(that *Envelope) bool
- func (x *Envelope) GetCiphertext() []byte
- func (x *Envelope) GetContents() []byte
- func (x *Envelope) GetContextHash() []byte
- func (x *Envelope) GetEnvelopeId() string
- func (x *Envelope) GetGrants() []*EnvelopeGrant
- func (x *Envelope) GetKeypairs() []*EnvelopeKeypair
- func (x *Envelope) GetThreshold() uint32
- func (x *Envelope) MarshalJSON() ([]byte, error)
- func (x *Envelope) MarshalProtoJSON(s *json.MarshalState)
- func (x *Envelope) MarshalProtoText() string
- func (m *Envelope) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *Envelope) MarshalToVT(dAtA []byte) (int, error)
- func (m *Envelope) MarshalVT() (dAtA []byte, err error)
- func (*Envelope) ProtoMessage()
- func (x *Envelope) Reset()
- func (m *Envelope) SizeVT() (n int)
- func (x *Envelope) String() string
- func (x *Envelope) UnmarshalJSON(b []byte) error
- func (x *Envelope) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *Envelope) UnmarshalVT(dAtA []byte) error
- type EnvelopeConfig
- func (m *EnvelopeConfig) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *EnvelopeConfig) CloneVT() *EnvelopeConfig
- func (this *EnvelopeConfig) EqualMessageVT(thatMsg any) bool
- func (this *EnvelopeConfig) EqualVT(that *EnvelopeConfig) bool
- func (x *EnvelopeConfig) GetEnvelopeId() string
- func (x *EnvelopeConfig) GetGrantConfigs() []*EnvelopeGrantConfig
- func (x *EnvelopeConfig) GetThreshold() uint32
- func (x *EnvelopeConfig) GetTotalShares() uint32
- func (x *EnvelopeConfig) MarshalJSON() ([]byte, error)
- func (x *EnvelopeConfig) MarshalProtoJSON(s *json.MarshalState)
- func (x *EnvelopeConfig) MarshalProtoText() string
- func (m *EnvelopeConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *EnvelopeConfig) MarshalToVT(dAtA []byte) (int, error)
- func (m *EnvelopeConfig) MarshalVT() (dAtA []byte, err error)
- func (*EnvelopeConfig) ProtoMessage()
- func (x *EnvelopeConfig) Reset()
- func (m *EnvelopeConfig) SizeVT() (n int)
- func (x *EnvelopeConfig) String() string
- func (x *EnvelopeConfig) UnmarshalJSON(b []byte) error
- func (x *EnvelopeConfig) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *EnvelopeConfig) UnmarshalVT(dAtA []byte) error
- type EnvelopeGrant
- func (m *EnvelopeGrant) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *EnvelopeGrant) CloneVT() *EnvelopeGrant
- func (this *EnvelopeGrant) EqualMessageVT(thatMsg any) bool
- func (this *EnvelopeGrant) EqualVT(that *EnvelopeGrant) bool
- func (x *EnvelopeGrant) GetCiphertexts() [][]byte
- func (x *EnvelopeGrant) GetKeypairIndexes() []uint32
- func (x *EnvelopeGrant) MarshalJSON() ([]byte, error)
- func (x *EnvelopeGrant) MarshalProtoJSON(s *json.MarshalState)
- func (x *EnvelopeGrant) MarshalProtoText() string
- func (m *EnvelopeGrant) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *EnvelopeGrant) MarshalToVT(dAtA []byte) (int, error)
- func (m *EnvelopeGrant) MarshalVT() (dAtA []byte, err error)
- func (*EnvelopeGrant) ProtoMessage()
- func (x *EnvelopeGrant) Reset()
- func (m *EnvelopeGrant) SizeVT() (n int)
- func (x *EnvelopeGrant) String() string
- func (x *EnvelopeGrant) UnmarshalJSON(b []byte) error
- func (x *EnvelopeGrant) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *EnvelopeGrant) UnmarshalVT(dAtA []byte) error
- type EnvelopeGrantConfig
- func (m *EnvelopeGrantConfig) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *EnvelopeGrantConfig) CloneVT() *EnvelopeGrantConfig
- func (this *EnvelopeGrantConfig) EqualMessageVT(thatMsg any) bool
- func (this *EnvelopeGrantConfig) EqualVT(that *EnvelopeGrantConfig) bool
- func (x *EnvelopeGrantConfig) GetKeypairIndexes() []uint32
- func (x *EnvelopeGrantConfig) GetShareCount() uint32
- func (x *EnvelopeGrantConfig) MarshalJSON() ([]byte, error)
- func (x *EnvelopeGrantConfig) MarshalProtoJSON(s *json.MarshalState)
- func (x *EnvelopeGrantConfig) MarshalProtoText() string
- func (m *EnvelopeGrantConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *EnvelopeGrantConfig) MarshalToVT(dAtA []byte) (int, error)
- func (m *EnvelopeGrantConfig) MarshalVT() (dAtA []byte, err error)
- func (*EnvelopeGrantConfig) ProtoMessage()
- func (x *EnvelopeGrantConfig) Reset()
- func (m *EnvelopeGrantConfig) SizeVT() (n int)
- func (x *EnvelopeGrantConfig) String() string
- func (x *EnvelopeGrantConfig) UnmarshalJSON(b []byte) error
- func (x *EnvelopeGrantConfig) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *EnvelopeGrantConfig) UnmarshalVT(dAtA []byte) error
- type EnvelopeGrantInner
- func (m *EnvelopeGrantInner) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *EnvelopeGrantInner) CloneVT() *EnvelopeGrantInner
- func (this *EnvelopeGrantInner) EqualMessageVT(thatMsg any) bool
- func (this *EnvelopeGrantInner) EqualVT(that *EnvelopeGrantInner) bool
- func (x *EnvelopeGrantInner) GetShares() []*EnvelopeShare
- func (x *EnvelopeGrantInner) MarshalJSON() ([]byte, error)
- func (x *EnvelopeGrantInner) MarshalProtoJSON(s *json.MarshalState)
- func (x *EnvelopeGrantInner) MarshalProtoText() string
- func (m *EnvelopeGrantInner) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *EnvelopeGrantInner) MarshalToVT(dAtA []byte) (int, error)
- func (m *EnvelopeGrantInner) MarshalVT() (dAtA []byte, err error)
- func (*EnvelopeGrantInner) ProtoMessage()
- func (x *EnvelopeGrantInner) Reset()
- func (m *EnvelopeGrantInner) SizeVT() (n int)
- func (x *EnvelopeGrantInner) String() string
- func (x *EnvelopeGrantInner) UnmarshalJSON(b []byte) error
- func (x *EnvelopeGrantInner) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *EnvelopeGrantInner) UnmarshalVT(dAtA []byte) error
- type EnvelopeKeypair
- func (m *EnvelopeKeypair) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *EnvelopeKeypair) CloneVT() *EnvelopeKeypair
- func (this *EnvelopeKeypair) EqualMessageVT(thatMsg any) bool
- func (this *EnvelopeKeypair) EqualVT(that *EnvelopeKeypair) bool
- func (x *EnvelopeKeypair) GetAuthMethodId() string
- func (x *EnvelopeKeypair) GetAuthMethodParams() []byte
- func (x *EnvelopeKeypair) GetPubKey() []byte
- func (x *EnvelopeKeypair) MarshalJSON() ([]byte, error)
- func (x *EnvelopeKeypair) MarshalProtoJSON(s *json.MarshalState)
- func (x *EnvelopeKeypair) MarshalProtoText() string
- func (m *EnvelopeKeypair) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *EnvelopeKeypair) MarshalToVT(dAtA []byte) (int, error)
- func (m *EnvelopeKeypair) MarshalVT() (dAtA []byte, err error)
- func (*EnvelopeKeypair) ProtoMessage()
- func (x *EnvelopeKeypair) Reset()
- func (m *EnvelopeKeypair) SizeVT() (n int)
- func (x *EnvelopeKeypair) String() string
- func (x *EnvelopeKeypair) UnmarshalJSON(b []byte) error
- func (x *EnvelopeKeypair) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *EnvelopeKeypair) UnmarshalVT(dAtA []byte) error
- type EnvelopeShare
- func (m *EnvelopeShare) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *EnvelopeShare) CloneVT() *EnvelopeShare
- func (this *EnvelopeShare) EqualMessageVT(thatMsg any) bool
- func (this *EnvelopeShare) EqualVT(that *EnvelopeShare) bool
- func (x *EnvelopeShare) GetId() []byte
- func (x *EnvelopeShare) GetValue() []byte
- func (x *EnvelopeShare) MarshalJSON() ([]byte, error)
- func (x *EnvelopeShare) MarshalProtoJSON(s *json.MarshalState)
- func (x *EnvelopeShare) MarshalProtoText() string
- func (m *EnvelopeShare) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *EnvelopeShare) MarshalToVT(dAtA []byte) (int, error)
- func (m *EnvelopeShare) MarshalVT() (dAtA []byte, err error)
- func (*EnvelopeShare) ProtoMessage()
- func (x *EnvelopeShare) Reset()
- func (m *EnvelopeShare) SizeVT() (n int)
- func (x *EnvelopeShare) String() string
- func (x *EnvelopeShare) UnmarshalJSON(b []byte) error
- func (x *EnvelopeShare) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *EnvelopeShare) UnmarshalVT(dAtA []byte) error
- type EnvelopeUnlockResult
- func (m *EnvelopeUnlockResult) CloneMessageVT() protobuf_go_lite.CloneMessage
- func (m *EnvelopeUnlockResult) CloneVT() *EnvelopeUnlockResult
- func (this *EnvelopeUnlockResult) EqualMessageVT(thatMsg any) bool
- func (this *EnvelopeUnlockResult) EqualVT(that *EnvelopeUnlockResult) bool
- func (x *EnvelopeUnlockResult) GetSharesAvailable() uint32
- func (x *EnvelopeUnlockResult) GetSharesNeeded() uint32
- func (x *EnvelopeUnlockResult) GetSuccess() bool
- func (x *EnvelopeUnlockResult) GetUnlockedGrantIndexes() []uint32
- func (x *EnvelopeUnlockResult) MarshalJSON() ([]byte, error)
- func (x *EnvelopeUnlockResult) MarshalProtoJSON(s *json.MarshalState)
- func (x *EnvelopeUnlockResult) MarshalProtoText() string
- func (m *EnvelopeUnlockResult) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *EnvelopeUnlockResult) MarshalToVT(dAtA []byte) (int, error)
- func (m *EnvelopeUnlockResult) MarshalVT() (dAtA []byte, err error)
- func (*EnvelopeUnlockResult) ProtoMessage()
- func (x *EnvelopeUnlockResult) Reset()
- func (m *EnvelopeUnlockResult) SizeVT() (n int)
- func (x *EnvelopeUnlockResult) String() string
- func (x *EnvelopeUnlockResult) UnmarshalJSON(b []byte) error
- func (x *EnvelopeUnlockResult) UnmarshalProtoJSON(s *json.UnmarshalState)
- func (m *EnvelopeUnlockResult) UnmarshalVT(dAtA []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoGrants = errors.New("envelope has no grants") ErrNoKeypairs = errors.New("envelope has no keypairs") ErrInvalidThreshold = errors.New("invalid threshold configuration") ErrContextMismatch = errors.New("envelope context does not match expected context") ErrInvalidKeypairIndex = errors.New("keypair index out of range") ErrEmptyPayload = errors.New("payload is empty") ErrDecryptionFailed = errors.New("envelope decryption failed") )
Functions ¶
This section is empty.
Types ¶
type Envelope ¶
type Envelope struct {
// EnvelopeId is the unique identifier of the envelope.
// If empty when building, generated from hash of secret + context.
EnvelopeId string `protobuf:"bytes,1,opt,name=envelope_id,json=envelopeId,proto3" json:"envelopeId,omitempty"`
// ContextHash is the BLAKE3 hash of the context string.
// Used to verify the envelope matches the expected application context.
ContextHash []byte `protobuf:"bytes,2,opt,name=context_hash,json=contextHash,proto3" json:"contextHash,omitempty"`
// Threshold is the CIRCL threshold parameter.
// Recovery requires threshold+1 shares.
// If zero, any single share suffices (no secret splitting).
Threshold uint32 `protobuf:"varint,3,opt,name=threshold,proto3" json:"threshold,omitempty"`
// Ciphertext is the encrypted payload.
// Encrypted with XChaCha20-Poly1305 using a key derived from the scalar.
Ciphertext []byte `protobuf:"bytes,4,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"`
// Grants is the list of encrypted share bundles.
Grants []*EnvelopeGrant `protobuf:"bytes,5,rep,name=grants,proto3" json:"grants,omitempty"`
// Keypairs is the list of public keys used to encrypt grants.
Keypairs []*EnvelopeKeypair `protobuf:"bytes,6,rep,name=keypairs,proto3" json:"keypairs,omitempty"`
// Contents is an optional plaintext description of what the envelope contains.
// Application-specific; not used in the unlock process.
Contents []byte `protobuf:"bytes,7,opt,name=contents,proto3" json:"contents,omitempty"`
// contains filtered or unexported fields
}
Envelope contains an encrypted message unlockable via secret sharing.
The message is encrypted with a key derived from a Ristretto255 scalar. The scalar is split into shares distributed across Grants. At least threshold+1 shares are needed to reconstruct the scalar.
func BuildEnvelope ¶
func BuildEnvelope( rnd io.Reader, context string, payload []byte, keypairs []crypto.PubKey, config *EnvelopeConfig, ) (*Envelope, error)
BuildEnvelope creates a new sealed Envelope from a plaintext payload.
The payload is encrypted with XChaCha20-Poly1305 using a key derived from a Ristretto255 scalar. The scalar is split into Shamir shares and distributed across grants, each encrypted to the specified keypairs.
Context must be the same string when calling UnlockEnvelope.
func (*Envelope) CloneMessageVT ¶
func (m *Envelope) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*Envelope) EqualMessageVT ¶
func (*Envelope) GetCiphertext ¶
func (*Envelope) GetContents ¶
func (*Envelope) GetContextHash ¶
func (*Envelope) GetEnvelopeId ¶
func (*Envelope) GetGrants ¶
func (x *Envelope) GetGrants() []*EnvelopeGrant
func (*Envelope) GetKeypairs ¶
func (x *Envelope) GetKeypairs() []*EnvelopeKeypair
func (*Envelope) GetThreshold ¶
func (*Envelope) MarshalJSON ¶
MarshalJSON marshals the Envelope to JSON.
func (*Envelope) MarshalProtoJSON ¶
func (x *Envelope) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the Envelope message to JSON.
func (*Envelope) MarshalProtoText ¶
func (*Envelope) MarshalToSizedBufferVT ¶
func (*Envelope) ProtoMessage ¶
func (*Envelope) ProtoMessage()
func (*Envelope) UnmarshalJSON ¶
UnmarshalJSON unmarshals the Envelope from JSON.
func (*Envelope) UnmarshalProtoJSON ¶
func (x *Envelope) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the Envelope message from JSON.
func (*Envelope) UnmarshalVT ¶
type EnvelopeConfig ¶
type EnvelopeConfig struct {
// EnvelopeId is the unique identifier. If empty, auto-generated.
EnvelopeId string `protobuf:"bytes,1,opt,name=envelope_id,json=envelopeId,proto3" json:"envelopeId,omitempty"`
// Threshold is the CIRCL threshold parameter (need threshold+1 shares).
// If zero, any single share suffices.
Threshold uint32 `protobuf:"varint,2,opt,name=threshold,proto3" json:"threshold,omitempty"`
// If zero, defaults to sum of shares across all grant configs.
TotalShares uint32 `protobuf:"varint,3,opt,name=total_shares,json=totalShares,proto3" json:"totalShares,omitempty"`
// GrantConfigs defines how shares are distributed across grants.
GrantConfigs []*EnvelopeGrantConfig `protobuf:"bytes,4,rep,name=grant_configs,json=grantConfigs,proto3" json:"grantConfigs,omitempty"`
// contains filtered or unexported fields
}
EnvelopeConfig is the configuration for building an envelope.
func (*EnvelopeConfig) CloneMessageVT ¶
func (m *EnvelopeConfig) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*EnvelopeConfig) CloneVT ¶
func (m *EnvelopeConfig) CloneVT() *EnvelopeConfig
func (*EnvelopeConfig) EqualMessageVT ¶
func (this *EnvelopeConfig) EqualMessageVT(thatMsg any) bool
func (*EnvelopeConfig) EqualVT ¶
func (this *EnvelopeConfig) EqualVT(that *EnvelopeConfig) bool
func (*EnvelopeConfig) GetEnvelopeId ¶
func (x *EnvelopeConfig) GetEnvelopeId() string
func (*EnvelopeConfig) GetGrantConfigs ¶
func (x *EnvelopeConfig) GetGrantConfigs() []*EnvelopeGrantConfig
func (*EnvelopeConfig) GetThreshold ¶
func (x *EnvelopeConfig) GetThreshold() uint32
func (*EnvelopeConfig) GetTotalShares ¶
func (x *EnvelopeConfig) GetTotalShares() uint32
func (*EnvelopeConfig) MarshalJSON ¶
func (x *EnvelopeConfig) MarshalJSON() ([]byte, error)
MarshalJSON marshals the EnvelopeConfig to JSON.
func (*EnvelopeConfig) MarshalProtoJSON ¶
func (x *EnvelopeConfig) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the EnvelopeConfig message to JSON.
func (*EnvelopeConfig) MarshalProtoText ¶
func (x *EnvelopeConfig) MarshalProtoText() string
func (*EnvelopeConfig) MarshalToSizedBufferVT ¶
func (m *EnvelopeConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*EnvelopeConfig) MarshalToVT ¶
func (m *EnvelopeConfig) MarshalToVT(dAtA []byte) (int, error)
func (*EnvelopeConfig) MarshalVT ¶
func (m *EnvelopeConfig) MarshalVT() (dAtA []byte, err error)
func (*EnvelopeConfig) ProtoMessage ¶
func (*EnvelopeConfig) ProtoMessage()
func (*EnvelopeConfig) Reset ¶
func (x *EnvelopeConfig) Reset()
func (*EnvelopeConfig) SizeVT ¶
func (m *EnvelopeConfig) SizeVT() (n int)
func (*EnvelopeConfig) String ¶
func (x *EnvelopeConfig) String() string
func (*EnvelopeConfig) UnmarshalJSON ¶
func (x *EnvelopeConfig) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the EnvelopeConfig from JSON.
func (*EnvelopeConfig) UnmarshalProtoJSON ¶
func (x *EnvelopeConfig) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the EnvelopeConfig message from JSON.
func (*EnvelopeConfig) UnmarshalVT ¶
func (m *EnvelopeConfig) UnmarshalVT(dAtA []byte) error
type EnvelopeGrant ¶
type EnvelopeGrant struct {
// KeypairIndexes lists which keypairs can decrypt this grant.
// Each value is an index into the Envelope.keypairs list.
KeypairIndexes []uint32 `protobuf:"varint,1,rep,packed,name=keypair_indexes,json=keypairIndexes,proto3" json:"keypairIndexes,omitempty"`
// Ciphertexts contains the encrypted EnvelopeGrantInner.
// One ciphertext per keypair index, in the same order.
// Each encrypted with peer.EncryptToPubKey to the corresponding keypair.
Ciphertexts [][]byte `protobuf:"bytes,2,rep,name=ciphertexts,proto3" json:"ciphertexts,omitempty"`
// contains filtered or unexported fields
}
EnvelopeGrant is an encrypted bundle of shares. The grant ciphertext contains a marshaled EnvelopeGrantInner. Encrypted to one or more keypairs in the Envelope keypairs list.
func (*EnvelopeGrant) CloneMessageVT ¶
func (m *EnvelopeGrant) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*EnvelopeGrant) CloneVT ¶
func (m *EnvelopeGrant) CloneVT() *EnvelopeGrant
func (*EnvelopeGrant) EqualMessageVT ¶
func (this *EnvelopeGrant) EqualMessageVT(thatMsg any) bool
func (*EnvelopeGrant) EqualVT ¶
func (this *EnvelopeGrant) EqualVT(that *EnvelopeGrant) bool
func (*EnvelopeGrant) GetCiphertexts ¶
func (x *EnvelopeGrant) GetCiphertexts() [][]byte
func (*EnvelopeGrant) GetKeypairIndexes ¶
func (x *EnvelopeGrant) GetKeypairIndexes() []uint32
func (*EnvelopeGrant) MarshalJSON ¶
func (x *EnvelopeGrant) MarshalJSON() ([]byte, error)
MarshalJSON marshals the EnvelopeGrant to JSON.
func (*EnvelopeGrant) MarshalProtoJSON ¶
func (x *EnvelopeGrant) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the EnvelopeGrant message to JSON.
func (*EnvelopeGrant) MarshalProtoText ¶
func (x *EnvelopeGrant) MarshalProtoText() string
func (*EnvelopeGrant) MarshalToSizedBufferVT ¶
func (m *EnvelopeGrant) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*EnvelopeGrant) MarshalToVT ¶
func (m *EnvelopeGrant) MarshalToVT(dAtA []byte) (int, error)
func (*EnvelopeGrant) MarshalVT ¶
func (m *EnvelopeGrant) MarshalVT() (dAtA []byte, err error)
func (*EnvelopeGrant) ProtoMessage ¶
func (*EnvelopeGrant) ProtoMessage()
func (*EnvelopeGrant) Reset ¶
func (x *EnvelopeGrant) Reset()
func (*EnvelopeGrant) SizeVT ¶
func (m *EnvelopeGrant) SizeVT() (n int)
func (*EnvelopeGrant) String ¶
func (x *EnvelopeGrant) String() string
func (*EnvelopeGrant) UnmarshalJSON ¶
func (x *EnvelopeGrant) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the EnvelopeGrant from JSON.
func (*EnvelopeGrant) UnmarshalProtoJSON ¶
func (x *EnvelopeGrant) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the EnvelopeGrant message from JSON.
func (*EnvelopeGrant) UnmarshalVT ¶
func (m *EnvelopeGrant) UnmarshalVT(dAtA []byte) error
type EnvelopeGrantConfig ¶
type EnvelopeGrantConfig struct {
// If zero, defaults to 1.
ShareCount uint32 `protobuf:"varint,1,opt,name=share_count,json=shareCount,proto3" json:"shareCount,omitempty"`
// KeypairIndexes lists which keypairs can decrypt this grant.
// Indexes into the keypairs list provided to BuildEnvelope.
KeypairIndexes []uint32 `protobuf:"varint,2,rep,packed,name=keypair_indexes,json=keypairIndexes,proto3" json:"keypairIndexes,omitempty"`
// contains filtered or unexported fields
}
EnvelopeGrantConfig configures a single grant in the envelope.
func (*EnvelopeGrantConfig) CloneMessageVT ¶
func (m *EnvelopeGrantConfig) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*EnvelopeGrantConfig) CloneVT ¶
func (m *EnvelopeGrantConfig) CloneVT() *EnvelopeGrantConfig
func (*EnvelopeGrantConfig) EqualMessageVT ¶
func (this *EnvelopeGrantConfig) EqualMessageVT(thatMsg any) bool
func (*EnvelopeGrantConfig) EqualVT ¶
func (this *EnvelopeGrantConfig) EqualVT(that *EnvelopeGrantConfig) bool
func (*EnvelopeGrantConfig) GetKeypairIndexes ¶
func (x *EnvelopeGrantConfig) GetKeypairIndexes() []uint32
func (*EnvelopeGrantConfig) GetShareCount ¶
func (x *EnvelopeGrantConfig) GetShareCount() uint32
func (*EnvelopeGrantConfig) MarshalJSON ¶
func (x *EnvelopeGrantConfig) MarshalJSON() ([]byte, error)
MarshalJSON marshals the EnvelopeGrantConfig to JSON.
func (*EnvelopeGrantConfig) MarshalProtoJSON ¶
func (x *EnvelopeGrantConfig) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the EnvelopeGrantConfig message to JSON.
func (*EnvelopeGrantConfig) MarshalProtoText ¶
func (x *EnvelopeGrantConfig) MarshalProtoText() string
func (*EnvelopeGrantConfig) MarshalToSizedBufferVT ¶
func (m *EnvelopeGrantConfig) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*EnvelopeGrantConfig) MarshalToVT ¶
func (m *EnvelopeGrantConfig) MarshalToVT(dAtA []byte) (int, error)
func (*EnvelopeGrantConfig) MarshalVT ¶
func (m *EnvelopeGrantConfig) MarshalVT() (dAtA []byte, err error)
func (*EnvelopeGrantConfig) ProtoMessage ¶
func (*EnvelopeGrantConfig) ProtoMessage()
func (*EnvelopeGrantConfig) Reset ¶
func (x *EnvelopeGrantConfig) Reset()
func (*EnvelopeGrantConfig) SizeVT ¶
func (m *EnvelopeGrantConfig) SizeVT() (n int)
func (*EnvelopeGrantConfig) String ¶
func (x *EnvelopeGrantConfig) String() string
func (*EnvelopeGrantConfig) UnmarshalJSON ¶
func (x *EnvelopeGrantConfig) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the EnvelopeGrantConfig from JSON.
func (*EnvelopeGrantConfig) UnmarshalProtoJSON ¶
func (x *EnvelopeGrantConfig) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the EnvelopeGrantConfig message from JSON.
func (*EnvelopeGrantConfig) UnmarshalVT ¶
func (m *EnvelopeGrantConfig) UnmarshalVT(dAtA []byte) error
type EnvelopeGrantInner ¶
type EnvelopeGrantInner struct {
Shares []*EnvelopeShare `protobuf:"bytes,1,rep,name=shares,proto3" json:"shares,omitempty"`
// contains filtered or unexported fields
}
EnvelopeGrantInner is the decrypted contents of a grant.
func (*EnvelopeGrantInner) CloneMessageVT ¶
func (m *EnvelopeGrantInner) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*EnvelopeGrantInner) CloneVT ¶
func (m *EnvelopeGrantInner) CloneVT() *EnvelopeGrantInner
func (*EnvelopeGrantInner) EqualMessageVT ¶
func (this *EnvelopeGrantInner) EqualMessageVT(thatMsg any) bool
func (*EnvelopeGrantInner) EqualVT ¶
func (this *EnvelopeGrantInner) EqualVT(that *EnvelopeGrantInner) bool
func (*EnvelopeGrantInner) GetShares ¶
func (x *EnvelopeGrantInner) GetShares() []*EnvelopeShare
func (*EnvelopeGrantInner) MarshalJSON ¶
func (x *EnvelopeGrantInner) MarshalJSON() ([]byte, error)
MarshalJSON marshals the EnvelopeGrantInner to JSON.
func (*EnvelopeGrantInner) MarshalProtoJSON ¶
func (x *EnvelopeGrantInner) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the EnvelopeGrantInner message to JSON.
func (*EnvelopeGrantInner) MarshalProtoText ¶
func (x *EnvelopeGrantInner) MarshalProtoText() string
func (*EnvelopeGrantInner) MarshalToSizedBufferVT ¶
func (m *EnvelopeGrantInner) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*EnvelopeGrantInner) MarshalToVT ¶
func (m *EnvelopeGrantInner) MarshalToVT(dAtA []byte) (int, error)
func (*EnvelopeGrantInner) MarshalVT ¶
func (m *EnvelopeGrantInner) MarshalVT() (dAtA []byte, err error)
func (*EnvelopeGrantInner) ProtoMessage ¶
func (*EnvelopeGrantInner) ProtoMessage()
func (*EnvelopeGrantInner) Reset ¶
func (x *EnvelopeGrantInner) Reset()
func (*EnvelopeGrantInner) SizeVT ¶
func (m *EnvelopeGrantInner) SizeVT() (n int)
func (*EnvelopeGrantInner) String ¶
func (x *EnvelopeGrantInner) String() string
func (*EnvelopeGrantInner) UnmarshalJSON ¶
func (x *EnvelopeGrantInner) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the EnvelopeGrantInner from JSON.
func (*EnvelopeGrantInner) UnmarshalProtoJSON ¶
func (x *EnvelopeGrantInner) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the EnvelopeGrantInner message from JSON.
func (*EnvelopeGrantInner) UnmarshalVT ¶
func (m *EnvelopeGrantInner) UnmarshalVT(dAtA []byte) error
type EnvelopeKeypair ¶
type EnvelopeKeypair struct {
// PubKey is the marshaled public key (libp2p crypto format).
PubKey []byte `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pubKey,omitempty"`
// AuthMethodId is an optional identifier for the auth method.
// Application-specific hint for how to derive the private key.
AuthMethodId string `protobuf:"bytes,2,opt,name=auth_method_id,json=authMethodId,proto3" json:"authMethodId,omitempty"`
// AuthMethodParams is optional parameters for the auth method.
AuthMethodParams []byte `protobuf:"bytes,3,opt,name=auth_method_params,json=authMethodParams,proto3" json:"authMethodParams,omitempty"`
// contains filtered or unexported fields
}
EnvelopeKeypair is a public key entry in the envelope.
func (*EnvelopeKeypair) CloneMessageVT ¶
func (m *EnvelopeKeypair) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*EnvelopeKeypair) CloneVT ¶
func (m *EnvelopeKeypair) CloneVT() *EnvelopeKeypair
func (*EnvelopeKeypair) EqualMessageVT ¶
func (this *EnvelopeKeypair) EqualMessageVT(thatMsg any) bool
func (*EnvelopeKeypair) EqualVT ¶
func (this *EnvelopeKeypair) EqualVT(that *EnvelopeKeypair) bool
func (*EnvelopeKeypair) GetAuthMethodId ¶
func (x *EnvelopeKeypair) GetAuthMethodId() string
func (*EnvelopeKeypair) GetAuthMethodParams ¶
func (x *EnvelopeKeypair) GetAuthMethodParams() []byte
func (*EnvelopeKeypair) GetPubKey ¶
func (x *EnvelopeKeypair) GetPubKey() []byte
func (*EnvelopeKeypair) MarshalJSON ¶
func (x *EnvelopeKeypair) MarshalJSON() ([]byte, error)
MarshalJSON marshals the EnvelopeKeypair to JSON.
func (*EnvelopeKeypair) MarshalProtoJSON ¶
func (x *EnvelopeKeypair) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the EnvelopeKeypair message to JSON.
func (*EnvelopeKeypair) MarshalProtoText ¶
func (x *EnvelopeKeypair) MarshalProtoText() string
func (*EnvelopeKeypair) MarshalToSizedBufferVT ¶
func (m *EnvelopeKeypair) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*EnvelopeKeypair) MarshalToVT ¶
func (m *EnvelopeKeypair) MarshalToVT(dAtA []byte) (int, error)
func (*EnvelopeKeypair) MarshalVT ¶
func (m *EnvelopeKeypair) MarshalVT() (dAtA []byte, err error)
func (*EnvelopeKeypair) ProtoMessage ¶
func (*EnvelopeKeypair) ProtoMessage()
func (*EnvelopeKeypair) Reset ¶
func (x *EnvelopeKeypair) Reset()
func (*EnvelopeKeypair) SizeVT ¶
func (m *EnvelopeKeypair) SizeVT() (n int)
func (*EnvelopeKeypair) String ¶
func (x *EnvelopeKeypair) String() string
func (*EnvelopeKeypair) UnmarshalJSON ¶
func (x *EnvelopeKeypair) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the EnvelopeKeypair from JSON.
func (*EnvelopeKeypair) UnmarshalProtoJSON ¶
func (x *EnvelopeKeypair) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the EnvelopeKeypair message from JSON.
func (*EnvelopeKeypair) UnmarshalVT ¶
func (m *EnvelopeKeypair) UnmarshalVT(dAtA []byte) error
type EnvelopeShare ¶
type EnvelopeShare struct {
Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
// contains filtered or unexported fields
}
EnvelopeShare is a single Shamir share (Ristretto255 scalar pair).
func (*EnvelopeShare) CloneMessageVT ¶
func (m *EnvelopeShare) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*EnvelopeShare) CloneVT ¶
func (m *EnvelopeShare) CloneVT() *EnvelopeShare
func (*EnvelopeShare) EqualMessageVT ¶
func (this *EnvelopeShare) EqualMessageVT(thatMsg any) bool
func (*EnvelopeShare) EqualVT ¶
func (this *EnvelopeShare) EqualVT(that *EnvelopeShare) bool
func (*EnvelopeShare) GetId ¶
func (x *EnvelopeShare) GetId() []byte
func (*EnvelopeShare) GetValue ¶
func (x *EnvelopeShare) GetValue() []byte
func (*EnvelopeShare) MarshalJSON ¶
func (x *EnvelopeShare) MarshalJSON() ([]byte, error)
MarshalJSON marshals the EnvelopeShare to JSON.
func (*EnvelopeShare) MarshalProtoJSON ¶
func (x *EnvelopeShare) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the EnvelopeShare message to JSON.
func (*EnvelopeShare) MarshalProtoText ¶
func (x *EnvelopeShare) MarshalProtoText() string
func (*EnvelopeShare) MarshalToSizedBufferVT ¶
func (m *EnvelopeShare) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*EnvelopeShare) MarshalToVT ¶
func (m *EnvelopeShare) MarshalToVT(dAtA []byte) (int, error)
func (*EnvelopeShare) MarshalVT ¶
func (m *EnvelopeShare) MarshalVT() (dAtA []byte, err error)
func (*EnvelopeShare) ProtoMessage ¶
func (*EnvelopeShare) ProtoMessage()
func (*EnvelopeShare) Reset ¶
func (x *EnvelopeShare) Reset()
func (*EnvelopeShare) SizeVT ¶
func (m *EnvelopeShare) SizeVT() (n int)
func (*EnvelopeShare) String ¶
func (x *EnvelopeShare) String() string
func (*EnvelopeShare) UnmarshalJSON ¶
func (x *EnvelopeShare) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the EnvelopeShare from JSON.
func (*EnvelopeShare) UnmarshalProtoJSON ¶
func (x *EnvelopeShare) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the EnvelopeShare message from JSON.
func (*EnvelopeShare) UnmarshalVT ¶
func (m *EnvelopeShare) UnmarshalVT(dAtA []byte) error
type EnvelopeUnlockResult ¶
type EnvelopeUnlockResult struct {
// Success indicates whether the envelope was fully unlocked.
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
SharesAvailable uint32 `protobuf:"varint,2,opt,name=shares_available,json=sharesAvailable,proto3" json:"sharesAvailable,omitempty"`
SharesNeeded uint32 `protobuf:"varint,3,opt,name=shares_needed,json=sharesNeeded,proto3" json:"sharesNeeded,omitempty"`
// UnlockedGrantIndexes lists which grants were successfully decrypted.
UnlockedGrantIndexes []uint32 `` /* 129-byte string literal not displayed */
// contains filtered or unexported fields
}
EnvelopeUnlockResult is the result of attempting to unlock an envelope.
func UnlockEnvelope ¶
func UnlockEnvelope( context string, env *Envelope, privKeys []crypto.PrivKey, ) ([]byte, *EnvelopeUnlockResult, error)
UnlockEnvelope attempts to decrypt an Envelope using the provided private keys.
Returns (payload, result, nil) on success. Returns (nil, result, nil) when not enough shares are available (result has progress). Returns (nil, nil, err) on invalid envelope or other errors.
func (*EnvelopeUnlockResult) CloneMessageVT ¶
func (m *EnvelopeUnlockResult) CloneMessageVT() protobuf_go_lite.CloneMessage
func (*EnvelopeUnlockResult) CloneVT ¶
func (m *EnvelopeUnlockResult) CloneVT() *EnvelopeUnlockResult
func (*EnvelopeUnlockResult) EqualMessageVT ¶
func (this *EnvelopeUnlockResult) EqualMessageVT(thatMsg any) bool
func (*EnvelopeUnlockResult) EqualVT ¶
func (this *EnvelopeUnlockResult) EqualVT(that *EnvelopeUnlockResult) bool
func (*EnvelopeUnlockResult) GetSharesAvailable ¶
func (x *EnvelopeUnlockResult) GetSharesAvailable() uint32
func (*EnvelopeUnlockResult) GetSharesNeeded ¶
func (x *EnvelopeUnlockResult) GetSharesNeeded() uint32
func (*EnvelopeUnlockResult) GetSuccess ¶
func (x *EnvelopeUnlockResult) GetSuccess() bool
func (*EnvelopeUnlockResult) GetUnlockedGrantIndexes ¶
func (x *EnvelopeUnlockResult) GetUnlockedGrantIndexes() []uint32
func (*EnvelopeUnlockResult) MarshalJSON ¶
func (x *EnvelopeUnlockResult) MarshalJSON() ([]byte, error)
MarshalJSON marshals the EnvelopeUnlockResult to JSON.
func (*EnvelopeUnlockResult) MarshalProtoJSON ¶
func (x *EnvelopeUnlockResult) MarshalProtoJSON(s *json.MarshalState)
MarshalProtoJSON marshals the EnvelopeUnlockResult message to JSON.
func (*EnvelopeUnlockResult) MarshalProtoText ¶
func (x *EnvelopeUnlockResult) MarshalProtoText() string
func (*EnvelopeUnlockResult) MarshalToSizedBufferVT ¶
func (m *EnvelopeUnlockResult) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*EnvelopeUnlockResult) MarshalToVT ¶
func (m *EnvelopeUnlockResult) MarshalToVT(dAtA []byte) (int, error)
func (*EnvelopeUnlockResult) MarshalVT ¶
func (m *EnvelopeUnlockResult) MarshalVT() (dAtA []byte, err error)
func (*EnvelopeUnlockResult) ProtoMessage ¶
func (*EnvelopeUnlockResult) ProtoMessage()
func (*EnvelopeUnlockResult) Reset ¶
func (x *EnvelopeUnlockResult) Reset()
func (*EnvelopeUnlockResult) SizeVT ¶
func (m *EnvelopeUnlockResult) SizeVT() (n int)
func (*EnvelopeUnlockResult) String ¶
func (x *EnvelopeUnlockResult) String() string
func (*EnvelopeUnlockResult) UnmarshalJSON ¶
func (x *EnvelopeUnlockResult) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the EnvelopeUnlockResult from JSON.
func (*EnvelopeUnlockResult) UnmarshalProtoJSON ¶
func (x *EnvelopeUnlockResult) UnmarshalProtoJSON(s *json.UnmarshalState)
UnmarshalProtoJSON unmarshals the EnvelopeUnlockResult message from JSON.
func (*EnvelopeUnlockResult) UnmarshalVT ¶
func (m *EnvelopeUnlockResult) UnmarshalVT(dAtA []byte) error