diff --git a/v2/piv/piv.go b/v2/piv/piv.go index a4d884e..7c166f2 100644 --- a/v2/piv/piv.go +++ b/v2/piv/piv.go @@ -260,6 +260,14 @@ func ykLogin(tx *scTx, pin string) error { return nil } +// CheckPIN checks if PIN verification is required for this transaction or not. +// +// Generally, it is not necessary to call this method directly as PIN will only be +// prompted as needed by default. +func (yk *YubiKey) CheckPIN() bool { + return ykLoginNeeded(yk.tx) +} + func ykLoginNeeded(tx *scTx) bool { cmd := apdu{instruction: insVerify, param2: 0x80} _, err := tx.Transmit(cmd)