mime

package
v3.0.0-alpha.2-proton Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package mime provides an API to decrypt mime messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(
	message []byte,
	messageEncoding int8,
	decryptionHandle crypto.PGPDecryption,
	verifyHandle crypto.PGPVerify,
	callbacks MIMECallbacks,
)

Decrypt decrypts and verifies a MIME message. messageEncoding provides the encoding of the encrypted MIME message, either crypto.Bytes or crypto.Armor. The decryptionHandle is used to decrypt and verify the message, while the verifyHandle is used to verify the signature contained in the decrypted mime message. The verifyHandle can be nil.

Types

type MIMECallbacks

type MIMECallbacks interface {
	OnBody(body string, mimetype string)
	OnAttachment(headers string, data []byte)
	// Encrypted headers can be in an attachment and thus be placed at the end of the mime structure.
	OnEncryptedHeaders(headers string)
	OnVerified(verified int)
	OnError(err error)
}

MIMECallbacks defines callback methods to process a MIME message.

Jump to

Keyboard shortcuts

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