Documentation ¶
Index ¶
- Variables
- type CybercomServer
- func (c CybercomServer) GetCertificate(ctx context.Context, id *pb.Id) (*pb.Certificate, error)
- func (c CybercomServer) GetCertificateBySerial(ctx context.Context, serial *pb.Serial) (*pb.Certificate, error)
- func (c CybercomServer) GetCertificates(id *pb.Id, stream pb.Cybercom_GetCertificatesServer) error
- func (c CybercomServer) GetConfiguration(ctx context.Context, e *pb.Empty) (*pb.Configuration, error)
- func (c CybercomServer) GetEntities(_ *pb.Empty, stream pb.Cybercom_GetEntitiesServer) error
- func (c CybercomServer) GetEntity(ctx context.Context, id *pb.Id) (*pb.Entity, error)
- func (c CybercomServer) GetEntityBySerial(ctx context.Context, serial *pb.Serial) (*pb.Entity, error)
- func (c CybercomServer) IssueCertificate(ctx context.Context, id *pb.Id) (*pb.Certificate, error)
- func (c CybercomServer) Register(ctx context.Context, csr *pb.CSR) (*pb.Entity, error)
- func (c CybercomServer) Renew(ctx context.Context, _ *pb.Empty) (*pb.Certificate, error)
- func (c CybercomServer) SetEntityExpiry(ctx context.Context, e *pb.Entity) (*pb.Entity, error)
- func (c CybercomServer) SetEntityLongevity(ctx context.Context, e *pb.Entity) (*pb.Entity, error)
- func (c CybercomServer) SetEntityState(ctx context.Context, e *pb.Entity) (*pb.Entity, error)
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var NotFound = fmt.Errorf("Record not found")
Common Error returned if the record is not found in our underlying database. This can be handy for ducking missing records without eating all errors.
Functions ¶
This section is empty.
Types ¶
type CybercomServer ¶
type CybercomServer struct {
// contains filtered or unexported fields
}
Encapsulated Server
func New ¶
func New( options Options, ) (*CybercomServer, error)
Create a new CYBERCOM Server, complete with the CA which will issue requests for Certificates, the Policy to define the translation step before signing, the Translator to turn a CSR into a Certifciate, and the ACL to define who can preform what actions.
func (CybercomServer) GetCertificate ¶
func (c CybercomServer) GetCertificate(ctx context.Context, id *pb.Id) (*pb.Certificate, error)
func (CybercomServer) GetCertificateBySerial ¶
func (c CybercomServer) GetCertificateBySerial(ctx context.Context, serial *pb.Serial) (*pb.Certificate, error)
func (CybercomServer) GetCertificates ¶
func (c CybercomServer) GetCertificates(id *pb.Id, stream pb.Cybercom_GetCertificatesServer) error
func (CybercomServer) GetConfiguration ¶
func (c CybercomServer) GetConfiguration(ctx context.Context, e *pb.Empty) (*pb.Configuration, error)
func (CybercomServer) GetEntities ¶
func (c CybercomServer) GetEntities(_ *pb.Empty, stream pb.Cybercom_GetEntitiesServer) error
func (CybercomServer) GetEntityBySerial ¶
func (CybercomServer) IssueCertificate ¶
func (c CybercomServer) IssueCertificate(ctx context.Context, id *pb.Id) (*pb.Certificate, error)
func (CybercomServer) Renew ¶
func (c CybercomServer) Renew(ctx context.Context, _ *pb.Empty) (*pb.Certificate, error)
func (CybercomServer) SetEntityExpiry ¶
func (CybercomServer) SetEntityLongevity ¶
func (CybercomServer) SetEntityState ¶
type Options ¶
type Options struct { // Active connection to the underlying database we'll store and read our // Certificates and Entities from. It's important that the underlying // database be OK with reading and writing raw bytes, most notibly, this // means SQLite will not work. Database *gorm.DB // The Cybercom ACL helps ensure that only authorized peers can access // the relevent API endpoints. ACL acl.ACL // Cybercom CA that we will issue new Certificates off of. CA ca.CA // Take CSRs and turn them into x509 Certificates. Translator policy.Translator // Default for Certifciate longevity; this can be optionally overridden // on a per-Entity basis by updating the Database ReissueGrace time.Duration // Name of this CA Server (something like Strexcorp Synnernists, Inc, or // Paul's CA), used for display purposes only. Name string // Defaults optionally given to the user for prompting for an appropriate // Subject for a new Entity. CertificateTemplate pkix.Name // CA Certificates that we would like clients to know about in order to // validate Certificates that we care to have them know about. CACertificates []*x509.Certificate }
Click to show internal directories.
Click to hide internal directories.