web

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertInfoHandler added in v0.2.0

func CertInfoHandler(w http.ResponseWriter, r *http.Request)

CertInfoHandler 查看证书信息处理器

func CheckRevokedHandler added in v0.2.0

func CheckRevokedHandler(w http.ResponseWriter, r *http.Request)

CheckRevokedHandler 检查证书吊销状态处理器

func DecryptHandler

func DecryptHandler(w http.ResponseWriter, r *http.Request)

DecryptHandler 解密处理器

func EncryptHandler

func EncryptHandler(w http.ResponseWriter, r *http.Request)

EncryptHandler 加密处理器

func GenCRLHandler added in v0.2.0

func GenCRLHandler(w http.ResponseWriter, r *http.Request)

GenCRLHandler 生成 CRL 处理器

func GenCSRHandler added in v0.2.0

func GenCSRHandler(w http.ResponseWriter, r *http.Request)

GenCSRHandler 生成 CSR 处理器

func GenRootCAHandler

func GenRootCAHandler(w http.ResponseWriter, r *http.Request)

GenRootCAHandler 生成根证书处理器

func SignCSRHandler added in v0.2.0

func SignCSRHandler(w http.ResponseWriter, r *http.Request)

SignCSRHandler 签发 CSR 处理器

func SignCertHandler

func SignCertHandler(w http.ResponseWriter, r *http.Request)

SignCertHandler 签发证书处理器

func SignHandler

func SignHandler(w http.ResponseWriter, r *http.Request)

SignHandler 签名处理器

func StartServer

func StartServer(host string, port int, staticDir, version string) error

StartServer 启动 Web 服务器

func ValidateChainHandler

func ValidateChainHandler(w http.ResponseWriter, r *http.Request)

ValidateChainHandler 验证证书链处理器

func VerifyHandler

func VerifyHandler(w http.ResponseWriter, r *http.Request)

VerifyHandler 验签处理器

func VersionHandler

func VersionHandler(version string) http.HandlerFunc

VersionHandler 返回版本处理器

func ViewCRLHandler added in v0.2.0

func ViewCRLHandler(w http.ResponseWriter, r *http.Request)

ViewCRLHandler 查看 CRL 处理器

Types

type CertInfoRequest added in v0.2.0

type CertInfoRequest struct {
	Cert string `json:"cert"`
}

CertInfoRequest 查看证书信息请求

type CheckRevokedRequest added in v0.2.0

type CheckRevokedRequest struct {
	Cert string `json:"cert"`
	CRL  string `json:"crl"`
}

CheckRevokedRequest 检查证书吊销状态请求

type DecryptRequest

type DecryptRequest struct {
	Key  string `json:"key"`
	Data string `json:"data"`
}

DecryptRequest 解密请求

type EncryptRequest

type EncryptRequest struct {
	Cert string `json:"cert"`
	Data string `json:"data"`
}

EncryptRequest 加密请求

type GenCRLRequest added in v0.2.0

type GenCRLRequest struct {
	CACert         string   `json:"caCert"`
	CAKey          string   `json:"caKey"`
	RevokedCerts   []string `json:"revokedCerts"`
	ExistingCRL    string   `json:"existingCRL"`
	SkipExpired    bool     `json:"skipExpired"`
	PruneAfterDays int      `json:"pruneAfterDays"`
	Days           int      `json:"days"`
}

GenCRLRequest 生成 CRL 请求

type GenCSRRequest added in v0.2.0

type GenCSRRequest struct {
	Algorithm  string `json:"algorithm"`
	RSABits    int    `json:"rsaBits"`
	ECDSACurve string `json:"ecdsaCurve"`
	CommonName string `json:"commonName"`
	Org        string `json:"org"`
	Country    string `json:"country"`
	State      string `json:"state"`
	Locality   string `json:"locality"`
	DNSNames   string `json:"dnsNames"`
	IPAddrs    string `json:"ipAddrs"`
}

GenCSRRequest 生成 CSR 请求

type GenRootCARequest

type GenRootCARequest struct {
	Algorithm   string `json:"algorithm"`
	RSABits     int    `json:"rsaBits"`
	ECDSACurve  string `json:"ecdsaCurve"`
	Days        int    `json:"days"`
	CommonName  string `json:"commonName"`
	Org         string `json:"org"`
	Country     string `json:"country"`
	State       string `json:"state"`
	Locality    string `json:"locality"`
	MaxPathLen  int    `json:"maxPathLen"`
	PathLenZero bool   `json:"pathLenZero"`
}

GenRootCARequest 生成根证书请求

type Response

type Response struct {
	Success bool        `json:"success"`
	Message string      `json:"message,omitempty"`
	Data    interface{} `json:"data,omitempty"`
	Error   string      `json:"error,omitempty"`
}

Response 通用响应结构

type SignCSRRequest added in v0.2.0

type SignCSRRequest struct {
	CACert string `json:"caCert"`
	CAKey  string `json:"caKey"`
	CSR    string `json:"csr"`
	Days   int    `json:"days"`
	Usage  string `json:"usage"`
	IsCA   bool   `json:"isCA"`
}

SignCSRRequest 签发 CSR 请求

type SignCertRequest

type SignCertRequest struct {
	CACert     string `json:"caCert"`
	CAKey      string `json:"caKey"`
	Algorithm  string `json:"algorithm"`
	RSABits    int    `json:"rsaBits"`
	ECDSACurve string `json:"ecdsaCurve"`
	Days       int    `json:"days"`
	CommonName string `json:"commonName"`
	Org        string `json:"org"`
	Country    string `json:"country"`
	DNSNames   string `json:"dnsNames"`
	IPAddrs    string `json:"ipAddrs"`
	Usage      string `json:"usage"`
	IsCA       bool   `json:"isCA"`
}

SignCertRequest 签发证书请求

type SignRequest

type SignRequest struct {
	Key  string `json:"key"`
	Data string `json:"data"`
}

SignRequest 签名请求

type ValidateChainRequest

type ValidateChainRequest struct {
	CACert          string   `json:"caCert"`
	Cert            string   `json:"cert"`
	IntermediateCAs []string `json:"intermediateCAs"`
	DNSName         string   `json:"dnsName"`
	Usage           string   `json:"usage"`
}

ValidateChainRequest 验证证书链请求

type VerifyRequest

type VerifyRequest struct {
	Cert      string `json:"cert"`
	Data      string `json:"data"`
	Signature string `json:"signature"`
}

VerifyRequest 验签请求

type ViewCRLRequest added in v0.2.0

type ViewCRLRequest struct {
	CRL string `json:"crl"`
}

ViewCRLRequest 查看 CRL 请求

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL