filter

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrOpen = errors.New("open card for detailed filtering")

ErrOpen is a sentinel error returned by a Filter indicating that the filter requires a connection to the card for checking its predicate. This is usually the case if the predicate needs to exchange APDUs with the card rather than simply checking the readers name

Functions

func Any

func Any(_ iso.PCSCCard) (bool, error)

Any matches any card

func IsFeitian added in v0.7.0

func IsFeitian(card iso.PCSCCard) (bool, error)

IsFeitian checks if the smart card is a FEITIAN key based on the name of the smart card reader.

func IsNitrokey

func IsNitrokey(card iso.PCSCCard) (bool, error)

IsNikrokey checks if the smart card is a Nitrokey based on the name of the smart card reader.

func IsNitrokey3

func IsNitrokey3(card iso.PCSCCard) (bool, error)

IsNikrokey3 checks if the smart card is a Nitrokey 3 based on the name of the smart card reader.

func IsYubiKey

func IsYubiKey(card iso.PCSCCard) (bool, error)

IsYubiKey checks if the smart card is a YubiKey based on the name of the smart card reader.

func None added in v0.2.0

func None(_ iso.PCSCCard) (bool, error)

None matches no card

Types

type Filter

type Filter func(card iso.PCSCCard) (bool, error)

Filter is a predicate which evaluates whether a given reader/card matches a given condition.

func And

func And(fs ...Filter) Filter

And matches if all of the provided filters are matching.

func HasApplet

func HasApplet(aid []byte) Filter

HasApplet matches card which can select an applet with the given application identifier (AID).

func HasName

func HasName(nameExpected string) Filter

HasName compares the name of the smart card reader with the provided name.

func HasNameRegex

func HasNameRegex(regex string) Filter

HasName matches the name of the smart card reader against the provided regular expression.

func Not

func Not(f Filter) Filter

Not matches if the provided filters does not match.

func Or

func Or(fs ...Filter) Filter

Or matches if any of the provided filters are matching.

Jump to

Keyboard shortcuts

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