utils

package
v0.0.0-...-208ba13 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MulanPSL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsExpired

func IsExpired(expiresAt time.Time, now time.Time, expirationBuffer time.Duration) bool

IsExpired determines if a given expiresAt time has expired when considering the current time and an additional expiration buffer.

The expiration buffer is a duration subtracted from the expiresAt time to determine the effective expiration time. This is useful for avoiding expiration race conditions due to clock skew.

Returns true if the expiresAt time has expired, false otherwise.

func PrivateKeyFromPemFile

func PrivateKeyFromPemFile(path string) (*rsa.PrivateKey, error)

func PublicKeyFromPemFile

func PublicKeyFromPemFile(path string) (*rsa.PublicKey, error)

func PublicKeyFromPemString

func PublicKeyFromPemString(pubstr string) (*rsa.PublicKey, error)

func PublicKeyLineFromPemFile

func PublicKeyLineFromPemFile(path string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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