aboutsummaryrefslogtreecommitdiff
path: root/internal/crypt/headers.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/crypt/headers.go')
-rw-r--r--internal/crypt/headers.go19
1 files changed, 14 insertions, 5 deletions
diff --git a/internal/crypt/headers.go b/internal/crypt/headers.go
index b5addb2..8f9dac2 100644
--- a/internal/crypt/headers.go
+++ b/internal/crypt/headers.go
@@ -18,15 +18,24 @@ const (
)
type FileHeaders struct {
- Salt [16]byte
- Nonce [12]byte
- Type DataType
- Auth AuthMode
- Parts int
+ Salt [16]byte
+ Nonce [12]byte
+ Type DataType
+ Auth AuthMode // "Pass" or "SSH"
+ Parts int
+ Recipients []WrappedKey
// TODO: Version (string) for the version of .eno file.
}
+type WrappedKey struct {
+ PKType string // "ssh-ed25519"
+ PubKeyBytes []byte
+ EphemeralPub []byte // of X25519, for ECDH on decrypt (also can replace salt)
+ Nonce [12]byte // for decrypting EncNoteKey
+ EncNoteKey []byte // encrypted note key (ciphertext + 16B tag)
+}
+
func GetFileHeaders(b []byte) (FileHeaders, error) {
dec := gob.NewDecoder(bytes.NewReader(b))
var headers FileHeaders