lego: github.com/go-acme/lego/certcrypto Index | Files

package certcrypto

import "github.com/go-acme/lego/certcrypto"

Index

Package Files

crypto.go

Constants

const (
    EC256   = KeyType("P256")
    EC384   = KeyType("P384")
    RSA2048 = KeyType("2048")
    RSA4096 = KeyType("4096")
    RSA8192 = KeyType("8192")
)

Constants for all key types we support.

const (
    // OCSPGood means that the certificate is valid.
    OCSPGood = ocsp.Good
    // OCSPRevoked means that the certificate has been deliberately revoked.
    OCSPRevoked = ocsp.Revoked
    // OCSPUnknown means that the OCSP responder doesn't know about the certificate.
    OCSPUnknown = ocsp.Unknown
    // OCSPServerFailed means that the OCSP responder failed to process the request.
    OCSPServerFailed = ocsp.ServerFailed
)

func ExtractDomains Uses

func ExtractDomains(cert *x509.Certificate) []string

func ExtractDomainsCSR Uses

func ExtractDomainsCSR(csr *x509.CertificateRequest) []string

func GenerateCSR Uses

func GenerateCSR(privateKey crypto.PrivateKey, domain string, san []string, mustStaple bool) ([]byte, error)

func GeneratePemCert Uses

func GeneratePemCert(privateKey *rsa.PrivateKey, domain string, extensions []pkix.Extension) ([]byte, error)

func GeneratePrivateKey Uses

func GeneratePrivateKey(keyType KeyType) (crypto.PrivateKey, error)

func PEMBlock Uses

func PEMBlock(data interface{}) *pem.Block

func PEMEncode Uses

func PEMEncode(data interface{}) []byte

func ParsePEMBundle Uses

func ParsePEMBundle(bundle []byte) ([]*x509.Certificate, error)

ParsePEMBundle parses a certificate bundle from top to bottom and returns a slice of x509 certificates. This function will error if no certificates are found.

func ParsePEMCertificate Uses

func ParsePEMCertificate(cert []byte) (*x509.Certificate, error)

ParsePEMCertificate returns Certificate from a PEM encoded certificate. The certificate has to be PEM encoded. Any other encodings like DER will fail.

func ParsePEMPrivateKey Uses

func ParsePEMPrivateKey(key []byte) (crypto.PrivateKey, error)

func PemDecodeTox509CSR Uses

func PemDecodeTox509CSR(pem []byte) (*x509.CertificateRequest, error)

type DERCertificateBytes Uses

type DERCertificateBytes []byte

type KeyType Uses

type KeyType string

KeyType represents the key algo as well as the key size or curve to use.

Package certcrypto imports 14 packages (graph) and is imported by 16 packages. Updated 2019-03-11. Refresh now. Tools for package owners.