crypto

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadCert

func LoadCert(path, password string) (*rsa.PrivateKey, *x509.Certificate, error)

func LoadCertChain

func LoadCertChain(certPath string, certPassword string) (
	*rsa.PrivateKey, *x509.Certificate, []*x509.Certificate, error)

func Sign

func Sign(privateKey *rsa.PrivateKey, payload []byte) ([]byte, error)

func SignPayload

func SignPayload(privateKey *rsa.PrivateKey, payload []byte) ([]byte, error)

func VerifySignature

func VerifySignature(publicKey *rsa.PublicKey, payload []byte, signature string) error

Types

type CertLoader

type CertLoader func(certPath string, certPassword string) (*rsa.PrivateKey, *x509.Certificate, error)

CertLoader loads a certificate from a file and returns the private key and the certificate.

type PayloadSigner

type PayloadSigner func(privateKey *rsa.PrivateKey, payload []byte) ([]byte, error)

PayloadSigner signs a payload using the private key of the signing certificate all requests to the VFD API must be signed.

type SignatureVerifier

type SignatureVerifier func(publicKey *rsa.PublicKey, payload []byte, signature string) error

SignatureVerifier verifies the signature of a payload using the public key of the signing certificate.

Jump to

Keyboard shortcuts

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