certificates/cas/apiv1/requests.go

61 lines
1.6 KiB
Go
Raw Normal View History

package apiv1
import (
"crypto/x509"
"time"
)
2020-09-15 02:12:49 +00:00
// CreateCertificateRequest is the request used to sign a new certificate.
type CreateCertificateRequest struct {
2020-09-10 23:19:18 +00:00
Template *x509.Certificate
Lifetime time.Duration
Backdate time.Duration
RequestID string
}
2020-09-15 02:12:49 +00:00
// CreateCertificateResponse is the response to a create certificate request.
type CreateCertificateResponse struct {
Certificate *x509.Certificate
CertificateChain []*x509.Certificate
}
2020-09-15 02:12:49 +00:00
// RenewCertificateRequest is the request used to re-sign a certificate.
2020-09-10 23:19:18 +00:00
type RenewCertificateRequest struct {
Template *x509.Certificate
Lifetime time.Duration
Backdate time.Duration
RequestID string
}
2020-09-15 02:12:49 +00:00
// RenewCertificateResponse is the response to a renew certificate request.
2020-09-10 23:19:18 +00:00
type RenewCertificateResponse struct {
Certificate *x509.Certificate
CertificateChain []*x509.Certificate
}
2020-09-10 23:19:18 +00:00
// RevokeCertificateRequest is the request used to revoke a certificate.
type RevokeCertificateRequest struct {
Certificate *x509.Certificate
2020-09-15 02:12:49 +00:00
Reason string
ReasonCode int
RequestID string
2020-09-10 23:19:18 +00:00
}
2020-09-15 02:12:49 +00:00
// RevokeCertificateResponse is the response to a revoke certificate request.
2020-09-10 23:19:18 +00:00
type RevokeCertificateResponse struct {
Certificate *x509.Certificate
CertificateChain []*x509.Certificate
}
// GetCertificateAuthorityRequest is the request used to get the root
// certificate from a CAS.
type GetCertificateAuthorityRequest struct {
Name string
}
// GetCertificateAuthorityResponse is the response that contains
// the root certificate.
type GetCertificateAuthorityResponse struct {
RootCertificate *x509.Certificate
}