Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHandler ¶
func AddHandler(svr *kitNetGrpc.Server, cfg SignerConfig) error
func Register ¶
func Register(server *grpc.Server, handler *RequestHandler)
Register registers the handler instance with a gRPC server.
Types ¶
type CertificateSigner ¶
type RequestHandler ¶
type RequestHandler struct { ValidFrom func() time.Time ValidFor time.Duration Certificate []*x509.Certificate PrivateKey crypto.PrivateKey }
RequestHandler handles incoming requests.
func NewRequestHandler ¶
func NewRequestHandler( ValidFrom func() time.Time, ValidFor time.Duration, Certificate []*x509.Certificate, PrivateKey crypto.PrivateKey) *RequestHandler
NewRequestHandler factory for new RequestHandler.
func NewRequestHandlerFromConfig ¶
func NewRequestHandlerFromConfig(cfg SignerConfig) (*RequestHandler, error)
func (*RequestHandler) SignCertificate ¶
func (r *RequestHandler) SignCertificate(ctx context.Context, req *pb.SignCertificateRequest) (*pb.SignCertificateResponse, error)
func (*RequestHandler) SignIdentityCertificate ¶
func (r *RequestHandler) SignIdentityCertificate(ctx context.Context, req *pb.SignCertificateRequest) (*pb.SignCertificateResponse, error)
type SignerConfig ¶
type SignerConfig struct { Certificate string `envconfig:"CERTIFICATE"` PrivateKey string `envconfig:"PRIVATE_KEY"` ValidFrom ValidFromDecoder `envconfig:"VALID_FROM" default:"now"` ValidDuration time.Duration `envconfig:"VALID_DURATION" default:"87600h"` }
type ValidFromDecoder ¶
func (*ValidFromDecoder) Decode ¶
func (d *ValidFromDecoder) Decode(value string) error
Click to show internal directories.
Click to hide internal directories.