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 EncryptDecrypter ¶
type EncryptDecrypter interface {
DecryptWithNode(data []byte) ([]byte, string, error)
Decrypt(data []byte) ([]byte, error)
Encrypt(data []byte) ([]byte, error)
}
EncryptDecrypter defines an interface for encryption and decryption operations with optional node identification support. DecryptWithNode decrypts the data, also returning the node name associated with the encryption process. Decrypt decrypts the data using the current encryption configuration and returns the result. Encrypt encrypts the data and outputs it in a secure format with metadata about the encryption.
type T ¶
type T struct {
NodeName string
ClusterName string
// Key is the current key used to encrypt data.
Key string
// Version indicates the generation number of the current encryption key.
Version uint64
// AltKey is an alternate encryption key that can be used to decrypt messages.
// It is the previous or future key.
AltKey string
// AltVersion indicates the generation number of the next encryption key.
AltVersion uint64
}
func (*T) Decrypt ¶
Decrypt decrypts the message, if the nodename found in the message is a cluster node.
func (*T) DecryptWithNode ¶
DecryptWithNode Decrypt the message
returns decodedMsg []byte, encryptorNodename string, error