crypto

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMailioCrypto

func NewMailioCrypto() *mailioCrytoType

Types

type MailioCrypto

type MailioCrypto interface {

	// Convert a public key in base64 format into a mailio address
	PublicKeyToMailioAddress(publicKeyBase64 string) (*string, error)

	// checks if mailio address is in expected format
	IsValidMailioAddress(address string) bool

	// create a server side handshake message (signed by server keys where public key is published to DNS)
	Handshake()

	// Verify any handshake message
	VerifyHandshake()

	// Generated ed25519 signing key pair and returns base64 public key, private key
	GenerateKeyPair() (*string, *string, error)

	// Sign message using ed25519
	Sign(message []byte, privateKeyBase64 string) ([]byte, error)

	// Verify message signature using ed25519
	Verify(message []byte, signature []byte, publicKeyBase64 string) (bool, error)

	// Encode a specific content to bytes using cbor (https://github.com/fxamacker/cbor)
	CborEncode(payload interface{}) ([]byte, error)
}

Jump to

Keyboard shortcuts

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