Documentation
¶
Index ¶
Constants ¶
const ( StatusActive = "active" StatusRevoked = "revoked" StatusPending = "pending" )
Enrollment status constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChallengeRenewalRequest ¶
type ChallengeRenewalRequest struct {
ServerID string `json:"server_id"`
Fingerprint string `json:"fingerprint"`
ExpiredCert string `json:"expired_cert"` // PEM-encoded expired client certificate
CSR string `json:"csr"` // PEM-encoded new CSR
Proof string `json:"proof"` // base64-encoded signature over SHA256 digest
}
ChallengeRenewalRequest is sent by a device with an expired certificate to prove its identity via signature proof and obtain a fresh certificate (Tier 2 renewal). The proof is computed over SHA256(server_id + "\n" + fingerprint + "\n" + csr), signed with the old private key.
type EnrollMode ¶
type EnrollMode int
EnrollMode controls how the server handles new enrollment requests.
const ( ModeAuto EnrollMode = iota // any valid build secret is immediately enrolled ModeToken // requires a pre-generated enrollment token (future) ModeApproval // enrollment is queued for admin approval (future) )
type Enrollment ¶
type Enrollment struct {
ServerID string `json:"server_id"`
Fingerprint string `json:"fingerprint"`
Hostname string `json:"hostname"`
OS string `json:"os"`
Arch string `json:"arch"`
SerialNumber string `json:"serial_number"` // certificate serial (hex), for revocation
EnrolledAt time.Time `json:"enrolled_at"`
RenewedAt time.Time `json:"renewed_at,omitempty"` // zero value = never renewed
LastSeenAt time.Time `json:"last_seen_at"`
LastIP string `json:"last_ip"`
Status string `json:"status"` // "active", "revoked", "pending"
}
Enrollment represents a registered device in the enrollment store.
type EnrollmentRequest ¶
type EnrollmentRequest struct {
BuildSecret string `json:"build_secret"`
Fingerprint string `json:"fingerprint"`
Hostname string `json:"hostname"`
OS string `json:"os"`
Arch string `json:"arch"`
CSR string `json:"csr"` // PEM-encoded PKCS#10 certificate signing request
}
EnrollmentRequest is sent by a device to enroll with a service. The build secret proves the software is genuine; the fingerprint uniquely identifies the machine; the CSR lets the service issue a client certificate without ever seeing the device's private key.
type EnrollmentResponse ¶
type EnrollmentResponse struct {
ServerID string `json:"server_id"`
Certificate string `json:"certificate"` // PEM-encoded signed client certificate
CACertificate string `json:"ca_certificate"` // PEM-encoded CA certificate
}
EnrollmentResponse is returned by the service after a successful enrollment. The certificate is signed by the service's internal CA and can be used for mTLS on all subsequent requests.
type RenewalRequest ¶
type RenewalRequest struct {
CSR string `json:"csr"` // PEM-encoded PKCS#10 certificate signing request
}
RenewalRequest is sent by a device with a valid (not-yet-expired) certificate to obtain a fresh certificate via mTLS (Tier 1 renewal).