Documentation ¶
Index ¶
- Constants
- Variables
- func CertificatesWithSamePublicKey(der1, der2 []byte) error
- func ExpiresAt(identityBytes []byte) time.Time
- func GetRandomBytes(len int) ([]byte, error)
- func GetRandomNonce() ([]byte, error)
- func LogNonPubKeyMismatchErr(log func(template string, args ...interface{}), err error, ...)
- func TrackExpiration(tls bool, serverCert []byte, clientCertChain [][]byte, sIDBytes []byte, ...)
- type MessageFunc
- type Scheduler
Constants ¶
View Source
const (
// NonceSize is the default NonceSize
NonceSize = 24
)
Variables ¶
View Source
var ( // ErrPubKeyMismatch is used by CertificatesWithSamePublicKey to indicate the two public keys mismatch ErrPubKeyMismatch = errors.New("public keys do not match") )
Functions ¶
func CertificatesWithSamePublicKey ¶ added in v1.5.6
CertificatesWithSamePublicKey returns nil if both byte slices are valid DER encoding of certificates with the same public key.
func ExpiresAt ¶ added in v1.1.0
ExpiresAt returns when the given identity expires, or a zero time.Time in case we cannot determine that
func GetRandomBytes ¶
GetRandomBytes returns len random looking bytes
func GetRandomNonce ¶
GetRandomNonce returns a random byte array of length NonceSize
func LogNonPubKeyMismatchErr ¶ added in v1.5.6
func LogNonPubKeyMismatchErr(log func(template string, args ...interface{}), err error, cert1DER, cert2DER []byte)
LogNonPubKeyMismatchErr logs an error which is not an ErrPubKeyMismatch error
func TrackExpiration ¶ added in v1.4.4
func TrackExpiration(tls bool, serverCert []byte, clientCertChain [][]byte, sIDBytes []byte, info MessageFunc, warn MessageFunc, now time.Time, s Scheduler)
TrackExpiration warns a week before one of the certificates expires
Types ¶
type MessageFunc ¶ added in v1.5.6
type MessageFunc func(format string, args ...interface{})
MessageFunc notifies a message happened with the given format, and can be replaced with Warnf or Infof of a logger.
Click to show internal directories.
Click to hide internal directories.