crypto

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: MIT Imports: 1 Imported by: 0

README

Crypto Library (Golang)

Crypto library gives ECDSA 384, RSA 256, AES (GCM) encryptions for private and cloud providers

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider interface {
	// SignECDSA will sign a plaintext message using an
	// ECDSA P384 asymmetric private key
	SignECDSA(ctx context.Context, plaintext []byte) ([]byte, error)

	// VerifyECDSA will verify that an
	// ECDSA P384 signature is valid for a given plaintext message
	VerifyECDSA(ctx context.Context, signature, plaintext []byte) error

	// EncryptRSA will encrypt a plaintext message using an
	// RSA 2048 public key
	EncryptRSA(ctx context.Context, plaintext []byte) ([]byte, error)

	// DecryptRSA will attempt to decrypt a given ciphertext with an
	// RSA 2048 private key
	DecryptRSA(ctx context.Context, ciphertext []byte) ([]byte, error)

	// EncryptAES will encrypt a plaintext using an
	// AES-256 key
	EncryptAES(ctx context.Context, plaintext []byte) ([]byte, error)

	// DecryptAES will attempt to decrypt a given ciphertext with an
	// AES-256 key
	DecryptAES(ctx context.Context, ciphertext []byte) ([]byte, error)
}

Provider defines interface that implemented by different providers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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