Versions in this module Expand all Collapse all v2 v2.0.331 Nov 28, 2026 v2.0.330 Nov 22, 2026 v2.0.328 Nov 20, 2026 Changes in this version + func VerifyOCSPResponder(res *ocsp.Response, issuer *x509.Certificate) error v2.0.324 Nov 17, 2026 Changes in this version + const BundleExpiringBit + const BundleNotUbiquitousBit + const KeyTypeECDSA + const KeyTypeMLDSA + const KeyTypeRSA + var ErrNoCertificates = errors.New("no certificates") + var IntermediateStash string + var RandReader randSource = rand.Reader + func BuildBundle(c *Chain) (bundle *Bundle, status *BundleStatus, err error) + func CreateOCSPRequest(crt, issuer *x509.Certificate, hash crypto.Hash) ([]byte, error) + func CreateOCSPResponse(issuer, responderCert *x509.Certificate, template ocsp.Response, ...) ([]byte, error) + func CreatePoolFromPEM(pemBytes []byte) (*x509.CertPool, error) + func Digest(hash crypto.Hash, data []byte) []byte + func EncodePrivateKeyToPEM(priv crypto.PrivateKey) (key []byte, err error) + func EncodePublicKeyToPEM(pubKey crypto.PublicKey) ([]byte, error) + func EncodeToPEM(out io.Writer, withComments bool, certs ...*x509.Certificate) error + func EncodeToPEMString(withComments bool, certs ...*x509.Certificate) (string, error) + func ExpiryTime(chain []*x509.Certificate) (notAfter time.Time) + func FindExtension(list []pkix.Extension, oid asn1.ObjectIdentifier) *pkix.Extension + func FindExtensionValue(list []pkix.Extension, oid asn1.ObjectIdentifier) []byte + func FindIssuer(crt *x509.Certificate, chain []*x509.Certificate, root *x509.Certificate) *x509.Certificate + func GetAuthorityKeyID(c *x509.Certificate) string + func GetIssuerID(c *x509.Certificate) string + func GetKeyDERFromPEM(in []byte, password []byte) ([]byte, error) + func GetSubjectID(c *x509.Certificate) string + func GetSubjectKeyID(c *x509.Certificate) string + func GetThumbprintStr(c *x509.Certificate) string + func HasOCSPNoCheck(crt *x509.Certificate) bool + func HashAlgoToStr(hash crypto.Hash) string + func HashToBase64URL(hash crypto.Hash, data []byte) string + func HashToHex(hash crypto.Hash, data []byte) string + func IsOCSPSigner(crt *x509.Certificate) bool + func IsPostQuantumCertificate(crt *x509.Certificate) bool + func IsPostQuantumKey(key any) bool + func IsPostQuantumSignatureAlgorithm(algo x509.SignatureAlgorithm) bool + func JoinPEM(p1, p2 []byte) []byte + func LoadAndVerifyBundleFromPEM(certFile, intCAFile, rootFile string, opt ...Option) (*Bundle, *BundleStatus, error) + func LoadChainFromPEM(certFile string) ([]*x509.Certificate, error) + func LoadFromPEM(certFile string) (*x509.Certificate, error) + func LoadPEMFiles(files ...string) ([]byte, error) + func NameToString(name *pkix.Name) string + func NewHash(algo string) (hash.Hash, error) + func ParseChainFromPEM(certificateChainPem []byte) ([]*x509.Certificate, error) + func ParseFromPEM(bytes []byte) (*x509.Certificate, error) + func ParseHexDigestWithPrefix(digest string) (hash.Hash, []byte, error) + func ParseOCSPResponse(der []byte, issuer *x509.Certificate) (*ocsp.Response, error) + func ParseOCSPResponseForCert(der []byte, cert, issuer *x509.Certificate) (*ocsp.Response, error) + func ParsePrivateKeyDER(keyDER []byte) (key crypto.Signer, err error) + func ParsePrivateKeyPEM(keyPEM []byte) (key crypto.Signer, err error) + func ParsePrivateKeyPEMWithPassword(keyPEM []byte, password []byte) (key crypto.Signer, err error) + func ParsePublicKeyFromPEM(key []byte) (crypto.PublicKey, error) + func ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error) + func Random(byteLength int) []byte + func RandomString(length int) string + func SHA1(data []byte) []byte + func SHA1Base64(data []byte) string + func SHA1Hex(data []byte) string + func SHA256(data []byte) []byte + func SHA256Base64(data []byte) string + func SHA256Hex(data []byte) string + func StrToHashAlgo(algo string) crypto.Hash + func VerifyBundleFromPEM(certPEM, intCAPEM, rootPEM []byte, opt ...Option) (bundle *Bundle, status *BundleStatus, err error) + type Bundle struct + CACertsPEM string + Cert *x509.Certificate + CertPEM string + Chain []*x509.Certificate + Expires time.Time + Hostnames []string + Issuer *pkix.Name + IssuerCert *x509.Certificate + IssuerID string + RootCert *x509.Certificate + RootCertPEM string + Subject *pkix.Name + SubjectID string + func SortBundlesByExpiration(bundles []*Bundle) []*Bundle + func (b *Bundle) ExpiresInHours() time.Duration + type BundleFlavor string + const Force + const Optimal + type BundleStatus struct + Code int + ExpiringSKIs []string + Messages []string + Untrusted []string + func (b *BundleStatus) IsExpiring() bool + func (b *BundleStatus) IsUntrusted() bool + type Bundler struct + func LoadBundler(rootBundleFile, intBundleFile string, opt ...Option) (*Bundler, error) + func NewBundler(roots, intermediates []*x509.Certificate, opt ...Option) (*Bundler, error) + func NewBundlerFromPEM(rootBundlePEM, intBundlePEM []byte, opt ...Option) (*Bundler, error) + func (b *Bundler) Bundle(certs []*x509.Certificate, key crypto.Signer) (*Chain, error) + func (b *Bundler) BundleContext(ctx context.Context, certs []*x509.Certificate, key crypto.Signer) (*Chain, error) + func (b *Bundler) ChainFromFile(bundleFile, keyFile string, password string) (*Chain, error) + func (b *Bundler) ChainFromPEM(certsRaw, keyPEM []byte, password string) (*Chain, error) + func (b *Bundler) ChainFromPEMContext(ctx context.Context, certsRaw, keyPEM []byte, password string) (*Chain, error) + func (b *Bundler) IntermediatePool() *x509.CertPool + func (b *Bundler) IsKnownIssuer(cert *x509.Certificate) bool + func (b *Bundler) RootPool() *x509.CertPool + func (b *Bundler) VerifyOptions() x509.VerifyOptions + type Chain struct + Cert *x509.Certificate + Chain []*x509.Certificate + Expires time.Time + Hostnames []string + Issuer *pkix.Name + Key any + LeafExpires time.Time + Root *x509.Certificate + Status *BundleStatus + Subject *pkix.Name + type KeyInfo struct + Hash crypto.Hash + IsPrivate bool + Key any + KeySize int + Type string + func NewKeyInfo(k any) (*KeyInfo, error) + type Option func(*options) + func WithAIA(enable bool) Option + func WithBundleFlavor(flavor BundleFlavor) Option + func WithHTTPClient(client *http.Client) Option + func WithKeyUsages(usages ...x509.ExtKeyUsage) Option + func WithSystemRoots(enable bool) Option Other modules containing this package github.com/effective-security/xpki