cert

package
v0.0.0-...-a17827a Latest Latest
Warning

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

Go to latest
Published: May 14, 2017 License: GPL-3.0 Imports: 18 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCSRSignature

func CheckCSRSignature(csr *x509.CertificateRequest, algo x509.SignatureAlgorithm, signed, signature []byte) error

CheckCSRSignature verifies a signature made by the key on a CSR. nolint: gocyclo

func EncodeCertificatePEM

func EncodeCertificatePEM(cert *x509.Certificate) (encoded []byte, err error)

EncodeCertificatePEM encodes a single x509 certficates to PEM

func EncodePrivateKeyPEM

func EncodePrivateKeyPEM(key crypto.PrivateKey) (encoded []byte, err error)

EncodePrivateKeyPEM encodes a single private key to PEM

func FingerprintSHA256

func FingerprintSHA256(pubKeyDER []byte) string

FingerprintSHA256 returns the user presentation of the key's fingerprint as unpadded base64 encoded sha256 hash. This format was introduced from OpenSSH 6.8. https://www.openssh.com/txt/release-6.8 https://tools.ietf.org/html/rfc4648#section-3.2 (unpadded base64 encoding) inspired from x/crypto/ssh package

func KeyPairFromFiles

func KeyPairFromFiles(certPath string, keyPath string, keyPassword []byte) (cert *x509.Certificate, key crypto.PrivateKey, err error)

KeyPairFromFiles load files from path and return a certificate and a password key

func ParseCSR

func ParseCSR(in []byte) (csr *x509.CertificateRequest, err error)

ParseCSR parses a PEM-encoded PKCS #10 certificate signing request.

func ParseCertificatePEM

func ParseCertificatePEM(certPEM []byte) (cert *x509.Certificate, err error)

ParseCertificatePEM parses and returns a PEM-encoded certificate

func ParseCertificatePEMFromFile

func ParseCertificatePEMFromFile(filename string) (cert *x509.Certificate, err error)

ParseCertificatePEMFromFile call ParseCertificatePEM with the content of a file

func ParsePrivateKeyPEM

func ParsePrivateKeyPEM(keyPEM []byte, password []byte) (key crypto.PrivateKey, err error)

ParsePrivateKeyPEM parses and returns a PEM-encoded private key. The private key may be a potentially encrypted PKCS#8, PKCS#1, or elliptic private key. nolint: gocyclo

func ParsePrivateKeyPEMFromFile

func ParsePrivateKeyPEMFromFile(filename string, password []byte) (key crypto.PrivateKey, err error)

ParsePrivateKeyPEMFromFile call ParsePrivateKeyPEM with the content of a file

func PublicKeyAlgorithmToString

func PublicKeyAlgorithmToString(pka x509.PublicKeyAlgorithm) string

PublicKeyAlgorithmToString return a string representation of a x509.PublicKeyAlgorithm

func RSAKeysFromFiles

func RSAKeysFromFiles(pubPath string, keyPath string, keyPassword []byte) (pub *rsa.PublicKey, key *rsa.PrivateKey, err error)

RSAFromFiles load files from path and return a certificate and a password key

func Revoke

func Revoke(cert *x509.Certificate) (err error)

Revoke the certificate made him unusable for login

func TLSCertificateFromFiles

func TLSCertificateFromFiles(certPath string, keyPath string, keyPassword []byte) (tlsCert *tls.Certificate, err error)

TLSCertificateFromFiles load files from path and return a tls certificate

func VerifyCertificate

func VerifyCertificate(cert *x509.Certificate) (revoked bool, err error)

VerifyCertificate check for a certificate revokation

Types

This section is empty.

Jump to

Keyboard shortcuts

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