Documentation
¶
Index ¶
- func AppendBundle(bundlePath string, certPaths ...string) error
- func BuildBundle(outPath string, certPaths ...string) error
- func CrossSign(signerCert *x509.Certificate, signerKey *ecdsa.PrivateKey, ...) error
- func GenerateJWTKeypair(outDir, baseName string) (pubPath, privPath string, err error)
- func InitCA(name, outDir string) (certPath, keyPath string, err error)
- func IssueCert(caCert *x509.Certificate, caKey *ecdsa.PrivateKey, ct CertType, cn string, ...) (certPath, keyPath string, err error)
- func LoadCA(certPath, keyPath string) (*x509.Certificate, *ecdsa.PrivateKey, error)
- func LoadCert(path string) (*x509.Certificate, error)
- func LoadEd25519PrivateKey(path string) (ed25519.PrivateKey, error)
- func LoadEd25519PublicKey(path string) (ed25519.PublicKey, error)
- func NewCertPoolFromPEM(pemData []byte) *x509.CertPool
- func VerifyOpts(roots *x509.CertPool) x509.VerifyOptions
- func WritePublicKeyPEM(path string, pubKey ed25519.PublicKey) error
- type CertType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendBundle ¶
AppendBundle appends PEM certificate files to an existing trust bundle file.
func BuildBundle ¶
BuildBundle concatenates multiple PEM certificate files into a single trust bundle.
func CrossSign ¶
func CrossSign(signerCert *x509.Certificate, signerKey *ecdsa.PrivateKey, targetCert *x509.Certificate, outPath string) error
CrossSign takes a target CA certificate and re-signs it using the signer CA, creating a cross-signed certificate that chains to the signer's trust root.
func GenerateJWTKeypair ¶
GenerateJWTKeypair creates an Ed25519 keypair for JWT signing.
func IssueCert ¶
func IssueCert(caCert *x509.Certificate, caKey *ecdsa.PrivateKey, ct CertType, cn string, sans []string, outDir string, validity time.Duration) (certPath, keyPath string, err error)
IssueCert generates a new ECDSA P-384 keypair and certificate signed by the given CA. When validity is zero or negative the default (90 days) is used.
func LoadCA ¶
func LoadCA(certPath, keyPath string) (*x509.Certificate, *ecdsa.PrivateKey, error)
LoadCA loads a CA certificate and private key from PEM files.
func LoadCert ¶
func LoadCert(path string) (*x509.Certificate, error)
LoadCert loads a certificate from a PEM file.
func LoadEd25519PrivateKey ¶
func LoadEd25519PrivateKey(path string) (ed25519.PrivateKey, error)
LoadEd25519PrivateKey loads an Ed25519 private key from a PEM file.
func LoadEd25519PublicKey ¶
LoadEd25519PublicKey loads an Ed25519 public key from a PEM file.
func NewCertPoolFromPEM ¶
NewCertPoolFromPEM creates a cert pool from PEM-encoded certificate data.
func VerifyOpts ¶
func VerifyOpts(roots *x509.CertPool) x509.VerifyOptions
VerifyOpts returns x509 verify options using the given root pool.