Documentation ¶
Index ¶
- Constants
- func AESDecrypt(key []byte, content io.Reader) (io.Reader, error)
- func AESEncrypt(key []byte, content io.Reader) (io.Reader, error)
- func Filter(chunks Chunks) map[string]Chunks
- func GPGDecrypt(privateKey, passphrase []byte, content io.Reader) (io.Reader, error)
- func GPGEncrypt(publicKey []byte, content io.Reader) (io.Reader, error)
- type AESEncryption
- type Chunk
- type Chunks
- type Ctx
- type GPGEncryption
- type Opts
Constants ¶
const ( BytesContentType = "bytes" FileContentType = "file" )
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
Filter filters a list of chunks and returns a map of chunks according to their context ID.
func GPGDecrypt ¶
Types ¶
type AESEncryption ¶
type AESEncryption struct {
Key []byte
}
AESEncryption use https://golang.org/pkg/crypto/aes/ for file content encryption/decryption
type Chunks ¶
type Chunks []Chunk
Chunks is an array of chunks
func Shred ¶
Shred shreds a byte array into a an array of chunks according to options. You can pass nil as option, chunks size will be 512 bytes. You can define Encryption option such as GPG or AES. See GPGEncryption and AESEncryption structures.
type Ctx ¶
type Ctx struct { UUID string ContentType string Opts *Opts ChunksNumber int // contains filtered or unexported fields }
Ctx is a context for a shredding
func Reassemble ¶
Reassemble computes a list of chunks, eventually decrypt the content (according to options)
type GPGEncryption ¶
GPGEncryption use GPG to file content encryption/decryption
type Opts ¶
type Opts struct { AESEncryption *AESEncryption GPGEncryption *GPGEncryption ChunkSize int64 }
Opts is here to set option on shredder like Encryption of chunksize