omcrypto

package
v0.0.0-...-3f873ad Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package omcrypto is responsible for Message Encrypt, Decrypt, DecryptWithNode

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct {
	NodeName    string
	ClusterName string
	Key         string
}

func (*Factory) Decrypt

func (m *Factory) Decrypt(data []byte) ([]byte, error)

Decrypt decrypts the message, if the nodename found in the message is a cluster node.

func (*Factory) DecryptWithNode

func (m *Factory) DecryptWithNode(data []byte) ([]byte, string, error)

DecryptWithNode Decrypt the message

returns decodedMsg []byte, encryptorNodename string, error

func (*Factory) Encrypt

func (m *Factory) Encrypt(data []byte) ([]byte, error)

Encrypt encrypts the message and returns a json with head keys describing the sender, and embedding the AES-encypted + Base64-encoded data.

Jump to

Keyboard shortcuts

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