feat: update spec

This commit is contained in:
2023-09-02 00:47:50 +08:00
parent abb2480b0d
commit edeff5c265

View File

@@ -12,32 +12,33 @@ File format:
Meta format: Meta format:
| Field | Type | Comment | | Field | Type | Comment |
|------------------|-----------|----------------------------------------------| |---------------------|-----------|----------------------------------------------|
| version | String | Constant value: `1.1` | | version | String | Constant value: `1.1` |
| created | Long | Created time, Unix Epoch | | created | Long | Created time, Unix Epoch |
| userAgent | String | User Agent, e.g. `TinyEncrypt v0.5.1@MacOS` | | userAgent | String | User Agent, e.g. `TinyEncrypt v0.5.1@MacOS` |
| comment | String | `optional` Plain text comment | | comment | String | `optional` Plain text comment |
| encryptedComment | String | `optional` Encrypted comment | | encryptedComment | String | `optional` Encrypted comment |
| encryptedMeta | String | `optional` Encrypted Meta Data | | encryptedMeta | String | `optional` Encrypted Meta Data |
| pgpEnvelop | String | `deprecated` PGP Publickey Encrypted DataKey | | pgpEnvelop | String | `deprecated` PGP Publickey Encrypted DataKey |
| pgpFingerprint | String | `deprecated` Hex(Sha256(PGP Publickey)) | | pgpFingerprint | String | `deprecated` Hex(Sha256(PGP Publickey)) |
| ageEnvelop | String | `deprecated` PGP Publickey Encrypted DataKey | | ageEnvelop | String | `deprecated` PGP Publickey Encrypted DataKey |
| ageRecipient | String | `deprecated` age1*** | | ageRecipient | String | `deprecated` age1*** |
| ecdhEnvelop | String | `deprecated` KW:*** | | ecdhEnvelop | String | `deprecated` KW:*** |
| ecdhPoint | String | `deprecated` 02*** | | ecdhPoint | String | `deprecated` 02*** |
| envelop | String | `deprecated` KMS Encrypted DataKey | | envelop | String | `deprecated` KMS Encrypted DataKey |
| envelops | Envelop[] | Envelop Array | | envelops | Envelop[] | Envelop Array |
| nonce | String | `base64` GCM Nonce | | encryptionAlgorithm | String | `optional` Default `AES/GCM` |
| fileLength | Long | File Length | | nonce | String | `base64` GCM Nonce |
| fileLastModified | Long | File Last Modified, Unix Epoch | | fileLength | Long | File Length |
| compress | Boolean | Compressed or Not, GZIP if `true` | | fileLastModified | Long | File Last Modified, Unix Epoch |
| compress | Boolean | Compressed or Not, GZIP if `true` |
Envelop format: Envelop format:
| Field | Type | Comment | | Field | Type | Comment |
|--------------|--------|-------------------------| |--------------|--------|----------------------------------------|
| type | String | Type: `kms`, `pgp`, ... | | type | String | Type: `kms`, `pgp`, `age`, `ecdh`, ... |
| kid | String | Key ID | | kid | String | Key ID |
| desc | String | `optional` Description | | desc | String | `optional` Description |
| encryptedKey | String | `base64` Encrypted Key | | encryptedKey | String | `base64` Encrypted Key |