Documentation ¶
Index ¶
- func CleanCsrFil(csrFilnam string, csrList *CsrList) (err error)
- func CreateCsr(csrTpl x509.CertificateRequest, certKey *ecdsa.PrivateKey) (csr []byte, err error)
- func CreateCsrTpl(csrData CsrDat) (template x509.CertificateRequest)
- func CreateCsrTplNew(csrList *CsrList, domIdx int) (template x509.CertificateRequest, err error)
- func DecodeKey(pemEncoded string, pemEncodedPub string) (*ecdsa.PrivateKey, *ecdsa.PublicKey)
- func EncodeKey(privateKey *ecdsa.PrivateKey, publicKey *ecdsa.PublicKey) (string, string)
- func GenCertKey() (certKey *ecdsa.PrivateKey, err error)
- func GenerateCertName(domain string) (certName string, err error)
- func GetAcmeClient(acntNam string) (cl *acme.Client, err error)
- func GetCertDir(acntNam string) (certDir string, err error)
- func GetLEClient(acntNam string, dbg bool) (cl *acme.Client, err error)
- func InitCertLib() (certobj *certLibObj, err error)
- func ParseCertsInfo(derCerts [][]byte, certInfoFilnam string) (err error)
- func ParseCsr(csr []byte) (certReq *x509.CertificateRequest, err error)
- func PrintAccount(acnt *acme.Account)
- func PrintAuth(auth *acme.Authorization)
- func PrintCert(cert *x509.Certificate)
- func PrintCertInfo(cert x509.Certificate, i int)
- func PrintCertObj(cert *certLibObj)
- func PrintChallenge(chal *acme.Challenge, domain string)
- func PrintClient(client *acme.Client)
- func PrintCsrList(csrlist *CsrList)
- func PrintCsrReq(req *x509.CertificateRequest)
- func PrintDir(dir acme.Directory)
- func PrintDomains(domains []string)
- func PrintJsAccount(acnt *JsAcnt)
- func PrintLEAcnt(acnt *LEObj)
- func PrintOrder(ord acme.Order)
- func PrintPkixNam(subj pkix.Name)
- func ReadPemCerts(certFile string, dbg bool) (err error)
- func RegisterClient(ctx context.Context, client *acme.Client, contacts []string, dbg bool) (ac *acme.Account, err error)
- func SaveAcmeClient(client *acme.Client, filNam string) (err error)
- func SaveCertsPem(derCerts [][]byte, certFile string) (err error)
- func SaveKeyPem(certKey *ecdsa.PrivateKey, keyFilNam string) (err error)
- func WriteCsrFil(outFilnam string, csrDatList *CsrList) (err error)
- type CertList
- type CsrDat
- type CsrList
- type JsAcnt
- type LEObj
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanCsrFil ¶
func CreateCsr ¶
func CreateCsr(csrTpl x509.CertificateRequest, certKey *ecdsa.PrivateKey) (csr []byte, err error)
func CreateCsrTpl ¶
func CreateCsrTpl(csrData CsrDat) (template x509.CertificateRequest)
create certficate sign request
func CreateCsrTplNew ¶
func CreateCsrTplNew(csrList *CsrList, domIdx int) (template x509.CertificateRequest, err error)
create certficate sign request
func GenCertKey ¶
func GenCertKey() (certKey *ecdsa.PrivateKey, err error)
func GenerateCertName ¶
generate cert names
func GetAcmeClient ¶
function to retrieve keys for LetsEncrypt acme account
func GetCertDir ¶
func InitCertLib ¶
func InitCertLib() (certobj *certLibObj, err error)
func ParseCertsInfo ¶
func PrintAccount ¶
func PrintAuth ¶
func PrintAuth(auth *acme.Authorization)
func PrintCert ¶
func PrintCert(cert *x509.Certificate)
func PrintCertInfo ¶
func PrintCertInfo(cert x509.Certificate, i int)
func PrintCertObj ¶
func PrintCertObj(cert *certLibObj)
func PrintChallenge ¶
func PrintClient ¶
func PrintCsrReq ¶
func PrintCsrReq(req *x509.CertificateRequest)
func PrintDomains ¶
func PrintDomains(domains []string)
func PrintJsAccount ¶
func PrintJsAccount(acnt *JsAcnt)
func PrintLEAcnt ¶
func PrintLEAcnt(acnt *LEObj)
func PrintOrder ¶
func PrintPkixNam ¶
func ReadPemCerts ¶
func RegisterClient ¶
func RegisterClient(ctx context.Context, client *acme.Client, contacts []string, dbg bool) (ac *acme.Account, err error)
registers client with the acme server
func SaveAcmeClient ¶
function that saves the keys in certDir
func SaveCertsPem ¶
func SaveKeyPem ¶
func SaveKeyPem(certKey *ecdsa.PrivateKey, keyFilNam string) (err error)
from https://github.com/eggsampler/acme/blob/master/examples/certbot/certbot.go#L269
func WriteCsrFil ¶
Types ¶
type CsrDat ¶
type CsrDat struct { Domain string `yaml:"domain"` Email string `yaml:"email"` PemFil string `yaml:"pemfil"` ChalRecId string `yaml:"chalrec"` Token string `yaml:"token"` TokVal string `yaml:"tokval"` TokUrl string `yaml:"tokUrl"` TokIssue time.Time `yaml:"issue"` TokExp time.Time `yaml:"expire"` OrderUrl string `yaml:"orderUrl"` CertUrl string `yaml:"certUrl"` Name pkixName `yaml:"Name"` }
type CsrList ¶
type CsrList struct { AcntName string `yaml:"account"` LastLU time.Time `yaml:"last"` OrderUrl string `yaml:"orderUrl"` CertUrl string `yaml:"certUrl"` Domains []CsrDat `yaml:"domains"` }
func ReadCsrFil ¶
functions that reads CSRList from a file
type JsAcnt ¶
type JsAcnt struct { // URI is the account unique ID, which is also a URL used to retrieve // account data from the CA. // When interfacing with RFC 8555-compliant CAs, URI is the "kid" field // value in JWS signed requests. URI string `yaml: "URI"` // Contact is a slice of contact info used during registration. // See https://tools.ietf.org/html/rfc8555#section-7.3 for supported // formats. Contact []string `yaml: "Contact"` // Status indicates current account status as returned by the CA. // Possible values are StatusValid, StatusDeactivated, and StatusRevoked. Status string `yaml: "Status"` // OrdersURL is a URL from which a list of orders submitted by this account // can be fetched. OrdersURL string `yaml: "OrdersURL"` // The terms user has agreed to. // A value not matching CurrentTerms indicates that the user hasn't agreed // to the actual Terms of Service of the CA. // // It is non-RFC 8555 compliant. Package users can store the ToS they agree to // during Client's Register call in the prompt callback function. AgreedTerms string `yaml: "Terms"` // Actual terms of a CA. // // It is non-RFC 8555 compliant. Use Directory's Terms field. // When a CA updates their terms and requires an account agreement, // a URL at which instructions to do so is available in Error's Instance field. CurrentTerms string `yaml: "CurTerms"` // Authz is the authorization URL used to initiate a new authz flow. // // It is non-RFC 8555 compliant. Use Directory's AuthzURL or OrderURL. Authz string `yaml: "Authz"` // Authorizations is a URI from which a list of authorizations // granted to this account can be fetched via a GET request. // // It is non-RFC 8555 compliant and is obsoleted by OrdersURL. Authorizations string `yaml: "Auth"` // Certificates is a URI from which a list of certificates // issued for this account can be fetched via a GET request. // // It is non-RFC 8555 compliant and is obsoleted by OrdersURL. Certificates string `yaml: "Certs"` // ExternalAccountBinding represents an arbitrary binding to an account of // the CA which the ACME server is tied to. // See https://tools.ietf.org/html/rfc8555#section-7.3.4 for more details. ExternalAccountBinding *acme.ExternalAccountBinding `yaml: "ExtAcct"` }
yaml version of type acme.Account
type LEObj ¶
type LEObj struct { AcntNam string `yaml:"AcntName"` AcntId string `yaml:"AcntId"` PrivKeyFilnam string `yaml:"PrivKeyFilnam"` PubKeyFilnam string `yaml:"PubKeyFilnam"` Updated time.Time `yaml:"update"` // Client *acme.Client // Acnt *acme.Account Contacts []string `yaml:"contacts"` Remove bool `yaml:"remove"` UseProd bool `yaml:"useProd"` TestUrl string `yaml:"TestUrl"` ProdUrl string `yaml:"ProdUrl"` }
Click to show internal directories.
Click to hide internal directories.