Documentation
¶
Index ¶
- Constants
- func GetDocument(gs GrantService, grant *grant.Grant) (*meta.Document, []byte, error)
- func PutDocument(gs GrantService, pgsm *api.PlaintextAndGrantSpecAndMeta) (*grant.Grant, error)
- func ReceiveCiphertext(srv CiphertextReceiver) ([]byte, error)
- func ReceiveDocument(srv DocumentReceiver) (*meta.Document, error)
- func ReceiveDocumentAndGrantSpec(srv DocumentAndGrantReceiver) (*api.PlaintextAndGrantSpecAndMeta, error)
- func ReceivePlaintext(srv PlaintextReceiver) (*api.Plaintext, error)
- func ReceivePlaintextAndGrantSpec(srv PlaintextAndGrantSpecReceiver) (*api.PlaintextAndGrantSpec, error)
- func SendCiphertext(srv CiphertextSender, data []byte, chunkSize int) error
- func SendDocument(srv DocumentSender, doc *meta.Document, salt []byte, chunkSize int) error
- func SendDocumentAndGrantSpec(srv DocumentAndGrantSender, doc *meta.Document, salt []byte, spec *grant.Spec, ...) error
- func SendPlaintext(srv PlaintextSender, data, salt []byte, chunkSize int) error
- func SendPlaintextAndGrantSpec(srv PlaintextAndGrantSpecSender, pgs *api.PlaintextAndGrantSpec, chunkSize int) error
- type CiphertextReceiver
- type CiphertextSender
- type DocumentAndGrantReceiver
- type DocumentAndGrantSender
- type DocumentReceiver
- type DocumentSender
- type EncryptionService
- type GrantService
- type Hoard
- func (hrd *Hoard) Decrypt(ref *reference.Ref, encryptedData []byte) ([]byte, error)
- func (hrd *Hoard) Delete(address []byte) error
- func (hrd *Hoard) Encrypt(data, salt []byte) (*reference.Ref, []byte, error)
- func (hrd *Hoard) Get(ref *reference.Ref) ([]byte, error)
- func (hrd *Hoard) Name() string
- func (hrd *Hoard) Put(data, salt []byte) (*reference.Ref, error)
- func (hrd *Hoard) Seal(ref *reference.Ref, spec *grant.Spec) (*grant.Grant, error)
- func (hrd *Hoard) Store() stores.ContentAddressedStore
- func (hrd *Hoard) Unseal(grt *grant.Grant) (*reference.Ref, error)
- type ObjectService
- type PlaintextAndGrantSpecReceiver
- type PlaintextAndGrantSpecSender
- type PlaintextReceiver
- type PlaintextSender
- type Service
- func (service *Service) Decrypt(refAndCiphertext *api.ReferenceAndCiphertext, srv api.Encryption_DecryptServer) error
- func (service *Service) Delete(ctx context.Context, address *api.Address) (*api.Address, error)
- func (service *Service) Download(grt *grant.Grant, srv api.Document_DownloadServer) error
- func (service *Service) Encrypt(srv api.Encryption_EncryptServer) error
- func (service *Service) Get(ref *reference.Ref, srv api.Cleartext_GetServer) error
- func (service *Service) Pull(address *api.Address, srv api.Storage_PullServer) error
- func (service *Service) Push(srv api.Storage_PushServer) error
- func (service *Service) Put(srv api.Cleartext_PutServer) error
- func (service *Service) PutSeal(srv api.Grant_PutSealServer) error
- func (service *Service) Reseal(ctx context.Context, arg *api.GrantAndGrantSpec) (*grant.Grant, error)
- func (service *Service) Seal(ctx context.Context, arg *api.ReferenceAndGrantSpec) (*grant.Grant, error)
- func (service *Service) Stat(ctx context.Context, address *api.Address) (*stores.StatInfo, error)
- func (service *Service) Unseal(ctx context.Context, grt *grant.Grant) (*reference.Ref, error)
- func (service *Service) UnsealDelete(ctx context.Context, grt *grant.Grant) (*api.Address, error)
- func (service *Service) UnsealGet(grt *grant.Grant, srv api.Grant_UnsealGetServer) error
- func (service *Service) Upload(srv api.Document_UploadServer) error
Constants ¶
const MaxChunkSize = 1 << 20
1MiB
Variables ¶
This section is empty.
Functions ¶
func GetDocument ¶
GetDocument retrieves a document from hoard and parses it into a document struct. NOTE: if this schema changes hoard will break.
func PutDocument ¶
func PutDocument(gs GrantService, pgsm *api.PlaintextAndGrantSpecAndMeta) (*grant.Grant, error)
PostDocument is given a document struct which is then parsed into a document object which matches the encoding system established. NOTE: if this schema changes hoard will break.
This function puts and seals the document into hoard's store and returns back the grant which is given from hoard.
func ReceiveCiphertext ¶
func ReceiveCiphertext(srv CiphertextReceiver) ([]byte, error)
func ReceiveDocument ¶
func ReceiveDocument(srv DocumentReceiver) (*meta.Document, error)
func ReceiveDocumentAndGrantSpec ¶
func ReceiveDocumentAndGrantSpec(srv DocumentAndGrantReceiver) (*api.PlaintextAndGrantSpecAndMeta, error)
func ReceivePlaintext ¶
func ReceivePlaintext(srv PlaintextReceiver) (*api.Plaintext, error)
func ReceivePlaintextAndGrantSpec ¶
func ReceivePlaintextAndGrantSpec(srv PlaintextAndGrantSpecReceiver) (*api.PlaintextAndGrantSpec, error)
Receive chunks of plaintext and spec and aggregate into complete objects
func SendCiphertext ¶
func SendCiphertext(srv CiphertextSender, data []byte, chunkSize int) error
func SendDocument ¶
func SendPlaintext ¶
func SendPlaintext(srv PlaintextSender, data, salt []byte, chunkSize int) error
func SendPlaintextAndGrantSpec ¶
func SendPlaintextAndGrantSpec(srv PlaintextAndGrantSpecSender, pgs *api.PlaintextAndGrantSpec, chunkSize int) error
Send some plaintext and spec to a service in chunks
Types ¶
type CiphertextReceiver ¶
type CiphertextReceiver interface {
Recv() (*api.Ciphertext, error)
}
type CiphertextSender ¶
type CiphertextSender interface {
Send(*api.Ciphertext) error
}
type DocumentAndGrantReceiver ¶
type DocumentAndGrantReceiver interface {
Recv() (*api.PlaintextAndGrantSpecAndMeta, error)
}
type DocumentAndGrantSender ¶
type DocumentAndGrantSender interface {
Send(*api.PlaintextAndGrantSpecAndMeta) error
}
type DocumentReceiver ¶
type DocumentReceiver interface {
Recv() (*api.PlaintextAndMeta, error)
}
type DocumentSender ¶
type DocumentSender interface {
Send(*api.PlaintextAndMeta) error
}
type EncryptionService ¶
type GrantService ¶
type Hoard ¶
type Hoard struct {
// contains filtered or unexported fields
}
This is our top level API object providing library acting as a deterministic encrypted store and a grant issuer. It can be consumed as a Go library or as a GRPC service through grpcService which just plumbs this object into the hoard.proto interface.
func NewHoard ¶
func NewHoard(store stores.NamedStore, secrets config.SecretsManager, logger log.Logger) *Hoard
func (*Hoard) Store ¶
func (hrd *Hoard) Store() stores.ContentAddressedStore
type ObjectService ¶
type ObjectService interface { EncryptionService // Get encrypted data from underlying storage at address and decrypt it Get(ref *reference.Ref) (data []byte, err error) // Encrypt data and put it in underlying storage Put(data, salt []byte) (*reference.Ref, error) // Delete underlying data obtained by address Delete(address []byte) error // Get the underlying ContentAddressedStore Store() stores.ContentAddressedStore }
type PlaintextAndGrantSpecReceiver ¶
type PlaintextAndGrantSpecReceiver interface {
Recv() (*api.PlaintextAndGrantSpec, error)
}
type PlaintextAndGrantSpecSender ¶
type PlaintextAndGrantSpecSender interface {
Send(*api.PlaintextAndGrantSpec) error
}
type PlaintextReceiver ¶
type PlaintextSender ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Here we implement the GRPC Hoard service. It should mostly be plumbing to a DeterministicEncryptedStore (for which hoard.hoard is the canonical example) and also to Grants.
func NewService ¶
func NewService(grantService GrantService, chunkSize int) *Service
func (*Service) Decrypt ¶
func (service *Service) Decrypt(refAndCiphertext *api.ReferenceAndCiphertext, srv api.Encryption_DecryptServer) error
func (*Service) UnsealDelete ¶
Directories
¶
Path | Synopsis |
---|---|
Contains core types and logic pertaining to Hoard's backend storage services - but not the implementations of those stores to avoid a large number of possibly unwanted dependencies
|
Contains core types and logic pertaining to Hoard's backend storage services - but not the implementations of those stores to avoid a large number of possibly unwanted dependencies |
test
|
|