core

package module
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: Apache-2.0 Imports: 6 Imported by: 1

README

Crypto Core

Introduction

This package is a library to abstract crypto providers for go. It uses plugin system. The providers can be loaded during startup by adding the respective module in the local folder.

Building

Here is the README.md describing the specifics of build process for services, where the dependency is used.

Usage

Implement/Choose a plugin which implements the commonProvider Interface and put it in the docker container in an folder which is identified by the environment variable CRYPTO_CORE_MODULE_PATH next to your application (e.g. in Docker File)

Compilation of Modules

Compilation

go build -buildmode=plugin

Plugin

func GetCryptoProvider() CryptoProvider {
    return provider
}

var Plugin CryptoProviderModule //export Plugin Symbol, dont change this name:) 

Configuration

Following environment variables are required:

CRYPTO_PLUGIN_PATH - path from where to fetch the compiled plugin .so file - default: /etc/plugins

Problem Solving

The compatibility of the plugins with this provider it's sometimes tricky, because the versions of go, each lib version etc. must match 100% otherwise it will reject it during startup.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCryptoEngine

func CreateCryptoEngine(path string) types.CryptoProvider

Allows it to switch the Plugin and reload a crypto engine from another path. Makes only sense when the file system contains more than one plugin. Mostly just for unit tests relevant.

func CryptoEngine

func CryptoEngine() types.CryptoProvider

Returns standard Cryptoengine which is shipped with the docker image and/or the local file system.

func Encryption_Testing_Aes256 added in v1.4.0

func Encryption_Testing_Aes256(crypto types.CryptoProvider) bool

This function is forseen for standardize testing of Aes256 together with providers.

func GetKeys_Test added in v1.4.0

func GetKeys_Test(crypto types.CryptoProvider) (bool, error)

This function is forseen for standardize testing together with providers.

func Sign_Testing_Ed added in v1.4.0

func Sign_Testing_Ed(crypto types.CryptoProvider) bool

This function is forseen for standardize testing of ED together with providers.

func Sign_Testing_Rsa4096 added in v1.4.0

func Sign_Testing_Rsa4096(crypto types.CryptoProvider) bool

This function is forseen for standardize testing of RSA4096 together with providers.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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