Versions in this module Expand all Collapse all v0 v0.2.1 May 19, 2024 Changes in this version type Key + func (k *Key) EncodePublic() ([]byte, error) + func (k *Key) EncodePublicP() []byte + func (k *Key) WritePublic(out io.Writer) error + func (k *Key) WritePublicFile(name string, mode os.FileMode) error + func (k *Key) WritePublicFileP(name string, mode os.FileMode) + func (k *Key) WritePublicP(out io.Writer) v0.2.0 Apr 30, 2023 Changes in this version type Chain + func (ch Chain) CertPool() *x509.CertPool + func (ch Chain) SelfSigned() bool + func (ch Chain) TLS() *tls.Certificate + func (ch Chain) X509() []*x509.Certificate v0.1.2 Apr 29, 2023 Changes in this version type Chain + func DecodeChain(data []byte) (Chain, error) + func DecodeChainP(data []byte) Chain + func ReadChainFile(name string) (Chain, error) + func ReadChainFileP(name string) Chain type Key + func DecodeKey(data []byte) (*Key, []byte, error) + func DecodeKeyP(data []byte) (*Key, []byte) + func ReadKeyFile(name string) (*Key, error) + func ReadKeyFileP(name string) *Key type Pair + func DecodePair(data []byte) (*Pair, []byte, error) + func DecodePairP(data []byte) (*Pair, []byte) + func ReadPairFile(name string) (*Pair, error) + func ReadPairFileP(name string) *Pair v0.1.1 Apr 26, 2023 Changes in this version + func RandBytes(len int) ([]byte, error) + func RandBytesP(len int) []byte + func RandHexBytes(len int) ([]byte, error) + func RandHexBytesP(len int) []byte + func RandInt(bitMax uint) (*big.Int, error) + func RandIntP(bitMax uint) *big.Int v0.1.0 Apr 25, 2023 Changes in this version + func ParseDurationP(value string) time.Duration + func ParseTimeP(layout, value string) time.Time + type Chain []*Pair + func GenerateChain(tmps []*Template) (Chain, error) + func GenerateChainP(tmps []*Template) Chain + func GenerateClientChain(tmps []*Template) (Chain, error) + func GenerateClientChainP(tmps []*Template) Chain + func GenerateServerChain(tmps []*Template) (Chain, error) + func GenerateServerChainP(tmps []*Template) Chain + func (ch Chain) Encode(withKey bool) ([]byte, error) + func (ch Chain) EncodeP(withKey bool) []byte + func (ch Chain) Encrypt(alg x509.PEMCipher, pass []byte) ([]byte, error) + func (ch Chain) EncryptP(alg x509.PEMCipher, pass []byte) []byte + func (ch Chain) Head(num int) Chain + func (ch Chain) IssueChain(tmps []*Template) (Chain, error) + func (ch Chain) IssueChainP(tmps []*Template) Chain + func (ch Chain) IssueClientChain(tmps []*Template) (Chain, error) + func (ch Chain) IssueClientChainP(tmps []*Template) Chain + func (ch Chain) IssueServerChain(tmps []*Template) (Chain, error) + func (ch Chain) IssueServerChainP(tmps []*Template) Chain + func (ch Chain) String() string + func (ch Chain) Tail(num int) Chain + func (ch Chain) Write(out io.Writer, withKey bool) error + func (ch Chain) WriteEncrypted(out io.Writer, alg x509.PEMCipher, pass []byte) error + func (ch Chain) WriteEncryptedFile(name string, mode os.FileMode, alg x509.PEMCipher, pass []byte) error + func (ch Chain) WriteEncryptedFileP(name string, mode os.FileMode, alg x509.PEMCipher, pass []byte) + func (ch Chain) WriteEncryptedP(out io.Writer, alg x509.PEMCipher, pass []byte) + func (ch Chain) WriteFile(name string, mode os.FileMode, withKey bool) error + func (ch Chain) WriteFileP(name string, mode os.FileMode, withKey bool) + func (ch Chain) WriteP(out io.Writer, withKey bool) + type Key struct + Format KeyFormat + Key any + func GenerateKey(kf KeyFormat) (*Key, error) + func GenerateKeyP(kf KeyFormat) *Key + func (k *Key) Encode() ([]byte, error) + func (k *Key) EncodeP() []byte + func (k *Key) Encrypt(alg x509.PEMCipher, pass []byte) ([]byte, error) + func (k *Key) EncryptP(alg x509.PEMCipher, pass []byte) []byte + func (k *Key) Equal(x crypto.PrivateKey) bool + func (k *Key) Public() crypto.PublicKey + func (k *Key) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) (signature []byte, err error) + func (k *Key) Write(out io.Writer) error + func (k *Key) WriteEncrypted(out io.Writer, alg x509.PEMCipher, pass []byte) error + func (k *Key) WriteEncryptedFile(name string, mode os.FileMode, alg x509.PEMCipher, pass []byte) error + func (k *Key) WriteEncryptedFileP(name string, mode os.FileMode, alg x509.PEMCipher, pass []byte) + func (k *Key) WriteEncryptedP(out io.Writer, alg x509.PEMCipher, pass []byte) + func (k *Key) WriteFile(name string, mode os.FileMode) error + func (k *Key) WriteFileP(name string, mode os.FileMode) + func (k *Key) WriteP(out io.Writer) + type KeyFormat int + const ECDSA + const ECDSA_P224 + const ECDSA_P224_PKCS8 + const ECDSA_P224_SEC1 + const ECDSA_P256 + const ECDSA_P256_PKCS8 + const ECDSA_P256_SEC1 + const ECDSA_P384 + const ECDSA_P384_PKCS8 + const ECDSA_P384_SEC1 + const ECDSA_P521 + const ECDSA_P521_PKCS8 + const ECDSA_P521_SEC1 + const ED25519 + const ED25519_PKCS8 + const KeyEncodingMask + const KeyTypeMask + const PKCS1 + const PKCS8 + const RSA + const RSA_1024 + const RSA_1024_PKCS1 + const RSA_1024_PKCS8 + const RSA_2048 + const RSA_2048_PKCS1 + const RSA_2048_PKCS8 + const RSA_3072 + const RSA_3072_PKCS1 + const RSA_3072_PKCS8 + const RSA_4096 + const RSA_4096_PKCS1 + const RSA_4096_PKCS8 + const SEC1 + func IdentifyKey(key any) (KeyFormat, error) + func IdentifyKeyP(key any) KeyFormat + func (kf KeyFormat) String() string + type Pair struct + Cert *x509.Certificate + Key *Key + func (p *Pair) CertPool() *x509.CertPool + func (p *Pair) Encode(withKey bool) ([]byte, error) + func (p *Pair) EncodeP(withKey bool) []byte + func (p *Pair) Encrypt(alg x509.PEMCipher, pass []byte) ([]byte, error) + func (p *Pair) EncryptP(alg x509.PEMCipher, pass []byte) []byte + func (p *Pair) SelfSigned() bool + func (p *Pair) String() string + func (p *Pair) TLS() *tls.Certificate + func (p *Pair) Write(out io.Writer, withKey bool) error + func (p *Pair) WriteEncrypted(out io.Writer, alg x509.PEMCipher, pass []byte) error + func (p *Pair) WriteEncryptedFile(name string, mode os.FileMode, alg x509.PEMCipher, pass []byte) error + func (p *Pair) WriteEncryptedFileP(name string, mode os.FileMode, alg x509.PEMCipher, pass []byte) + func (p *Pair) WriteEncryptedP(out io.Writer, alg x509.PEMCipher, pass []byte) + func (p *Pair) WriteFile(name string, mode os.FileMode, withKey bool) error + func (p *Pair) WriteFileP(name string, mode os.FileMode, withKey bool) + func (p *Pair) WriteP(out io.Writer, withKey bool) + type Template struct + Key *Key + KeyFormat KeyFormat