manifest

package module
v0.0.0-...-8083690 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2015 License: MIT Imports: 4 Imported by: 7

README

PGP manifest

Implementation of the PGP manifest encrypted email structure based on Mailpile's article. This project contains two CLI programs to generate and parse sample emails, that act as areference implementation for the standard.

Manifest's structure

{
    "version": "v1.0.0", // Manifest's structure version
    "headers": { // Headers to override
        "from": "rcp@example.org",
        "to": "snd@example.org",
        "subject": "Secret subject"
    },
    "parts": [
        // Definition of the body
        {
            "id": "body",
            "hash": "SHA256 hash of the unencrypted body",
            "content-type": "text/plain"
        },
        // Attachment definitions
        {
            "id": "randomstring1",
            "hash": "SHA256 hash of the unencrypted attachment",
            "content-type": "text/html",
            "filename": "test.html"
        }
    ]
}

Email's structure

multipart/mixed
 |- multipart/alternative
     |- application/pgp-encrypted - Encrypted email body 
     |- text/html                 - HTML containg a link to a remote email reader
     |- text/plain                - Plaintext variant of the fallback message
 |- application/pgp-encrypted; filename=randomstring1.pgp - PGP-encrypted attachment
 |- application/x-pgp-manifest+json; filename=manifest.pgp - PGP-encrypted manifest

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(input *Manifest) ([]byte, error)

Types

type Manifest

type Manifest struct {
	Version semver.Version `json:"version"`

	From        *mail.Address   `json:"-"`
	To          []*mail.Address `json:"-"`
	CC          []*mail.Address `json:"-"`
	Subject     string          `json:"-"`
	ContentType string          `json:"-"`

	Headers map[string]interface{} `json:"headers"`
	Parts   []*Part                `json:"parts,omitempty"`
}

func Parse

func Parse(input []byte) (*Manifest, error)

type Part

type Part struct {
	Hash        string `json:"hash"`
	Size        int    `json:"size"`
	ID          string `json:"id"`
	ContentType string `json:"content_type"`
	Filename    string `json:"filename,omitempty"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL