crypto

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaCertKeyPair

func CaCertKeyPair() ([]byte, []byte, error)

CaCertKeyPair returns pem encoded certificate and key for monarchCA

func CertificateAuthority

func CertificateAuthority() (*x509.Certificate, *rsa.PrivateKey, error)

func ClientTLSConfig

func ClientTLSConfig(c *config.MonarchClientConfig) (*tls.Config, error)

func DecryptAES

func DecryptAES(key []byte, ciphertext string) (string, error)

func EncryptAES

func EncryptAES(key []byte, plaintext string) (string, error)

func NewClientCertificate

func NewClientCertificate(cn string) ([]byte, []byte, error)

NewClientCertificate generates a cert-key pair for a newly created operator

func RandomBytes

func RandomBytes(n int) []byte

func ServerCertKeyPair

func ServerCertKeyPair() ([]byte, []byte, error)

func ServerTLSConfig

func ServerTLSConfig() (*tls.Config, error)

Types

type CertVerifier

type CertVerifier func(rawCerts [][]byte, verifiedChains [][]*x509.Certificate) error

func PeerCertificateVerifier

func PeerCertificateVerifier(caCertPEM []byte) CertVerifier

Jump to

Keyboard shortcuts

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