Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HashMismatch = errors.New("mismatching SHA-256 digest") UnsupportedVersion = errors.New("unsupported Matrix file encryption version") UnsupportedAlgorithm = errors.New("unsupported JWK encryption algorithm") InvalidKey = errors.New("failed to decode key") InvalidInitVector = errors.New("failed to decode initialization vector") )
Functions ¶
This section is empty.
Types ¶
type EncryptedFile ¶
type EncryptedFile struct { Key JSONWebKey `json:"key"` InitVector string `json:"iv"` Hashes EncryptedFileHashes `json:"hashes"` Version string `json:"v"` // contains filtered or unexported fields }
func NewEncryptedFile ¶
func NewEncryptedFile() *EncryptedFile
func (*EncryptedFile) Encrypt ¶
func (ef *EncryptedFile) Encrypt(plaintext []byte) []byte
type EncryptedFileHashes ¶
type EncryptedFileHashes struct {
SHA256 string `json:"sha256"`
}
Click to show internal directories.
Click to hide internal directories.