cert

package
v0.31.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package cert provides helpers for reading PEM-encoded X.509 certificates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CN added in v0.31.3

func CN(data []byte) (string, error)

CN returns the Subject Common Name of a PEM-encoded X.509 certificate held in memory. Same check as ReadCN, for callers holding bytes that have not been written to disk yet.

func ReadCN

func ReadCN(path string) (string, error)

ReadCN reads a PEM-encoded X.509 certificate at path and returns its Subject Common Name. Returns an error if the file cannot be read, contains no PEM block, or cannot be parsed as a certificate.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL