forked from dcposch/scramble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.go
43 lines (37 loc) · 836 Bytes
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
// A single user, email address, and key pair
// The email address is <public key hash>@<host>
type User struct {
UserID
PublicKey string
CipherPrivateKey string
}
// A single user's identifying info
// All hashes are hex encoded
type UserID struct {
Token string
PasswordHash string
PasswordHashOld string
PublicHash string
}
// Represents an email header with encrypted subject. No body.
type EmailHeader struct {
MessageID string
Box string
UnixTime int64
From string
To string
PubHashFrom string
PubHashTo string
CipherSubject string
}
// Represents a full email, header and body PGP encrypted.
type Email struct {
EmailHeader
CipherBody string
}
type InboxSummary struct {
Token string
PublicHash string
EmailHeaders []EmailHeader
}