Documentation ¶
Index ¶
- type CA
- func (this CA) CreateCA() CA
- func (this CA) CreateCSR() CA
- func (this CA) CreateCert(ca any) CA
- func (this CA) CreatePKCS12Cert(caCerts []*x509.Certificate, pwd string) CA
- func (this CA) CreatePKCS12CertTrustStore(certs []*x509.Certificate, password string) CA
- func (this CA) CreatePrivateKey() CA
- func (this CA) DecodePKCS12CertChain(pfxData []byte, password string) (privateKey interface{}, certificate *x509.Certificate, ...)
- func (this CA) DecodePKCS12CertTrustStore(pfxData []byte, password string) (certs []*x509.Certificate, err error)
- func (this CA) FromCert(cert *x509.Certificate) CA
- func (this CA) FromCertRequest(cert *x509.CertificateRequest) CA
- func (this CA) FromCertificateDer(der []byte) CA
- func (this CA) FromCertificateRequestDer(asn1Data []byte) CA
- func (this CA) FromPKCS12Cert(pfxData []byte, password string) CA
- func (this CA) FromPrivateKey(key any) CA
- func (this CA) FromPublicKey(key any) CA
- func (this CA) FromSM2PKCS12Cert(pfxData []byte, password string) CA
- func (this CA) FromSM2PKCS12OneCert(pfxData []byte, password string) CA
- func (this CA) GenerateEcdsaKey(curve string) CA
- func (this CA) GenerateEdDSAKey() CA
- func (this CA) GenerateRsaKey(bits int) CA
- func (this CA) GenerateSM2Key() CA
- func (this CA) GetCert() any
- func (this CA) GetCertRequest() any
- func (this CA) GetError() error
- func (this CA) GetKeyData() []byte
- func (this CA) GetPrivateKey() any
- func (this CA) GetPublicKey() any
- func (this CA) GetSM2SignatureAlgorithm(name string) sm2X509.SignatureAlgorithm
- func (this CA) GetSignatureAlgorithm(name string) x509.SignatureAlgorithm
- func (this CA) MakeCA(subject *pkix.Name, expire int, signAlgName string) CA
- func (this CA) MakeCSR(country []string, organization []string, organizationalUnit []string, ...) CA
- func (this CA) MakeCert(subject *pkix.Name, expire int, dns []string, ip []net.IP, signAlgName string) CA
- func (this CA) MakeSM2CA(subject *pkix.Name, expire int, signAlgName string) CA
- func (this CA) MakeSM2CSR(country []string, organization []string, organizationalUnit []string, ...) CA
- func (this CA) MakeSM2Cert(subject *pkix.Name, expire int, dns []string, ip []net.IP, signAlgName string) CA
- func (this CA) OnError(fn CAErrorFunc) CA
- func (this CA) SM2Verify(rootPEM string, certPEM string, opts sm2X509.VerifyOptions) (bool, error)
- func (this CA) ToKeyBytes() []byte
- func (this CA) ToKeyString() string
- func (this CA) UpdateCert(fn func(*x509.Certificate) *x509.Certificate) CA
- func (this CA) UpdateCertRequest(fn func(*x509.CertificateRequest) *x509.CertificateRequest) CA
- func (this CA) UpdateSM2Cert(fn func(*x509.Certificate) *x509.Certificate) CA
- func (this CA) UpdateSM2CertRequest(fn func(*x509.CertificateRequest) *x509.CertificateRequest) CA
- func (this CA) Verify(rootPEM string, certPEM string, opts x509.VerifyOptions) (bool, error)
- func (this CA) WithCert(data any) CA
- func (this CA) WithCertRequest(data any) CA
- func (this CA) WithError(err error) CA
- func (this CA) WithKeyData(data []byte) CA
- func (this CA) WithPrivateKey(data any) CA
- func (this CA) WithPublicKey(data any) CA
- type CACertificate
- type CACertificateRequest
- type CAErrorFunc
- type CAExtKeyUsage
- type CAKeyUsage
- type CAPkixAlgorithmIdentifier
- type CAPkixAttributeTypeAndValue
- type CAPkixAttributeTypeAndValueSET
- type CAPkixCertificateList
- type CAPkixExtension
- type CAPkixName
- type CAPkixRDNSequence
- type CAPkixRevokedCertificate
- type CAPkixTBSCertificateList
- type CAPublicKeyAlgorithm
- type CASM2Certificate
- type CASM2CertificateRequest
- type CASM2ExtKeyUsage
- type CASM2KeyUsage
- type CASM2PublicKeyAlgorithm
- type CASM2SignatureAlgorithm
- type CASM2VerifyOptions
- type CASignatureAlgorithm
- type CAVerifyOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CA ¶
type CA struct { // 错误 Error error // contains filtered or unexported fields }
*
- CA *
- @create 2022-7-22
- @author deatil
func (CA) CreatePKCS12Cert ¶
func (this CA) CreatePKCS12Cert(caCerts []*x509.Certificate, pwd string) CA
pkcs12 密钥 caCerts 通常保留为空 支持 [rsa | ecdsa | sm2]
func (CA) CreatePKCS12CertTrustStore ¶
func (this CA) CreatePKCS12CertTrustStore(certs []*x509.Certificate, password string) CA
pkcs12 密钥
func (CA) DecodePKCS12CertChain ¶
func (this CA) DecodePKCS12CertChain(pfxData []byte, password string) (privateKey interface{}, certificate *x509.Certificate, caCerts []*x509.Certificate, err error)
解析 pkcs12 cert
func (CA) DecodePKCS12CertTrustStore ¶
func (this CA) DecodePKCS12CertTrustStore(pfxData []byte, password string) (certs []*x509.Certificate, err error)
解析 pkcs12 cert
func (CA) FromCertificateRequestDer ¶
解析证书导入
func (CA) FromPrivateKey ¶
私钥 可用 [*rsa.PrivateKey | *ecdsa.PrivateKey | ed25519.PrivateKey]
func (CA) FromPublicKey ¶
公钥 可用 [*rsa.PublicKey | *ecdsa.PublicKey | ed25519.PublicKey]
func (CA) FromSM2PKCS12Cert ¶
pkcs12
func (CA) FromSM2PKCS12OneCert ¶
pkcs12
func (CA) GenerateEcdsaKey ¶
生成密钥 Ecdsa 可选 [P521 | P384 | P256 | P224]
func (CA) GenerateRsaKey ¶
生成密钥 RSA bits = 512 | 1024 | 2048 | 4096
func (CA) GetSM2SignatureAlgorithm ¶
func (this CA) GetSM2SignatureAlgorithm(name string) sm2X509.SignatureAlgorithm
获取 SM2 签名 alg
func (CA) GetSignatureAlgorithm ¶
func (this CA) GetSignatureAlgorithm(name string) x509.SignatureAlgorithm
获取签名 alg
func (CA) MakeCSR ¶
func (this CA) MakeCSR( country []string, organization []string, organizationalUnit []string, locality []string, province []string, streetAddress []string, postalCode []string, commonName string, ) CA
生成证书请求
func (CA) MakeCert ¶
func (this CA) MakeCert( subject *pkix.Name, expire int, dns []string, ip []net.IP, signAlgName string, ) CA
生成自签名证书
func (CA) MakeSM2CSR ¶
func (this CA) MakeSM2CSR( country []string, organization []string, organizationalUnit []string, locality []string, province []string, streetAddress []string, postalCode []string, commonName string, ) CA
生成证书请求
func (CA) MakeSM2Cert ¶
func (this CA) MakeSM2Cert( subject *pkix.Name, expire int, dns []string, ip []net.IP, signAlgName string, ) CA
生成自签名证书
func (CA) UpdateCert ¶
func (this CA) UpdateCert(fn func(*x509.Certificate) *x509.Certificate) CA
更新 Cert 数据
func (CA) UpdateCertRequest ¶
func (this CA) UpdateCertRequest(fn func(*x509.CertificateRequest) *x509.CertificateRequest) CA
更新证书请求数据
func (CA) UpdateSM2Cert ¶
func (this CA) UpdateSM2Cert(fn func(*x509.Certificate) *x509.Certificate) CA
更新 Cert 数据
func (CA) UpdateSM2CertRequest ¶
func (this CA) UpdateSM2CertRequest(fn func(*x509.CertificateRequest) *x509.CertificateRequest) CA
更新证书请求数据
func (CA) WithCertRequest ¶
设置 certRequest 可用 [*x509.CertificateRequest | *sm2X509.CertificateRequest]
type CAPkixAlgorithmIdentifier ¶
type CAPkixAlgorithmIdentifier = pkix.AlgorithmIdentifier
AlgorithmIdentifier
type CAPkixAttributeTypeAndValue ¶
type CAPkixAttributeTypeAndValue = pkix.AttributeTypeAndValue
AttributeTypeAndValue 数据
type CAPkixAttributeTypeAndValueSET ¶
type CAPkixAttributeTypeAndValueSET = pkix.AttributeTypeAndValueSET
AttributeTypeAndValueSET
type CAPkixRevokedCertificate ¶
type CAPkixRevokedCertificate = pkix.RevokedCertificate
RevokedCertificate
type CAPkixTBSCertificateList ¶
type CAPkixTBSCertificateList = pkix.TBSCertificateList
TBSCertificateList
type CASM2PublicKeyAlgorithm ¶
type CASM2PublicKeyAlgorithm = sm2X509.PublicKeyAlgorithm
PublicKeyAlgorithm
type CASM2SignatureAlgorithm ¶
type CASM2SignatureAlgorithm = sm2X509.SignatureAlgorithm
SignatureAlgorithm