Documentation ¶
Index ¶
- func CheckCertificateAndPrivateKeyPairValidity(certificate []byte, privateKey []byte) (bool, error)
- func CheckPublicAndPrivateKeyValidity(publicKey []byte, privateKey []byte) (bool, error)
- func GenerateCertificatePrivateKeyPair(template *x509.Certificate, caCertificate []byte, caPrivateKey []byte) (*bytes.Buffer, *bytes.Buffer, error)
- func IsValidCertificateKeyPairBytes(certificateBytes []byte, privateKeyBytes []byte) (bool, error)
- func NewCertificateTemplate(commonName string) *x509.Certificate
- func ParseCertificateBytes(content []byte) (*x509.Certificate, error)
- func ParsePrivateKeyBytes(content []byte) (*rsa.PrivateKey, error)
- func ParsePublicKeyBytes(content []byte) (*rsa.PublicKey, error)
- func VerifyCertificate(cert, ca []byte, usages ...x509.ExtKeyUsage) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCertificateAndPrivateKeyPairValidity ¶ added in v0.1.0
CheckCertificateAndPrivateKeyPairValidity checks if the certificate and private key pair are valid.
func CheckPublicAndPrivateKeyValidity ¶ added in v0.1.0
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 ¶
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
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.