Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sapcc/go-certcentral
GoLang client for the DigiCert cert-central API.
https://github.com/sapcc/go-certcentral
cert-central digicert digicert-certificate golang-client
Last synced: 11 days ago
JSON representation
GoLang client for the DigiCert cert-central API.
- Host: GitHub
- URL: https://github.com/sapcc/go-certcentral
- Owner: sapcc
- License: apache-2.0
- Created: 2020-07-14T17:23:34.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T02:31:46.000Z (11 months ago)
- Last Synced: 2024-06-21T15:45:43.001Z (5 months ago)
- Topics: cert-central, digicert, digicert-certificate, golang-client
- Language: Go
- Homepage:
- Size: 25.4 KB
- Stars: 6
- Watchers: 39
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
go-certcentral
--------------GoLang client for the [DigiCert cert-central services API](https://dev.digicert.com/services-api).
# Usage
```go
import cc "github.com/sapcc/go-certcentral"client, err := cc.New(&cc.Options{
Token: "DIGICERT_API_TOKEN",
IsDebug: false,
})
handleError(err)// Submit a certificate order.
orderResponse, err := cli.SubmitOrder(
cc.Order{
Certificate: cc.Certificate{
CommonName: csr.Subject.CommonName,
DNSNames: csr.DNSNames,
CSR: csr.PEM,
ServerPlatform: cc.ServerPlatformForType(cc.ServerPlatformTypes.Nginx),
SignatureHash: cc.SignatureHashes.SHA256,
CaCertID: "CACertID",
OrganizationUnits: []string{
"SomeOrganization ",
},
},
ValidityYears: 1,
DisableRenewalNotifications: true,
PaymentMethod: cc.PaymentMethods.Balance,
SkipApproval: true,
Organization: &cc.Organization{ID: 123456},
}, cc.OrderTypes.PrivateSSLPlus)
handleError(err)// If auto-approval is allowed the response contains the full chain of certificates in PEM format.
if len(orderResponse.CertificateChain) > 0 {
crtChain, err := orderResponse.DecodeCertificateChain()
handleError(err)for _, crt := range crtChain {
fmt.Println(crt.Subject.CommonName)
}
}// Download the certificate(s) for an order.
certList, err := client.DownloadCertificateForOrder("123456", cc.CertificateFormats.PEMAll)
handlerError(err)
for _, cert := range certList {
fmt.Println(cert.Subject.CommonName)
}```