Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions v2/piv/piv.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down