utils

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertHexFingerprint

func CertHexFingerprint(certificate *x509.Certificate) string

CertHexFingerprint returns the SHA1 checksum a certificate's raw bytes

func Confirm added in v0.4.0

func Confirm(label string) (bool, error)

func DeriveManagementKey added in v0.7.0

func DeriveManagementKey(pin string) *[24]byte

DeriveManagementKey returns the first 24 bytes of the SHA256 checksum of the given pin

func GetOrSetManagementKey added in v0.7.0

func GetOrSetManagementKey(yk *piv.YubiKey, pin string) (*[24]byte, error)

GetOrSetManagementKey returns the management key from the PIV metadata section. If it's not found, it derives the management key from the PIN, and will then:

  1. create a new random management key
  2. set it as the new management key
  3. store it in the PIV metadata section
  4. return the newly set management key

func GetPin

func GetPin() (string, error)

GetPin returns the Yubikey PIN entered in stdin

func GetSlot added in v0.3.0

func GetSlot(slot string) piv.Slot

GetSlot returns a piv.Slot slot. Defaults to 9e

func RandomManagementKey added in v0.7.0

func RandomManagementKey() (*[24]byte, error)

RandomManagementKey returns a *[24]byte slice filled with random byte values

Types

This section is empty.

Jump to

Keyboard shortcuts

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