Documentation
¶
Overview ¶
Package senderobject implements the transport-neutral suite-0x02 object envelope.
Index ¶
- Constants
- Variables
- func Open(binding Binding, key []byte, sender *senderauth.Verifier, object []byte) ([]byte, error)
- func OpenDescriptorBootstrap(binding Binding, key []byte, object []byte, ...) ([]byte, error)
- func Seal(binding Binding, key []byte, signingKey ed25519.PrivateKey, ...) ([]byte, error)
- func Verify(binding Binding, sender *senderauth.Verifier, object []byte) error
- type Binding
- func NewBlockRecordBinding(shareInstance, fileID, revision []byte, localBlock uint64, dataLength uint32) (Binding, error)
- func NewCatalogPageBinding(shareInstance, directoryID []byte, page uint32) (Binding, error)
- func NewDescriptorBinding(pkHash, shareIDRaw []byte) (Binding, error)
- func NewDirectoryErrorBinding(shareInstance, directoryID []byte) (Binding, error)
- func NewOfflineCommitBinding(shareInstance []byte) (Binding, error)
- func NewRevisionBinding(shareInstance, fileID []byte) (Binding, error)
- type Domain
Constants ¶
const ( // The object version owns the signature construction independently of the v2 session wire. WireVersion = byte(3) HeaderBytes = 8 NonceBytes = 12 SignatureBytes = ed25519.SignatureSize TagBytes = 16 FixedBytes = HeaderBytes + NonceBytes + SignatureBytes MaxDescriptorBytes = 16 << 10 MaxCatalogPageBytes = 60 << 10 MaxDirectoryErrorBytes = 16 << 10 MaxRevisionBytes = 16 << 10 MaxBlockRecordBytes = (4 << 20) + 512 MaxOfflineCommitBytes = 16 << 10 )
Variables ¶
var ( ErrBinding = errors.New("senderobject: invalid semantic binding") ErrKey = errors.New("senderobject: invalid key material") ErrMalformed = errors.New("senderobject: malformed object") ErrTooLarge = errors.New("senderobject: object exceeds its domain limit") ErrSignature = errors.New("senderobject: sender signature is invalid") ErrAuth = errors.New("senderobject: ciphertext authentication failed") )
Functions ¶
func OpenDescriptorBootstrap ¶
func OpenDescriptorBootstrap(binding Binding, key []byte, object []byte, senderIdentity func([]byte) (*senderauth.Verifier, error)) ([]byte, error)
OpenDescriptorBootstrap decrypts only to discover the sender key, then checks pkHash and the outer signature before releasing plaintext to the caller.
Types ¶
type Binding ¶
type Binding struct {
// contains filtered or unexported fields
}
Binding owns the exact domain, context, and byte ceiling for one semantic object. Callers cannot construct an unbounded or context-free envelope.
func NewBlockRecordBinding ¶
func NewCatalogPageBinding ¶
func NewDescriptorBinding ¶
func NewOfflineCommitBinding ¶
func NewRevisionBinding ¶
type Domain ¶
type Domain string
const ( DomainDescriptor Domain = "windshare/v2 object/descriptor" DomainCatalogPage Domain = "windshare/v2 object/catalog-page" DomainDirectoryError Domain = "windshare/v2 object/directory-error" DomainRevision Domain = "windshare/v2 object/file-revision" DomainBlockRecord Domain = "windshare/v2 object/block-record" DomainOfflineCommit Domain = "windshare/v2 object/offline-commit" )