Documentation ¶
Index ¶
- func CreateCA(cn string, expireDays int) (crtPEM []byte, keyPEM []byte, err error)
- func GenerateCertificate(config CertificateConfig, opts ...GenerateCertificateOption) (certPEM []byte, keyPEM []byte, err error)
- func SSC(caPEM []byte, keyPEM []byte) (serverTLS *tls.Config, clientTLS *tls.Config, err error)
- type CertificateConfig
- type CertificatePkixName
- type GenerateCertificateOption
- type GenerateCertificateOptions
- type KeyName
- type KeyType
- func ECDSA() KeyType
- func ECDSAWithCurve(curve elliptic.Curve) KeyType
- func ED25519() KeyType
- func ED25519WithSeed(seed []byte) KeyType
- func EncryptMasterSM9() KeyType
- func ParsePrivateKey(keyPEM []byte) (key any, keyType KeyType, err error)
- func RSA() KeyType
- func RSAWithBits(bits int) KeyType
- func SM2() KeyType
- func SignMasterSM9() KeyType
- func X25519() KeyType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateCertificate ¶ added in v1.1.0
func GenerateCertificate(config CertificateConfig, opts ...GenerateCertificateOption) (certPEM []byte, keyPEM []byte, err error)
Types ¶
type CertificateConfig ¶ added in v1.1.0
type CertificateConfig struct { Issuer *CertificatePkixName Subject *CertificatePkixName IPs []string Emails []string DNSNames []string }
type CertificatePkixName ¶ added in v1.8.0
type CertificatePkixName struct { Country string Province string Locality string Organization string OrganizationalUnit string StreetAddress string PostalCode string SerialNumber string CommonName string }
func (*CertificatePkixName) Name ¶ added in v1.8.0
func (pn *CertificatePkixName) Name() pkix.Name
type GenerateCertificateOption ¶ added in v1.1.0
type GenerateCertificateOption func(*GenerateCertificateOptions) error
func CA ¶ added in v1.1.0
func CA() GenerateCertificateOption
func WithExpirationDays ¶ added in v1.1.0
func WithExpirationDays(days int) GenerateCertificateOption
func WithKeyType ¶ added in v1.8.0
func WithKeyType(keyType KeyType) GenerateCertificateOption
func WithParent ¶ added in v1.1.0
func WithParent(certPEM []byte, keyPEM []byte) GenerateCertificateOption
func WithSerialNumber ¶ added in v1.1.0
func WithSerialNumber(sn uint64) GenerateCertificateOption
type GenerateCertificateOptions ¶ added in v1.1.0
type GenerateCertificateOptions struct {
// contains filtered or unexported fields
}
type KeyType ¶ added in v1.8.0
type KeyType interface {
Name() (name KeyName)
}
func ECDSAWithCurve ¶ added in v1.8.0
func ED25519WithSeed ¶ added in v1.8.0
func EncryptMasterSM9 ¶ added in v1.8.0
func EncryptMasterSM9() KeyType
func ParsePrivateKey ¶ added in v1.8.0
func RSAWithBits ¶ added in v1.8.0
func SignMasterSM9 ¶ added in v1.8.0
func SignMasterSM9() KeyType
Directories ¶
Path | Synopsis |
---|---|
commands
|
|
gmsm
|
|
internal/alias
Package alias implements memory alaising tests.
|
Package alias implements memory alaising tests. |
internal/boring
Package boring provides access to BoringCrypto implementation functions.
|
Package boring provides access to BoringCrypto implementation functions. |
internal/boring/bcache
Package bcache implements a GC-friendly cache (see [Cache]) for BoringCrypto.
|
Package bcache implements a GC-friendly cache (see [Cache]) for BoringCrypto. |
internal/boring/sig
Package sig holds “code signatures” that can be called and will result in certain code sequences being linked into the final binary.
|
Package sig holds “code signatures” that can be called and will result in certain code sequences being linked into the final binary. |
internal/randutil
Package randutil contains internal randomness utilities for various crypto packages.
|
Package randutil contains internal randomness utilities for various crypto packages. |
internal/sm2ec
Package sm2ec implements the SM2 Prime elliptic curves.
|
Package sm2ec implements the SM2 Prime elliptic curves. |
sm9
Package sm9 implements ShangMi(SM) sm9 digital signature, encryption and key exchange algorithms.
|
Package sm9 implements ShangMi(SM) sm9 digital signature, encryption and key exchange algorithms. |
sm9/bn256
Package bn256 defines/implements ShangMi(SM) sm9's curves and pairing.
|
Package bn256 defines/implements ShangMi(SM) sm9's curves and pairing. |
smx509
Package smx509 implements a subset of the X.509 standard.
|
Package smx509 implements a subset of the X.509 standard. |
smx509/internal/macos
Package macOS provides cgo-less wrappers for Core Foundation and Security.framework, similarly to how package syscall provides access to libSystem.dylib.
|
Package macOS provides cgo-less wrappers for Core Foundation and Security.framework, similarly to how package syscall provides access to libSystem.dylib. |
Click to show internal directories.
Click to hide internal directories.