crypto

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCertificateAndPrivateKeyPairValidity added in v0.1.0

func CheckCertificateAndPrivateKeyPairValidity(certificate []byte, privateKey []byte) (bool, error)

CheckCertificateAndPrivateKeyPairValidity checks if the certificate and private key pair are valid.

func CheckPublicAndPrivateKeyValidity added in v0.1.0

func CheckPublicAndPrivateKeyValidity(publicKey []byte, privateKey []byte) (bool, error)

CheckPublicAndPrivateKeyValidity checks if the given bytes for the private and public keys are valid.

func GenerateCertificatePrivateKeyPair added in v0.1.0

func GenerateCertificatePrivateKeyPair(template *x509.Certificate, caCertificate []byte, caPrivateKey []byte) (*bytes.Buffer, *bytes.Buffer, error)

GenerateCertificatePrivateKeyPair starts from the Certificate Authority bytes a certificate using the provided template, returning the bytes both for the certificate and its key.

func IsValidCertificateKeyPairBytes

func IsValidCertificateKeyPairBytes(certificateBytes []byte, privateKeyBytes []byte) (bool, error)

IsValidCertificateKeyPairBytes checks if the certificate matches the private key bounded to it.

func NewCertificateTemplate added in v0.1.0

func NewCertificateTemplate(commonName string) *x509.Certificate

NewCertificateTemplate returns the template that must be used to generate a certificate, used to perform the authentication against the DataStore.

func ParseCertificateBytes added in v0.1.0

func ParseCertificateBytes(content []byte) (*x509.Certificate, error)

ParseCertificateBytes takes the certificate bytes returning a x509 certificate by parsing it.

func ParsePrivateKeyBytes added in v0.1.0

func ParsePrivateKeyBytes(content []byte) (*rsa.PrivateKey, error)

ParsePrivateKeyBytes takes the private key bytes returning an RSA private key by parsing it.

func ParsePublicKeyBytes added in v0.1.0

func ParsePublicKeyBytes(content []byte) (*rsa.PublicKey, error)

ParsePublicKeyBytes takes the public key bytes returning an RSA public key by parsing it.

func VerifyCertificate added in v0.2.0

func VerifyCertificate(cert, ca []byte, usages ...x509.ExtKeyUsage) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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