cryptotokenkit

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Rendered for darwin/amd64

Overview

Package cryptotokenkit provides purego-based Go bindings for the macOS CryptoTokenKit framework.

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TKBERTLVRecordDataForTag

func TKBERTLVRecordDataForTag(tag uint64) *foundation.NSData

Encodes tag using BER-TLV tag encoding rules. @param tag Tag value to encode @return Binary block containing encoded tag value.

func TKErrorDomain

func TKErrorDomain() uintptr

func TKTLVRecordSequenceOfRecordsFromData

func TKTLVRecordSequenceOfRecordsFromData(data *foundation.NSData) *foundation.NSArray[*TKTLVRecord]

Parses sequence of TLV records from data block. The amount of records is determined by the length of input data block. @param data Data block containing zero or more serialized forms of TLV record. @return An array of TLV record instances parsed from input data block or nil if data do not form valid TLV record sequence.

func TKTokenDriverConfigurationDriverConfigurations

func TKTokenDriverConfigurationDriverConfigurations() *foundation.NSDictionary[*foundation.NSString, *TKTokenDriverConfiguration]

Contains dictionary of token class configurations keyed by TKTokenDriverClassID of token driver. Hosting application of token extension will contain the list of configurations for hosted token extensions. All other callers will get an empty array. This means that only token's hosting application can actually modify token's configuration. Typically, hosting application will contain only one token extension, therefore this dictionary will have one element.

Types

type Acl_entry_id_t

type Acl_entry_id_t int64
const (
	ACL_FIRST_ENTRY Acl_entry_id_t = 0
	ACL_NEXT_ENTRY  Acl_entry_id_t = -1
	ACL_LAST_ENTRY  Acl_entry_id_t = -2
)

func (Acl_entry_id_t) String

func (e Acl_entry_id_t) String() string

type Acl_flag_t

type Acl_flag_t int64
const (
	ACL_FLAG_DEFER_INHERIT      Acl_flag_t = 1
	ACL_FLAG_NO_INHERIT         Acl_flag_t = 131072
	ACL_ENTRY_INHERITED         Acl_flag_t = 16
	ACL_ENTRY_FILE_INHERIT      Acl_flag_t = 32
	ACL_ENTRY_DIRECTORY_INHERIT Acl_flag_t = 64
	ACL_ENTRY_LIMIT_INHERIT     Acl_flag_t = 128
	ACL_ENTRY_ONLY_INHERIT      Acl_flag_t = 256
)

func (Acl_flag_t) String

func (e Acl_flag_t) String() string

type Acl_perm_t

type Acl_perm_t int64
const (
	ACL_READ_DATA           Acl_perm_t = 2
	ACL_LIST_DIRECTORY      Acl_perm_t = 2
	ACL_WRITE_DATA          Acl_perm_t = 4
	ACL_ADD_FILE            Acl_perm_t = 4
	ACL_EXECUTE             Acl_perm_t = 8
	ACL_SEARCH              Acl_perm_t = 8
	ACL_DELETE              Acl_perm_t = 16
	ACL_APPEND_DATA         Acl_perm_t = 32
	ACL_ADD_SUBDIRECTORY    Acl_perm_t = 32
	ACL_DELETE_CHILD        Acl_perm_t = 64
	ACL_READ_ATTRIBUTES     Acl_perm_t = 128
	ACL_WRITE_ATTRIBUTES    Acl_perm_t = 256
	ACL_READ_EXTATTRIBUTES  Acl_perm_t = 512
	ACL_WRITE_EXTATTRIBUTES Acl_perm_t = 1024
	ACL_READ_SECURITY       Acl_perm_t = 2048
	ACL_WRITE_SECURITY      Acl_perm_t = 4096
	ACL_CHANGE_OWNER        Acl_perm_t = 8192
	ACL_SYNCHRONIZE         Acl_perm_t = 1048576
)

func (Acl_perm_t) String

func (e Acl_perm_t) String() string

type Acl_tag_t

type Acl_tag_t int64
const (
	ACL_UNDEFINED_TAG  Acl_tag_t = 0
	ACL_EXTENDED_ALLOW Acl_tag_t = 1
	ACL_EXTENDED_DENY  Acl_tag_t = 2
)

func (Acl_tag_t) String

func (e Acl_tag_t) String() string

type Acl_type_t

type Acl_type_t int64
const (
	ACL_TYPE_EXTENDED Acl_type_t = 256
	ACL_TYPE_ACCESS   Acl_type_t = 0
	ACL_TYPE_DEFAULT  Acl_type_t = 1
	ACL_TYPE_AFS      Acl_type_t = 2
	ACL_TYPE_CODA     Acl_type_t = 3
	ACL_TYPE_NTFS     Acl_type_t = 4
	ACL_TYPE_NWFS     Acl_type_t = 5
)

func (Acl_type_t) String

func (e Acl_type_t) String() string

type Clockid_t

type Clockid_t int64

func (Clockid_t) String

func (e Clockid_t) String() string

type Dispatch_autorelease_frequency_t

type Dispatch_autorelease_frequency_t uint64
const (
	DISPATCH_AUTORELEASE_FREQUENCY_INHERIT   Dispatch_autorelease_frequency_t = 0
	DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM Dispatch_autorelease_frequency_t = 1
	DISPATCH_AUTORELEASE_FREQUENCY_NEVER     Dispatch_autorelease_frequency_t = 2
)

func (Dispatch_autorelease_frequency_t) String

type Dispatch_block_flags_t

type Dispatch_block_flags_t uint64
const (
	DISPATCH_BLOCK_BARRIER           Dispatch_block_flags_t = 1
	DISPATCH_BLOCK_DETACHED          Dispatch_block_flags_t = 2
	DISPATCH_BLOCK_ASSIGN_CURRENT    Dispatch_block_flags_t = 4
	DISPATCH_BLOCK_NO_QOS_CLASS      Dispatch_block_flags_t = 8
	DISPATCH_BLOCK_INHERIT_QOS_CLASS Dispatch_block_flags_t = 16
	DISPATCH_BLOCK_ENFORCE_QOS_CLASS Dispatch_block_flags_t = 32
)

func (Dispatch_block_flags_t) String

func (e Dispatch_block_flags_t) String() string

type Filesec_property_t

type Filesec_property_t int64
const (
	FILESEC_OWNER         Filesec_property_t = 1
	FILESEC_GROUP         Filesec_property_t = 2
	FILESEC_UUID          Filesec_property_t = 3
	FILESEC_MODE          Filesec_property_t = 4
	FILESEC_ACL           Filesec_property_t = 5
	FILESEC_GRPUUID       Filesec_property_t = 6
	FILESEC_ACL_RAW       Filesec_property_t = 100
	FILESEC_ACL_ALLOCSIZE Filesec_property_t = 101
)

func (Filesec_property_t) String

func (e Filesec_property_t) String() string

type Idtype_t

type Idtype_t int64
const (
	P_ALL  Idtype_t = 0
	P_PID  Idtype_t = 1
	P_PGID Idtype_t = 2
)

func (Idtype_t) String

func (e Idtype_t) String() string

type Ipc_info_object_type_t

type Ipc_info_object_type_t int64
const (
	IPC_OTYPE_NONE                 Ipc_info_object_type_t = 0
	IPC_OTYPE_THREAD_CONTROL       Ipc_info_object_type_t = 1
	IPC_OTYPE_TASK_CONTROL         Ipc_info_object_type_t = 2
	IPC_OTYPE_HOST                 Ipc_info_object_type_t = 3
	IPC_OTYPE_HOST_PRIV            Ipc_info_object_type_t = 4
	IPC_OTYPE_PROCESSOR            Ipc_info_object_type_t = 5
	IPC_OTYPE_PROCESSOR_SET        Ipc_info_object_type_t = 6
	IPC_OTYPE_PROCESSOR_SET_NAME   Ipc_info_object_type_t = 7
	IPC_OTYPE_TIMER                Ipc_info_object_type_t = 8
	IPC_OTYPE_PORT_SUBST_ONCE      Ipc_info_object_type_t = 9
	IPC_OTYPE_MIG                  Ipc_info_object_type_t = 10
	IPC_OTYPE_MEMORY_OBJECT        Ipc_info_object_type_t = 11
	IPC_OTYPE_XMM_PAGER            Ipc_info_object_type_t = 12
	IPC_OTYPE_XMM_KERNEL           Ipc_info_object_type_t = 13
	IPC_OTYPE_XMM_REPLY            Ipc_info_object_type_t = 14
	IPC_OTYPE_UND_REPLY            Ipc_info_object_type_t = 15
	IPC_OTYPE_HOST_NOTIFY          Ipc_info_object_type_t = 16
	IPC_OTYPE_HOST_SECURITY        Ipc_info_object_type_t = 17
	IPC_OTYPE_LEDGER               Ipc_info_object_type_t = 18
	IPC_OTYPE_MAIN_DEVICE          Ipc_info_object_type_t = 19
	IPC_OTYPE_TASK_NAME            Ipc_info_object_type_t = 20
	IPC_OTYPE_SUBSYSTEM            Ipc_info_object_type_t = 21
	IPC_OTYPE_IO_DONE_QUEUE        Ipc_info_object_type_t = 22
	IPC_OTYPE_SEMAPHORE            Ipc_info_object_type_t = 23
	IPC_OTYPE_LOCK_SET             Ipc_info_object_type_t = 24
	IPC_OTYPE_CLOCK                Ipc_info_object_type_t = 25
	IPC_OTYPE_CLOCK_CTRL           Ipc_info_object_type_t = 26
	IPC_OTYPE_IOKIT_IDENT          Ipc_info_object_type_t = 27
	IPC_OTYPE_NAMED_ENTRY          Ipc_info_object_type_t = 28
	IPC_OTYPE_IOKIT_CONNECT        Ipc_info_object_type_t = 29
	IPC_OTYPE_IOKIT_OBJECT         Ipc_info_object_type_t = 30
	IPC_OTYPE_UPL                  Ipc_info_object_type_t = 31
	IPC_OTYPE_MEM_OBJ_CONTROL      Ipc_info_object_type_t = 32
	IPC_OTYPE_AU_SESSIONPORT       Ipc_info_object_type_t = 33
	IPC_OTYPE_FILEPORT             Ipc_info_object_type_t = 34
	IPC_OTYPE_LABELH               Ipc_info_object_type_t = 35
	IPC_OTYPE_TASK_RESUME          Ipc_info_object_type_t = 36
	IPC_OTYPE_VOUCHER              Ipc_info_object_type_t = 37
	IPC_OTYPE_VOUCHER_ATTR_CONTROL Ipc_info_object_type_t = 38
	IPC_OTYPE_WORK_INTERVAL        Ipc_info_object_type_t = 39
	IPC_OTYPE_UX_HANDLER           Ipc_info_object_type_t = 40
	IPC_OTYPE_UEXT_OBJECT          Ipc_info_object_type_t = 41
	IPC_OTYPE_ARCADE_REG           Ipc_info_object_type_t = 42
	IPC_OTYPE_EVENTLINK            Ipc_info_object_type_t = 43
	IPC_OTYPE_TASK_INSPECT         Ipc_info_object_type_t = 44
	IPC_OTYPE_TASK_READ            Ipc_info_object_type_t = 45
	IPC_OTYPE_THREAD_INSPECT       Ipc_info_object_type_t = 46
	IPC_OTYPE_THREAD_READ          Ipc_info_object_type_t = 47
	IPC_OTYPE_SUID_CRED            Ipc_info_object_type_t = 48
	IPC_OTYPE_HYPERVISOR           Ipc_info_object_type_t = 49
	IPC_OTYPE_TASK_ID_TOKEN        Ipc_info_object_type_t = 50
	IPC_OTYPE_TASK_FATAL           Ipc_info_object_type_t = 51
	IPC_OTYPE_KCDATA               Ipc_info_object_type_t = 52
	IPC_OTYPE_EXCLAVES_RESOURCE    Ipc_info_object_type_t = 53
	IPC_OTYPE_THREAD_RESUME        Ipc_info_object_type_t = 54
	IPC_OTYPE_UNKNOWN              Ipc_info_object_type_t = 4294967295
)

func (Ipc_info_object_type_t) String

func (e Ipc_info_object_type_t) String() string

type Launch_data_type_t

type Launch_data_type_t int64
const (
	LAUNCH_DATA_DICTIONARY Launch_data_type_t = 1
	LAUNCH_DATA_ARRAY      Launch_data_type_t = 2
	LAUNCH_DATA_FD         Launch_data_type_t = 3
	LAUNCH_DATA_INTEGER    Launch_data_type_t = 4
	LAUNCH_DATA_REAL       Launch_data_type_t = 5
	LAUNCH_DATA_BOOL       Launch_data_type_t = 6
	LAUNCH_DATA_STRING     Launch_data_type_t = 7
	LAUNCH_DATA_OPAQUE     Launch_data_type_t = 8
	LAUNCH_DATA_ERRNO      Launch_data_type_t = 9
	LAUNCH_DATA_MACHPORT   Launch_data_type_t = 10
)

func (Launch_data_type_t) String

func (e Launch_data_type_t) String() string

type MDLabelDomain

type MDLabelDomain int64

@typedef MDLabelDomain @abstract These constants are used to specify a domain to MDLabelCreate().

const (
	KMDLabelUserDomain  MDLabelDomain = 0
	KMDLabelLocalDomain MDLabelDomain = 1
)

func (MDLabelDomain) String

func (e MDLabelDomain) String() string

type MDQueryOptionFlags

type MDQueryOptionFlags int64
const (
	KMDQuerySynchronous        MDQueryOptionFlags = 1
	KMDQueryWantsUpdates       MDQueryOptionFlags = 4
	KMDQueryAllowFSTranslation MDQueryOptionFlags = 8
)

func (MDQueryOptionFlags) String

func (e MDQueryOptionFlags) String() string

type MDQuerySortOptionFlags

type MDQuerySortOptionFlags int64

@enum MDQuerySortOptionFlags @constant kMDQueryReverseSortOrderFlag Sort the attribute in reverse order.

const (
	KMDQueryReverseSortOrderFlag MDQuerySortOptionFlags = 1
)

func (MDQuerySortOptionFlags) String

func (e MDQuerySortOptionFlags) String() string

type Mach_vm_range_flags_t

type Mach_vm_range_flags_t int64
const (
	MACH_VM_RANGE_NONE Mach_vm_range_flags_t = 0
)

func (Mach_vm_range_flags_t) String

func (e Mach_vm_range_flags_t) String() string

type Mach_vm_range_flavor_t

type Mach_vm_range_flavor_t int64
const (
	MACH_VM_RANGE_FLAVOR_INVALID Mach_vm_range_flavor_t = 0
	MACH_VM_RANGE_FLAVOR_V1      Mach_vm_range_flavor_t = 1
)

func (Mach_vm_range_flavor_t) String

func (e Mach_vm_range_flavor_t) String() string

type Mach_vm_range_tag_t

type Mach_vm_range_tag_t int64
const (
	MACH_VM_RANGE_DEFAULT Mach_vm_range_tag_t = 0
	MACH_VM_RANGE_DATA    Mach_vm_range_tag_t = 1
	MACH_VM_RANGE_FIXED   Mach_vm_range_tag_t = 2
)

func (Mach_vm_range_tag_t) String

func (e Mach_vm_range_tag_t) String() string

type Mpo_flags_t

type Mpo_flags_t int64
const (
	MPO_PORT                            Mpo_flags_t = 0
	MPO_SERVICE_PORT                    Mpo_flags_t = 1024
	MPO_CONNECTION_PORT                 Mpo_flags_t = 2048
	MPO_REPLY_PORT                      Mpo_flags_t = 4096
	MPO_WEAK_REPLY_PORT                 Mpo_flags_t = 16384
	MPO_NOTIFICATION_PORT               Mpo_flags_t = 17408
	MPO_EXCEPTION_PORT                  Mpo_flags_t = 32768
	MPO_CONNECTION_PORT_WITH_PORT_ARRAY Mpo_flags_t = 65536
)

func (Mpo_flags_t) String

func (e Mpo_flags_t) String() string

type Os_clockid_t

type Os_clockid_t int64
const (
	OS_CLOCK_MACH_ABSOLUTE_TIME Os_clockid_t = 32
)

func (Os_clockid_t) String

func (e Os_clockid_t) String() string

type Ptrauth_key

type Ptrauth_key int64
const (
	Ptrauth_key_none                     Ptrauth_key = -1
	Ptrauth_key_asia                     Ptrauth_key = 0
	Ptrauth_key_asib                     Ptrauth_key = 1
	Ptrauth_key_asda                     Ptrauth_key = 2
	Ptrauth_key_asdb                     Ptrauth_key = 3
	Ptrauth_key_process_independent_code Ptrauth_key = 0
	Ptrauth_key_process_dependent_code   Ptrauth_key = 1
	Ptrauth_key_process_independent_data Ptrauth_key = 2
	Ptrauth_key_process_dependent_data   Ptrauth_key = 3
	Ptrauth_key_return_address           Ptrauth_key = 1
	Ptrauth_key_frame_pointer            Ptrauth_key = 3
	Ptrauth_key_function_pointer         Ptrauth_key = 0
	Ptrauth_key_block_function           Ptrauth_key = 0
	Ptrauth_key_cxx_vtable_pointer       Ptrauth_key = 2
	Ptrauth_key_method_list_pointer      Ptrauth_key = 2
	Ptrauth_key_objc_isa_pointer         Ptrauth_key = 2
	Ptrauth_key_objc_super_pointer       Ptrauth_key = 2
	Ptrauth_key_objc_sel_pointer         Ptrauth_key = 3
	Ptrauth_key_objc_class_ro_pointer    Ptrauth_key = 2
	Ptrauth_key_block_descriptor_pointer Ptrauth_key = 2
	Ptrauth_key_init_fini_pointer        Ptrauth_key = 0
)

func (Ptrauth_key) String

func (e Ptrauth_key) String() string

type Qos_class_t

type Qos_class_t uint32
const (
	QOS_CLASS_USER_INTERACTIVE Qos_class_t = 33
	QOS_CLASS_USER_INITIATED   Qos_class_t = 25
	QOS_CLASS_DEFAULT          Qos_class_t = 21
	QOS_CLASS_UTILITY          Qos_class_t = 17
	QOS_CLASS_BACKGROUND       Qos_class_t = 9
	QOS_CLASS_UNSPECIFIED      Qos_class_t = 0
)

func (Qos_class_t) String

func (e Qos_class_t) String() string

type TKBERTLVRecord

type TKBERTLVRecord struct {
	TKTLVRecord
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tkbertlvrecord

func TKBERTLVRecordFromID

func TKBERTLVRecordFromID(id objc.ID) *TKBERTLVRecord

func (*TKBERTLVRecord) InitWithTagRecords

func (o *TKBERTLVRecord) InitWithTagRecords(tag uint64, records *foundation.NSArray[*TKTLVRecord]) *TKBERTLVRecord

Creates TKBERTLVRecord with specified tag and array of children TKTLVRecord instances as subrecords. @param tag Tag value for the new record. @param records Array of TKTLVRecord instances serving as subrecords of this record. @return Newly created TLV record.

func (*TKBERTLVRecord) InitWithTagValue

func (o *TKBERTLVRecord) InitWithTagValue(tag uint64, value *foundation.NSData) *TKBERTLVRecord

Creates TLV record with specified tag and value. @param tag Tag value for the new record. @param value Value for the new record. @return Newly created TLV record.

type TKCompactTLVRecord

type TKCompactTLVRecord struct {
	TKTLVRecord
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tkcompacttlvrecord

func TKCompactTLVRecordFromID

func TKCompactTLVRecordFromID(id objc.ID) *TKCompactTLVRecord

func (*TKCompactTLVRecord) InitWithTagValue

func (o *TKCompactTLVRecord) InitWithTagValue(tag uint8, value *foundation.NSData) *TKCompactTLVRecord

Creates TLV record with specified tag and value. @param tag Tag value for the new record. @param value Value for the new record. @return Newly created TLV record.

type TKErrorCode

type TKErrorCode int64
const (
	TKErrorCodeNotImplemented       TKErrorCode = -1
	TKErrorCodeCommunicationError   TKErrorCode = -2
	TKErrorCodeCorruptedData        TKErrorCode = -3
	TKErrorCodeCanceledByUser       TKErrorCode = -4
	TKErrorCodeAuthenticationFailed TKErrorCode = -5
	TKErrorCodeObjectNotFound       TKErrorCode = -6
	TKErrorCodeTokenNotFound        TKErrorCode = -7
	TKErrorCodeBadParameter         TKErrorCode = -8
	TKErrorCodeAuthenticationNeeded TKErrorCode = -9
	TKErrorAuthenticationFailed     TKErrorCode = -5
	TKErrorObjectNotFound           TKErrorCode = -6
	TKErrorTokenNotFound            TKErrorCode = -7
)

func (TKErrorCode) String

func (e TKErrorCode) String() string

type TKSimpleTLVRecord

type TKSimpleTLVRecord struct {
	TKTLVRecord
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tksimpletlvrecord

func TKSimpleTLVRecordFromID

func TKSimpleTLVRecordFromID(id objc.ID) *TKSimpleTLVRecord

func (*TKSimpleTLVRecord) InitWithTagValue

func (o *TKSimpleTLVRecord) InitWithTagValue(tag uint8, value *foundation.NSData) *TKSimpleTLVRecord

Creates TLV record with specified tag and value. @param tag Tag value for the new record. @param value Value for the new record. @return Newly created TLV record.

type TKSmartCard

type TKSmartCard struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tksmartcard

func TKSmartCardFromID

func TKSmartCardFromID(id objc.ID) *TKSmartCard

func (*TKSmartCard) AllowedProtocols

func (o *TKSmartCard) AllowedProtocols() TKSmartCardProtocol

Bitmask containing allowed protocols to be used when communicating with the card. This property is consulted only during connection to the card, changes are not propagated to already connected session. By default, any protocol can be used.

func (*TKSmartCard) BeginSessionWithReply

func (o *TKSmartCard) BeginSessionWithReply(reply func(bool, unsafe.Pointer))

Begins session with the card. @discussion When session exists, other requests for sessions from other card objects to the same card are blocked. Session is reference-counted, the same amount of 'end' calls must be done to really terminate the session. Note that finishing session does not automatically mean that the card is disconnected; it only happens when another session from different card object is requested. @param success Signals whether session was successfully started. @param error More information about error preventing the transaction to start

func (*TKSmartCard) Cla

func (o *TKSmartCard) Cla() uint8

CLA byte which will be used for sendIns: APDU transmits. Default value is 0x00.

func (*TKSmartCard) Context

func (o *TKSmartCard) Context() objc.ID

User-specified context kept as long as the card is powered. Once the card is removed or another TKSmartCard object opens session, this property is automatically set to nil.

func (*TKSmartCard) CurrentProtocol

func (o *TKSmartCard) CurrentProtocol() TKSmartCardProtocol

Protocol used for communication with the SmartCard. If no card session is established, TKSmartCardProtocolNone is set.

func (*TKSmartCard) EndSession

func (o *TKSmartCard) EndSession()

Terminates the transaction. If no transaction is pending any more, the connection will be closed if there is another session in the system waiting for the transaction.

func (*TKSmartCard) InSessionWithErrorExecuteBlock

func (o *TKSmartCard) InSessionWithErrorExecuteBlock(error_ unsafe.Pointer, block func(unsafe.Pointer) bool) bool

Synchronous variant of session creation. Begins the session, executes given block and ends session. @param error Error receiving more information when transaction failed to start or block failed for some reason. @param block Block to be executed when the session was successfully begun. @return Returns YES if the session was successfully begun and block returned YES, otherwise NO.

func (*TKSmartCard) SendInsP1P2DataLeReply

func (o *TKSmartCard) SendInsP1P2DataLeReply(ins uint8, p1 uint8, p2 uint8, requestData *foundation.NSData, le *foundation.NSNumber, reply func(*foundation.NSData, uint16, unsafe.Pointer))

Transmits APDU to the card and returns response. @discussion Asynchronous high level variant of command for transmitting APDU to the card. Handles all ISO7816-4 APDU cases translation to proper sequences according to used protocol. Consults useExtendedAPDU and useCommandChaining properties and uses these modes whenever appropriate and beneficial for sending requested APDU request. @param ins INS code of the APDU @param p1 P1 code of the APDU @param p2 P2 code of the APDU @param requestData Data field of the APDU, or nil if no input data field should be present (i.e case1 or case2 APDUs). Length of the data serves as Lc field of the APDU. @param le Expected number of bytes to be returned, or nil if no output data are expected (i.e. case1 or case3 APDUs). To get as much bytes as card provides, pass @0. @param replyData Block of returned data without SW1SW2 bytes, or nil if an error occured. @param sw SW1SW2 result code, first two bytes of returned card's reply. @param error Contains error details when nil is returned. Specific error is also filled in if there was no communication error, but card returned other SW code than 0x9000.

func (*TKSmartCard) SendInsP1P2DataLeSwError

func (o *TKSmartCard) SendInsP1P2DataLeSwError(ins uint8, p1 uint8, p2 uint8, requestData *foundation.NSData, le *foundation.NSNumber, sw *uint16) (*foundation.NSData, error)

Transmits APDU to the card and returns response. @discussion Synchronous high level variant of command for transmitting APDU to the card. Handles all ISO7816-4 APDU cases translation to proper sequences according to used protocol. Should be used in block passed to -[TKSmartCard inSessionWithError:executeBlock:] method. @param ins INS code of the APDU @param p1 P1 code of the APDU @param p2 P2 code of the APDU @param data Data field of the APDU. Length of the data serves as Lc field of the APDU @param le Expected number of bytes to be returned, or nil if no output data are expected (i.e. case1 or case3 APDUs). To get as much bytes as card provides, pass @0. @param sw On output, filled with SW1SW2 result code @param error Contains error details when nil is returned. Specific error is also filled in if there was no communication error, but card returned other SW code than 0x9000. @return Returned data field, excluding SW status bytes. If an error occured, returns nil.

func (*TKSmartCard) Sensitive

func (o *TKSmartCard) Sensitive() bool

Flag indicating whether card session should be considered as sensitive. Sensitive session always gets card after reset before communicating with it and never leaves card without reset to be used by another SmartCard object. This might be important in case that card session contain some important state which should not leak to another SmartCard object (possibly running in another, foreign application). Default is NO.

func (*TKSmartCard) SetAllowedProtocols

func (o *TKSmartCard) SetAllowedProtocols(allowedProtocols TKSmartCardProtocol)

func (*TKSmartCard) SetCla

func (o *TKSmartCard) SetCla(cla uint8)

CLA byte which will be used for sendIns: APDU transmits. Default value is 0x00.

func (*TKSmartCard) SetContext

func (o *TKSmartCard) SetContext(context_ objc.ID)

func (*TKSmartCard) SetSensitive

func (o *TKSmartCard) SetSensitive(sensitive bool)

func (*TKSmartCard) SetUseCommandChaining

func (o *TKSmartCard) SetUseCommandChaining(useCommandChaining bool)

Flag indicating whether command chaining of APDU with data field longer than 255 bytes can be used. It is automatically enabled when card announces that command chaining is supported in its ATR. However, caller can explicitly override this decision.

func (*TKSmartCard) SetUseExtendedLength

func (o *TKSmartCard) SetUseExtendedLength(useExtendedLength bool)

Flag indicating whether extended length APDUs should be used. It is automatically enabled only when used slot supports transmitting extended length commands and card announces that extended length APDU are supported in its ATR. However, caller can explicitly override this decision.

func (*TKSmartCard) Slot

func (o *TKSmartCard) Slot() *TKSmartCardSlot

Slot in which is this card inserted.

func (*TKSmartCard) TransmitRequestReply

func (o *TKSmartCard) TransmitRequestReply(request *foundation.NSData, reply func(*foundation.NSData, unsafe.Pointer))

Transmits raw command to the card. This call is allowed only inside session. @param request Request part of APDU @param reponse Response part of APDU, or nil if communication with the card failed @param error Error details when communication with the card failed

func (*TKSmartCard) UseCommandChaining

func (o *TKSmartCard) UseCommandChaining() bool

Flag indicating whether command chaining of APDU with data field longer than 255 bytes can be used. It is automatically enabled when card announces that command chaining is supported in its ATR. However, caller can explicitly override this decision.

func (*TKSmartCard) UseExtendedLength

func (o *TKSmartCard) UseExtendedLength() bool

Flag indicating whether extended length APDUs should be used. It is automatically enabled only when used slot supports transmitting extended length commands and card announces that extended length APDU are supported in its ATR. However, caller can explicitly override this decision.

func (*TKSmartCard) UserInteractionForSecurePINChangeWithPINFormatAPDUCurrentPINByteOffsetNewPINByteOffset

func (o *TKSmartCard) UserInteractionForSecurePINChangeWithPINFormatAPDUCurrentPINByteOffsetNewPINByteOffset(pINFormat *TKSmartCardPINFormat, aPDU *foundation.NSData, currentPINByteOffset int, newPINByteOffset int) *TKSmartCardUserInteractionForSecurePINChange

Creates a new user interaction object for secure PIN change using the SmartCard reader facilities (typically a HW keypad). @note This interaction is only allowed within a session. @param PINFormat PIN format descriptor. @param APDU Predefined APDU in which the SmartCard reader fills in the PIN(s). @param currentPINByteOffset Offset in bytes within APDU data field to mark a location of a PIN block for filling in the current PIN. @param newPINByteOffset Offset in bytes within APDU data field to mark a location of a PIN block for filling in the new PIN. @return A new user interaction object, or nil if this feature is not supported by the SmartCard reader. After the interaction has been successfully completed the operation result is available in the result properites.

func (*TKSmartCard) UserInteractionForSecurePINVerificationWithPINFormatAPDUPINByteOffset

func (o *TKSmartCard) UserInteractionForSecurePINVerificationWithPINFormatAPDUPINByteOffset(pINFormat *TKSmartCardPINFormat, aPDU *foundation.NSData, pINByteOffset int) *TKSmartCardUserInteractionForSecurePINVerification

Creates a new user interaction object for secure PIN verification using the SmartCard reader facilities (typically a HW keypad). @note This interaction is only allowed within a session. @param PINFormat PIN format descriptor. @param APDU Predefined APDU in which the SmartCard reader fills in the PIN. @param PINByteOffset Offset in bytes within APDU data field to mark a location of a PIN block for filling in the entered PIN (currently unused, must be 0). @return A new user interaction object, or nil if this feature is not supported by the SmartCard reader. After the interaction has been successfully completed the operation result is available in the result properites.

func (*TKSmartCard) Valid

func (o *TKSmartCard) Valid() bool

Flag indicating whether card is valid, i.e. it was not removed from the reader. Use Key-Value-Observing to be notified about card removal.

type TKSmartCardATR

type TKSmartCardATR struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tksmartcardatr

func TKSmartCardATRFromID

func TKSmartCardATRFromID(id objc.ID) *TKSmartCardATR

func (*TKSmartCardATR) Bytes

func (o *TKSmartCardATR) Bytes() *foundation.NSData

Full ATR as string of bytes

func (*TKSmartCardATR) HistoricalBytes

func (o *TKSmartCardATR) HistoricalBytes() *foundation.NSData

Just historical bytes of ATR, without Tck and interface bytes.

func (*TKSmartCardATR) HistoricalRecords

func (o *TKSmartCardATR) HistoricalRecords() *foundation.NSArray[*TKCompactTLVRecord]

An array of TKCompactTLVRecord instances with TLV records parsed from historical bytes. If historical bytes are not structured using Compact TLV encoding, nil is returned. @note In case that ATR historical bytes begin with 0x00, the last three bytes (status indicator) are automatically appended into the returned records as if historical bytes would begin with 0x80 and 0x8 record is present in historical bytes.

func (*TKSmartCardATR) InitWithBytes

func (o *TKSmartCardATR) InitWithBytes(bytes_ *foundation.NSData) *TKSmartCardATR

Parses ATR from binary data block @param bytes Data containing full valid ATR @return Parsed ATR instance, or nil when #bytes do not contain valid ATR.

func (*TKSmartCardATR) InitWithSource

func (o *TKSmartCardATR) InitWithSource(source func() int) *TKSmartCardATR

Parses ATR from stream. @param source Provides one byte of ATR from the stream or -1 in case of an error @return Parsed ATR instance, or nil when #source method failed or an invalid ATR is detected

func (*TKSmartCardATR) InterfaceGroupAtIndex

func (o *TKSmartCardATR) InterfaceGroupAtIndex(index int) *TKSmartCardATRInterfaceGroup

Retrieves interface group with specified index. @param index Index of the requested interface group. Indexing conforms to ISO7816-3, i.e. starts from 1. @return Interface group with given index, or nil of no such group was present.

func (*TKSmartCardATR) InterfaceGroupForProtocol

func (o *TKSmartCardATR) InterfaceGroupForProtocol(protocol TKSmartCardProtocol) *TKSmartCardATRInterfaceGroup

@param protocol Protocol number for which the interface group is requested.

func (*TKSmartCardATR) Protocols

Array of NSNumber of protocols indicated in ATR, in the correct order (i.e. the default protocol comes first), duplicates sorted out.

type TKSmartCardATRInterfaceGroup

type TKSmartCardATRInterfaceGroup struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tksmartcardatrinterfacegroup

func TKSmartCardATRInterfaceGroupFromID

func TKSmartCardATRInterfaceGroupFromID(id objc.ID) *TKSmartCardATRInterfaceGroup

func (*TKSmartCardATRInterfaceGroup) Protocol

Protocol number for this group. First group (global) has protocol unassigned, contains nil.

func (*TKSmartCardATRInterfaceGroup) TA

TA interface byte of ATR group, or nil if TA is not present.

func (*TKSmartCardATRInterfaceGroup) TB

TB interface byte of ATR group, or nil if TB is not present.

func (*TKSmartCardATRInterfaceGroup) TC

TC interface byte of ATR group, or nil if TC is not present.

type TKSmartCardPINCharset

type TKSmartCardPINCharset int64
const (
	// PIN is only composed of digits.
	TKSmartCardPINCharsetNumeric TKSmartCardPINCharset = 0
	// PIN can be composed of digits and letters.
	TKSmartCardPINCharsetAlphanumeric TKSmartCardPINCharset = 1
	// PIN can be composed of digits and uppercase letters.
	TKSmartCardPINCharsetUpperAlphanumeric TKSmartCardPINCharset = 2
)

func (TKSmartCardPINCharset) String

func (e TKSmartCardPINCharset) String() string

type TKSmartCardPINCompletion

type TKSmartCardPINCompletion uint64
const (
	// Completion by reaching the maximum PIN length.
	TKSmartCardPINCompletionMaxLength TKSmartCardPINCompletion = 1
	// Completion by pressing the validation key.
	TKSmartCardPINCompletionKey TKSmartCardPINCompletion = 2
	// Completion by timeout expiration.
	TKSmartCardPINCompletionTimeout TKSmartCardPINCompletion = 4
)

func (TKSmartCardPINCompletion) String

func (e TKSmartCardPINCompletion) String() string

type TKSmartCardPINConfirmation

type TKSmartCardPINConfirmation uint64
const (
	// No confirmation requested.
	TKSmartCardPINConfirmationNone TKSmartCardPINConfirmation = 0
	// Confirmation (entry) of the new PIN requested.
	TKSmartCardPINConfirmationNew TKSmartCardPINConfirmation = 1
	// Confirmation (entry) of the current PIN requested.
	TKSmartCardPINConfirmationCurrent TKSmartCardPINConfirmation = 2
)

func (TKSmartCardPINConfirmation) String

type TKSmartCardPINEncoding

type TKSmartCardPINEncoding int64
const (
	// Characters are encoded in Binary format (1234 => 01h 02h 03h 04h).
	TKSmartCardPINEncodingBinary TKSmartCardPINEncoding = 0
	// Characters are encoded in ASCII format (1234 => 31h 32h 33h 34h).
	TKSmartCardPINEncodingASCII TKSmartCardPINEncoding = 1
	// Characters (only digits) are encoded in BCD format (1234 => 12h 34h).
	TKSmartCardPINEncodingBCD TKSmartCardPINEncoding = 2
)

func (TKSmartCardPINEncoding) String

func (e TKSmartCardPINEncoding) String() string

type TKSmartCardPINFormat

type TKSmartCardPINFormat struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tksmartcardpinformat

func TKSmartCardPINFormatFromID

func TKSmartCardPINFormatFromID(id objc.ID) *TKSmartCardPINFormat

func (*TKSmartCardPINFormat) Charset

Format of PIN characters. @note Default value: TKSmartCardPINCharsetNumeric

func (*TKSmartCardPINFormat) Encoding

Encoding of PIN characters. @note Default value: TKSmartCardPINEncodingASCII

func (*TKSmartCardPINFormat) MaxPINLength

func (o *TKSmartCardPINFormat) MaxPINLength() int

Maximum number of characters to form a valid PIN. @note Default value: 8

func (*TKSmartCardPINFormat) MinPINLength

func (o *TKSmartCardPINFormat) MinPINLength() int

Minimum number of characters to form a valid PIN. @note Default value: 4

func (*TKSmartCardPINFormat) PINBitOffset

func (o *TKSmartCardPINFormat) PINBitOffset() int

Offset in bits within the PIN block to mark a location for filling in the formatted PIN (justified with respect to PINJustification). @note Default value: 0 @discussion The offset, in bits, within the PIN block to mark a location for filling in the formatted PIN, which is justified with respect to the PINJustification property value.

func (*TKSmartCardPINFormat) PINBlockByteLength

func (o *TKSmartCardPINFormat) PINBlockByteLength() int

Total length of the PIN block in bytes. @note Default value: 8

func (*TKSmartCardPINFormat) PINJustification

func (o *TKSmartCardPINFormat) PINJustification() TKSmartCardPINJustification

PIN justification within the PIN block. @note Default value: TKSmartCardPINJustificationLeft

func (*TKSmartCardPINFormat) PINLengthBitOffset

func (o *TKSmartCardPINFormat) PINLengthBitOffset() int

Offset in bits within the PIN block to mark a location for filling in the PIN length (always left justified). @note Default value: 0 @discussion The offset, in bits, within the PIN block to mark a location for filling in the PIN length, which is always left justified.

func (*TKSmartCardPINFormat) PINLengthBitSize

func (o *TKSmartCardPINFormat) PINLengthBitSize() int

Size in bits of the PIN length field. If set to 0, PIN length is not written. @note Default value: 0

func (*TKSmartCardPINFormat) SetCharset

func (o *TKSmartCardPINFormat) SetCharset(charset TKSmartCardPINCharset)

func (*TKSmartCardPINFormat) SetEncoding

func (o *TKSmartCardPINFormat) SetEncoding(encoding TKSmartCardPINEncoding)

func (*TKSmartCardPINFormat) SetMaxPINLength

func (o *TKSmartCardPINFormat) SetMaxPINLength(maxPINLength int)

func (*TKSmartCardPINFormat) SetMinPINLength

func (o *TKSmartCardPINFormat) SetMinPINLength(minPINLength int)

func (*TKSmartCardPINFormat) SetPINBitOffset

func (o *TKSmartCardPINFormat) SetPINBitOffset(pINBitOffset int)

func (*TKSmartCardPINFormat) SetPINBlockByteLength

func (o *TKSmartCardPINFormat) SetPINBlockByteLength(pINBlockByteLength int)

func (*TKSmartCardPINFormat) SetPINJustification

func (o *TKSmartCardPINFormat) SetPINJustification(pINJustification TKSmartCardPINJustification)

func (*TKSmartCardPINFormat) SetPINLengthBitOffset

func (o *TKSmartCardPINFormat) SetPINLengthBitOffset(pINLengthBitOffset int)

func (*TKSmartCardPINFormat) SetPINLengthBitSize

func (o *TKSmartCardPINFormat) SetPINLengthBitSize(pINLengthBitSize int)

type TKSmartCardPINJustification

type TKSmartCardPINJustification int64
const (
	// Justify to the left.
	TKSmartCardPINJustificationLeft TKSmartCardPINJustification = 0
	// Justify to the right.
	TKSmartCardPINJustificationRight TKSmartCardPINJustification = 1
)

func (TKSmartCardPINJustification) String

type TKSmartCardProtocol

type TKSmartCardProtocol uint64
const (
	TKSmartCardProtocolNone TKSmartCardProtocol = 0
	TKSmartCardProtocolT0   TKSmartCardProtocol = 1
	TKSmartCardProtocolT1   TKSmartCardProtocol = 2
	TKSmartCardProtocolT15  TKSmartCardProtocol = 32768
	TKSmartCardProtocolAny  TKSmartCardProtocol = 65535
)

func (TKSmartCardProtocol) String

func (e TKSmartCardProtocol) String() string

type TKSmartCardSlot

type TKSmartCardSlot struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tksmartcardslot

func TKSmartCardSlotFromID

func TKSmartCardSlotFromID(id objc.ID) *TKSmartCardSlot

func (*TKSmartCardSlot) ATR

func (o *TKSmartCardSlot) ATR() *TKSmartCardATR

ATR of the inserted SmartCard, or nil if no or mute SmartCard is inserted.

func (*TKSmartCardSlot) MakeSmartCard

func (o *TKSmartCardSlot) MakeSmartCard() *TKSmartCard

Creates new object representing currently inserted and valid card. @discussion It is possible to instantiate multiple objects for single card, exclusivity is handled by sessions on the level of created SmartCard objects. @return Newly created SmartCard object, or nil if slot does not contain valid card.

func (*TKSmartCardSlot) MaxInputLength

func (o *TKSmartCardSlot) MaxInputLength() int

Maximal length of input APDU that the slot is able to transfer to the card.

func (*TKSmartCardSlot) MaxOutputLength

func (o *TKSmartCardSlot) MaxOutputLength() int

Maximal length of output APDU that the slot is able to transfer from the card.

func (*TKSmartCardSlot) Name

func (o *TKSmartCardSlot) Name() *foundation.NSString

Name of the SmartCard reader slot.

func (*TKSmartCardSlot) State

Current state of the slot. Use KVO to be notified about state changes.

type TKSmartCardSlotManager

type TKSmartCardSlotManager struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tksmartcardslotmanager

func TKSmartCardSlotManagerDefaultManager

func TKSmartCardSlotManagerDefaultManager() *TKSmartCardSlotManager

Global pool of SmartCard reader slots. macOS: Note that defaultManager instance is accessible only if the calling application has 'com.apple.security.smartcard' entitlement set to Boolean:YES. If the calling application does not have this entitlement, defaultManager is always set to nil. iOS: The defaultManager instance is always accessible.

func TKSmartCardSlotManagerFromID

func TKSmartCardSlotManagerFromID(id objc.ID) *TKSmartCardSlotManager

func (*TKSmartCardSlotManager) GetSlotWithNameReply

func (o *TKSmartCardSlotManager) GetSlotWithNameReply(name *foundation.NSString, reply func(*TKSmartCardSlot))

Instantiates smartcard reader slot of specified name. If specified name is not registered, reports nil.

func (*TKSmartCardSlotManager) SlotNamed

Gets SmartCard reader slot with specified name. If reader slot with this name does not exist, returns nil.

func (*TKSmartCardSlotManager) SlotNames

Array of currently known slots in the system. Slots are identified by NSString name instances. Use KVO to be notified about slots arrivals and removals.

type TKSmartCardSlotState

type TKSmartCardSlotState int64
const (
	// Slot is no longer known to the system.  This is terminal state for TKSmartCardSlot instance, once reached, the slot instance can never be revived.
	TKSmartCardSlotStateMissing TKSmartCardSlotState = 0
	// The slot is empty, no card is inserted.
	TKSmartCardSlotStateEmpty TKSmartCardSlotState = 1
	// The card was inserted into the slot and an initial probe is in progress.
	TKSmartCardSlotStateProbing TKSmartCardSlotState = 2
	// The card inserted in the slot does not answer.
	TKSmartCardSlotStateMuteCard TKSmartCardSlotState = 3
	// Card properly answered to reset.
	TKSmartCardSlotStateValidCard TKSmartCardSlotState = 4
)

func (TKSmartCardSlotState) String

func (e TKSmartCardSlotState) String() string

type TKSmartCardToken

type TKSmartCardToken struct {
	TKToken
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tksmartcardtoken

func TKSmartCardTokenFromID

func TKSmartCardTokenFromID(id objc.ID) *TKSmartCardToken

func (*TKSmartCardToken) AID

@discussion This is AID which is specified in extension's plist NSExtensionAttributes as @c com.apple.ctk.aid attribute. If the attribute specifies array of multiple AIDs, this parameter represents AID which was found on the card and is already preselected. If @c com.apple.ctk.aid is not present, no application is automatically preselected and value of this property is nil.

func (*TKSmartCardToken) InitWithSmartCardAIDInstanceIDTokenDriver

func (o *TKSmartCardToken) InitWithSmartCardAIDInstanceIDTokenDriver(smartCard *TKSmartCard, aID *foundation.NSData, instanceID *foundation.NSString, tokenDriver *TKSmartCardTokenDriver) *TKSmartCardToken

@discussion Initializes token instance with specified attributes. @param smartCard TKSmartCard instance representing connection to SmartCard on which the intance should operate. @param AID ISO7816-4 application ID which is preselected on the card. @param instanceID Unique, persistent identifier of this token. This is typically implemented by some kind of SmartCard serial number. @param tokenDriver associated driver which initiated creation of this token.

type TKSmartCardTokenDriver

type TKSmartCardTokenDriver struct {
	TKTokenDriver
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tksmartcardtokendriver

func TKSmartCardTokenDriverFromID

func TKSmartCardTokenDriverFromID(id objc.ID) *TKSmartCardTokenDriver

type TKSmartCardTokenDriverDelegate

type TKSmartCardTokenDriverDelegate interface {
	TKTokenDriverDelegate
	TokenDriverCreateTokenForSmartCardAIDError(driver *TKSmartCardTokenDriver, smartCard *TKSmartCard, aID *foundation.NSData) (*TKSmartCardToken, error)
}

TKSmartCardTokenDriverDelegate wraps the ObjC protocol TKSmartCardTokenDriverDelegate.

type TKSmartCardTokenSession

type TKSmartCardTokenSession struct {
	TKTokenSession
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tksmartcardtokensession

func TKSmartCardTokenSessionFromID

func TKSmartCardTokenSessionFromID(id objc.ID) *TKSmartCardTokenSession

func (*TKSmartCardTokenSession) GetSmartCardWithError

func (o *TKSmartCardTokenSession) GetSmartCardWithError() (*TKSmartCard, error)

@abstract Returns a TKSmartCard instance with an active exclusive session and the SmartCard application selected. Replaces the deprecated @c smartCard property. @discussion The TKSmartCard object is only accessible within the methods of the TKTokenSessionDelegate protocol. If the associated token has an AID set, the returned card will have an exclusive session already opened and the specified application selected. In this scenario: Do not call -[TKSmartCard beginSessionWithReply:]) on the returned SmartCard instance. The system manages the session lifecycle and will terminate it automatically when the current token request servicing is finished. Do not call -[TKSmartCard endSession]. You can use the `smartCard.context` property to store any context-specific state information related to the card. This property is automatically set to `nil` if the card is reset or accessed by a different TKSmartCard instance (potentially in another process). Before performing an operation, check the `TKSmartCard.context` property for a previously stored value. This can help you avoid potentially costly restoration of the SmartCard state if it's already available. @param error An NSError object containing details if the operation fails.

func (*TKSmartCardTokenSession) SmartCard

func (o *TKSmartCardTokenSession) SmartCard() *TKSmartCard

@deprecated use -[getSmartCardWithError:] instead @abstract contains TKSmartCard instance with active exclusive session and SmartCard application selected. @discussion This property can be accessed only when handling one of the methods of TKTokenSessionDelegate protocol. If associated token has set AID property, then the returned card has opened exclusive session to the card and the application is already selected. Therefore there is no need to call -[TKSmartCard beginSessionWithReply:]) on returned SmartCard instance in such case and system will take care of terminating session when current token request servicing is finished, -[TKSmartCard endSession] must not be called either. You can store any kind of context state information representing state of the card into smartCard.context property. This property will be automatically set to nil if the card is reset or accessed by different TKSmartCard instance (possibly in another process). Checking TKSmartCard.context property for previously stored value can be used to avoid potentially costly restoring of SmartCard state before performing the operation. Deprecated: since macOS 26.0.

type TKSmartCardUserInteraction

type TKSmartCardUserInteraction struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tksmartcarduserinteraction

func TKSmartCardUserInteractionFromID

func TKSmartCardUserInteractionFromID(id objc.ID) *TKSmartCardUserInteraction

func (*TKSmartCardUserInteraction) Cancel

func (o *TKSmartCardUserInteraction) Cancel() bool

Attempts to cancel a running interaction. Note that for some interactions, this functionality might not be available. @return Returns NO if the operation is not running, or cancelling is not supported.

func (*TKSmartCardUserInteraction) Delegate

Delegate for state observing of the interaction.

func (*TKSmartCardUserInteraction) InitialTimeout

func (o *TKSmartCardUserInteraction) InitialTimeout() float64

Initial interaction timeout. If set to 0, the reader-defined default timeout is used. @note Default value: 0

func (*TKSmartCardUserInteraction) InteractionTimeout

func (o *TKSmartCardUserInteraction) InteractionTimeout() float64

Timeout after the first key stroke. If set to 0, the reader-defined default timeout is used. @note Default value: 0

func (*TKSmartCardUserInteraction) RunWithReply

func (o *TKSmartCardUserInteraction) RunWithReply(reply func(bool, unsafe.Pointer))

Runs the interaction.

func (*TKSmartCardUserInteraction) SetDelegate

func (*TKSmartCardUserInteraction) SetInitialTimeout

func (o *TKSmartCardUserInteraction) SetInitialTimeout(initialTimeout float64)

func (*TKSmartCardUserInteraction) SetInteractionTimeout

func (o *TKSmartCardUserInteraction) SetInteractionTimeout(interactionTimeout float64)

type TKSmartCardUserInteractionDelegate

type TKSmartCardUserInteractionDelegate interface {
}

TKSmartCardUserInteractionDelegate wraps the ObjC protocol TKSmartCardUserInteractionDelegate.

type TKSmartCardUserInteractionForPINOperation

type TKSmartCardUserInteractionForPINOperation struct {
	TKSmartCardUserInteraction
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tksmartcarduserinteractionforpinoperation

func TKSmartCardUserInteractionForPINOperationFromID

func TKSmartCardUserInteractionForPINOperationFromID(id objc.ID) *TKSmartCardUserInteractionForPINOperation

func (*TKSmartCardUserInteractionForPINOperation) Locale

Locale defining the language of displayed messages. If set to nil, the user's current locale is used. @note Default value: the user's current locale

func (*TKSmartCardUserInteractionForPINOperation) PINCompletion

Bitmask specifying condition(s) under which PIN entry should be considered complete. @note Default value: TKSmartCardPINCompletionKey

func (*TKSmartCardUserInteractionForPINOperation) PINMessageIndices

List of message indices referring to a predefined message table. It is used to specify the type and number of messages displayed during the PIN operation. @discussion If nil, the reader does not display any message (reader specific). Typically, PIN verification takes 1 message, PIN modification 1-3 messages. @note Default value: nil

func (*TKSmartCardUserInteractionForPINOperation) ResultData

Optional block of returned data (without SW1SW2 bytes).

func (*TKSmartCardUserInteractionForPINOperation) ResultSW

SW1SW2 result code.

func (*TKSmartCardUserInteractionForPINOperation) SetLocale

func (*TKSmartCardUserInteractionForPINOperation) SetPINCompletion

func (o *TKSmartCardUserInteractionForPINOperation) SetPINCompletion(pINCompletion TKSmartCardPINCompletion)

func (*TKSmartCardUserInteractionForPINOperation) SetPINMessageIndices

func (o *TKSmartCardUserInteractionForPINOperation) SetPINMessageIndices(pINMessageIndices *foundation.NSArray[*foundation.NSNumber])

func (*TKSmartCardUserInteractionForPINOperation) SetResultData

func (o *TKSmartCardUserInteractionForPINOperation) SetResultData(resultData *foundation.NSData)

func (*TKSmartCardUserInteractionForPINOperation) SetResultSW

func (o *TKSmartCardUserInteractionForPINOperation) SetResultSW(resultSW uint16)

type TKSmartCardUserInteractionForSecurePINChange

type TKSmartCardUserInteractionForSecurePINChange struct {
	TKSmartCardUserInteractionForPINOperation
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tksmartcarduserinteractionforsecurepinchange

func TKSmartCardUserInteractionForSecurePINChangeFromID

func TKSmartCardUserInteractionForSecurePINChangeFromID(id objc.ID) *TKSmartCardUserInteractionForSecurePINChange

func (*TKSmartCardUserInteractionForSecurePINChange) PINConfirmation

func (*TKSmartCardUserInteractionForSecurePINChange) SetPINConfirmation

func (o *TKSmartCardUserInteractionForSecurePINChange) SetPINConfirmation(pINConfirmation TKSmartCardPINConfirmation)

type TKTLVRecord

type TKTLVRecord struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tktlvrecord

func TKTLVRecordFromID

func TKTLVRecordFromID(id objc.ID) *TKTLVRecord

func TKTLVRecordRecordFromData

func TKTLVRecordRecordFromData(data *foundation.NSData) *TKTLVRecord

Parses TLV record from data block @param data Data block containing serialized form of TLV record. @return newly parsed record instance or nil if data do not represent valid record.

func (*TKTLVRecord) Data

func (o *TKTLVRecord) Data() *foundation.NSData

Data object containing whole encoded record, including tag, length and value.

func (*TKTLVRecord) Tag

func (o *TKTLVRecord) Tag() uint64

Tag value of the record.

func (*TKTLVRecord) Value

func (o *TKTLVRecord) Value() *foundation.NSData

Value field of the record.

type TKToken

type TKToken struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tktoken

func TKTokenFromID

func TKTokenFromID(id objc.ID) *TKToken

func (*TKToken) Configuration

func (o *TKToken) Configuration() *TKTokenConfiguration

Token configuration associated with this token instance.

func (*TKToken) Delegate

func (o *TKToken) Delegate() TKTokenDelegate

func (*TKToken) InitWithTokenDriverInstanceID

func (o *TKToken) InitWithTokenDriverInstanceID(tokenDriver *TKTokenDriver, instanceID *foundation.NSString) *TKToken

@discussion Initializes token instance @param tokenDriver Creating token driver. @param instanceID Unique, persistent identifier of this token.

func (*TKToken) KeychainContents

func (o *TKToken) KeychainContents() *TKTokenKeychainContents

@discussion Keychain contents (certificate and key items) representing this token.

func (*TKToken) SetDelegate

func (o *TKToken) SetDelegate(delegate TKTokenDelegate)

func (*TKToken) TokenDriver

func (o *TKToken) TokenDriver() *TKTokenDriver

type TKTokenAuthOperation

type TKTokenAuthOperation struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tktokenauthoperation

func TKTokenAuthOperationFromID

func TKTokenAuthOperationFromID(id objc.ID) *TKTokenAuthOperation

func (*TKTokenAuthOperation) FinishWithError

func (o *TKTokenAuthOperation) FinishWithError() (bool, error)

@discussion Handler triggered by the system in order to let the token finalize the authentication operation. @param error Error details (see TKError.h). @return Finalization status.

type TKTokenConfiguration

type TKTokenConfiguration struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tktokenconfiguration

func TKTokenConfigurationFromID

func TKTokenConfigurationFromID(id objc.ID) *TKTokenConfiguration

func (*TKTokenConfiguration) CertificateForObjectIDError

func (o *TKTokenConfiguration) CertificateForObjectIDError(objectID objc.ID) (*TKTokenKeychainCertificate, error)

Returns certificate with specified objectID. Fills error with TKTokenErrorCodeObjectNotFound if no such certificate exists.

func (*TKTokenConfiguration) ConfigurationData

func (o *TKTokenConfiguration) ConfigurationData() *foundation.NSData

Additional configuration available for token instance. Token implementation and its hosting application can use this data for specifying any additional configuration for the token. System does not interpret this data in any way. For example, network-based HSM can store here (using Codable or other serialization mechanisms) target network address, access credentials and the list of identities accessible in the HSM.

func (*TKTokenConfiguration) InstanceID

func (o *TKTokenConfiguration) InstanceID() *foundation.NSString

Unique, persistent identifier of this token, always created by specific token implementation. Typically implemented by some kind of serial number of the target hardware, for example SmartCard serial number.

func (*TKTokenConfiguration) KeyForObjectIDError

func (o *TKTokenConfiguration) KeyForObjectIDError(objectID objc.ID) (*TKTokenKeychainKey, error)

Returns keychain item key with specified objectID. Fills error with TKTokenErrorCodeObjectNotFound if no such key exists.

func (*TKTokenConfiguration) KeychainItems

All keychain items of this token.

func (*TKTokenConfiguration) SetConfigurationData

func (o *TKTokenConfiguration) SetConfigurationData(configurationData *foundation.NSData)

func (*TKTokenConfiguration) SetKeychainItems

func (o *TKTokenConfiguration) SetKeychainItems(keychainItems *foundation.NSArray[*TKTokenKeychainItem])

type TKTokenDelegate

type TKTokenDelegate interface {
	TokenCreateSessionWithError(token *TKToken) (*TKTokenSession, error)
}

TKTokenDelegate wraps the ObjC protocol TKTokenDelegate.

type TKTokenDriver

type TKTokenDriver struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tktokendriver

func TKTokenDriverFromID

func TKTokenDriverFromID(id objc.ID) *TKTokenDriver

func (*TKTokenDriver) Delegate

func (o *TKTokenDriver) Delegate() TKTokenDriverDelegate

func (*TKTokenDriver) SetDelegate

func (o *TKTokenDriver) SetDelegate(delegate TKTokenDriverDelegate)

type TKTokenDriverConfiguration

type TKTokenDriverConfiguration struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tktokendriverconfiguration

func TKTokenDriverConfigurationFromID

func TKTokenDriverConfigurationFromID(id objc.ID) *TKTokenDriverConfiguration

func (*TKTokenDriverConfiguration) AddTokenConfigurationForTokenInstanceID

func (o *TKTokenDriverConfiguration) AddTokenConfigurationForTokenInstanceID(instanceID *foundation.NSString) *TKTokenConfiguration

Creates new configuration object for token with specified instanceID and adds it into tokenConfigurations dictionary. If configuration with specified instanceID already exists, it is replaced with new empty configuration.

func (*TKTokenDriverConfiguration) ClassID

ClassID of the token configuration. ClassID is taken from @p com.apple.ctk.class-id token extension attribute.

func (*TKTokenDriverConfiguration) RemoveTokenConfigurationForTokenInstanceID

func (o *TKTokenDriverConfiguration) RemoveTokenConfigurationForTokenInstanceID(instanceID *foundation.NSString)

Removes configuration with specified tokenID. Does nothing if no such token configuration exists.

func (*TKTokenDriverConfiguration) TokenConfigurations

Dictionary of all currently configured tokens for this token class, keyed by instanceID.

type TKTokenDriverDelegate

type TKTokenDriverDelegate interface {
}

TKTokenDriverDelegate wraps the ObjC protocol TKTokenDriverDelegate.

type TKTokenKeyAlgorithm

type TKTokenKeyAlgorithm struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tktokenkeyalgorithm

func TKTokenKeyAlgorithmFromID

func TKTokenKeyAlgorithmFromID(id objc.ID) *TKTokenKeyAlgorithm

func (*TKTokenKeyAlgorithm) IsAlgorithm

func (o *TKTokenKeyAlgorithm) IsAlgorithm(algorithm unsafe.Pointer) bool

@brief Checks if specified algorithm is base operation algorithm.

func (*TKTokenKeyAlgorithm) SupportsAlgorithm

func (o *TKTokenKeyAlgorithm) SupportsAlgorithm(algorithm unsafe.Pointer) bool

@brief Checks whether specified algorithm is either target algorithm or one of the algorithms through which the operation passed.

type TKTokenKeyExchangeParameters

type TKTokenKeyExchangeParameters struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tktokenkeyexchangeparameters

func TKTokenKeyExchangeParametersFromID

func TKTokenKeyExchangeParametersFromID(id objc.ID) *TKTokenKeyExchangeParameters

func (*TKTokenKeyExchangeParameters) RequestedSize

func (o *TKTokenKeyExchangeParameters) RequestedSize() int

@discussion Requested output size of key exchange result. Should be ignored if output size is not configurable for specified key exchange algorithm.

func (*TKTokenKeyExchangeParameters) SharedInfo

@discussion Additional shared information input, typically used for key derivation (KDF) step of key exchange algorithm. Should be ignored if shared info is not used for specified key exchange algorithm.

type TKTokenKeychainCertificate

type TKTokenKeychainCertificate struct {
	TKTokenKeychainItem
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tktokenkeychaincertificate

func TKTokenKeychainCertificateFromID

func TKTokenKeychainCertificateFromID(id objc.ID) *TKTokenKeychainCertificate

func (*TKTokenKeychainCertificate) Data

func (*TKTokenKeychainCertificate) InitWithCertificateObjectID

func (o *TKTokenKeychainCertificate) InitWithCertificateObjectID(certificateRef unsafe.Pointer, objectID objc.ID) *TKTokenKeychainCertificate

@discussion initialize TKTokenKeychainCertificate with data from SecCertificateRef. Use SecCertificateCreateWithData to obtain SecCertificateRef. @c constraints property is initialized indicating that reading of certificate is always allowed, all other operations are disallowed.

type TKTokenKeychainContents

type TKTokenKeychainContents struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tktokenkeychaincontents

func TKTokenKeychainContentsFromID

func TKTokenKeychainContentsFromID(id objc.ID) *TKTokenKeychainContents

func (*TKTokenKeychainContents) CertificateForObjectIDError

func (o *TKTokenKeychainContents) CertificateForObjectIDError(objectID objc.ID) (*TKTokenKeychainCertificate, error)

@discussion Returns certificate with specified objectID. Fills error with TKTokenErrorCodeObjectNotFound if no such certificate exists.

func (*TKTokenKeychainContents) FillWithItems

@discussion Fills keychain with the set of specified items. All items belonging to token are first removed from the keychain and then the keychain is populated with new items. @param items New items to be stored into the keychain.

func (*TKTokenKeychainContents) Items

@brief All items related to this token in the keychain.

func (*TKTokenKeychainContents) KeyForObjectIDError

func (o *TKTokenKeychainContents) KeyForObjectIDError(objectID objc.ID) (*TKTokenKeychainKey, error)

@discussion Returns key with specified objectID. Fills error with TKTokenErrorCodeObjectNotFound if no such key exists.

type TKTokenKeychainItem

type TKTokenKeychainItem struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tktokenkeychainitem

func TKTokenKeychainItemFromID

func TKTokenKeychainItemFromID(id objc.ID) *TKTokenKeychainItem

func (*TKTokenKeychainItem) Constraints

@discussion Contains access constraints for this object keyed by TKTOpenOperation wrapped in NSNumber.

func (*TKTokenKeychainItem) InitWithObjectID

func (o *TKTokenKeychainItem) InitWithObjectID(objectID objc.ID) *TKTokenKeychainItem

@brief Initializes item with objectID.

func (*TKTokenKeychainItem) Label

@discussion Contains the user-visible label for this item. This property is an equivalent of kSecAttrLabel in SecItem.h

func (*TKTokenKeychainItem) ObjectID

func (o *TKTokenKeychainItem) ObjectID() objc.ID

@brief object ID for item identification

func (*TKTokenKeychainItem) SetConstraints

func (o *TKTokenKeychainItem) SetConstraints(constraints *foundation.NSDictionary[*foundation.NSNumber, objc.ID])

func (*TKTokenKeychainItem) SetLabel

func (o *TKTokenKeychainItem) SetLabel(label *foundation.NSString)

type TKTokenKeychainKey

type TKTokenKeychainKey struct {
	TKTokenKeychainItem
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tktokenkeychainkey

func TKTokenKeychainKeyFromID

func TKTokenKeychainKeyFromID(id objc.ID) *TKTokenKeychainKey

func (*TKTokenKeychainKey) ApplicationTag

func (o *TKTokenKeychainKey) ApplicationTag() *foundation.NSData

@discussion Represents private tag data. The property is an equivalent to kSecAttrApplicationTag in SecItem.h

func (*TKTokenKeychainKey) CanDecrypt

func (o *TKTokenKeychainKey) CanDecrypt() bool

@discussion Indicates whether this key can be used to decrypt data. The property is an equivalent to kSecAttrCanDecrypt in SecItem.h

func (*TKTokenKeychainKey) CanPerformKeyExchange

func (o *TKTokenKeychainKey) CanPerformKeyExchange() bool

@discussion Indicates whether this key can be used to perform Diffie-Hellman style cryptographic key exchange.

func (*TKTokenKeychainKey) CanSign

func (o *TKTokenKeychainKey) CanSign() bool

@discussion Indicates whether this key can be used to create a digital signature. The property is an equivalent to kSecAttrCanSign in SecItem.h

func (*TKTokenKeychainKey) InitWithCertificateObjectID

func (o *TKTokenKeychainKey) InitWithCertificateObjectID(certificateRef unsafe.Pointer, objectID objc.ID) *TKTokenKeychainKey

@discussion Initialize TKTokenKeychainKey with informations from SecCertificateRef associated with the key. Use SecCertificateCreateWithData to obtain SecCertificateRef. If NULL is passed instead of certificate, all properties of created instance must be initialized manually.

func (*TKTokenKeychainKey) IsSuitableForLogin

func (o *TKTokenKeychainKey) IsSuitableForLogin() bool

@discussion Indicates whether this key can be used for login in to the system.

func (*TKTokenKeychainKey) KeySizeInBits

func (o *TKTokenKeychainKey) KeySizeInBits() int

@discussion Indicates the number of bits in this key. The property is an equivalent to kSecAttrKeySizeInBits in SecItem.h

func (*TKTokenKeychainKey) KeyType

func (o *TKTokenKeychainKey) KeyType() *foundation.NSString

@discussion Type of the key, currently kSecAttrKeyTypeRSA and kSecAttrKeyTypeECSECPrimeRandom is supported). The property is an equivalent to kSecAttrKeyType in SecItem.h

func (*TKTokenKeychainKey) PublicKeyData

func (o *TKTokenKeychainKey) PublicKeyData() *foundation.NSData

@discussion Contains raw public key data for this private key.

func (*TKTokenKeychainKey) PublicKeyHash

func (o *TKTokenKeychainKey) PublicKeyHash() *foundation.NSData

@discussion SHA1 hash of the raw public key. The property is an equivalent to kSecAttrApplicationLabel in SecItem.h

func (*TKTokenKeychainKey) SetApplicationTag

func (o *TKTokenKeychainKey) SetApplicationTag(applicationTag *foundation.NSData)

func (*TKTokenKeychainKey) SetCanDecrypt

func (o *TKTokenKeychainKey) SetCanDecrypt(canDecrypt bool)

func (*TKTokenKeychainKey) SetCanPerformKeyExchange

func (o *TKTokenKeychainKey) SetCanPerformKeyExchange(canPerformKeyExchange bool)

func (*TKTokenKeychainKey) SetCanSign

func (o *TKTokenKeychainKey) SetCanSign(canSign bool)

func (*TKTokenKeychainKey) SetKeySizeInBits

func (o *TKTokenKeychainKey) SetKeySizeInBits(keySizeInBits int)

func (*TKTokenKeychainKey) SetKeyType

func (o *TKTokenKeychainKey) SetKeyType(keyType *foundation.NSString)

func (*TKTokenKeychainKey) SetPublicKeyData

func (o *TKTokenKeychainKey) SetPublicKeyData(publicKeyData *foundation.NSData)

func (*TKTokenKeychainKey) SetPublicKeyHash

func (o *TKTokenKeychainKey) SetPublicKeyHash(publicKeyHash *foundation.NSData)

func (*TKTokenKeychainKey) SetSuitableForLogin

func (o *TKTokenKeychainKey) SetSuitableForLogin(suitableForLogin bool)

type TKTokenOperation

type TKTokenOperation int64
const (
	TKTokenOperationNone TKTokenOperation = 0
	// Reading of raw data of certificate.
	TKTokenOperationReadData TKTokenOperation = 1
	// Cryptographic signature using private key.
	TKTokenOperationSignData TKTokenOperation = 2
	// Decrypting data using private key.
	TKTokenOperationDecryptData TKTokenOperation = 3
	// Performing Diffie-Hellman style of cryptographic key exchange using private key.
	TKTokenOperationPerformKeyExchange TKTokenOperation = 4
)

func (TKTokenOperation) String

func (e TKTokenOperation) String() string

type TKTokenPasswordAuthOperation

type TKTokenPasswordAuthOperation struct {
	TKTokenAuthOperation
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tktokenpasswordauthoperation

func TKTokenPasswordAuthOperationFromID

func TKTokenPasswordAuthOperationFromID(id objc.ID) *TKTokenPasswordAuthOperation

func (*TKTokenPasswordAuthOperation) Password

func (*TKTokenPasswordAuthOperation) SetPassword

func (o *TKTokenPasswordAuthOperation) SetPassword(password *foundation.NSString)

type TKTokenSession

type TKTokenSession struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tktokensession

func TKTokenSessionFromID

func TKTokenSessionFromID(id objc.ID) *TKTokenSession

func (*TKTokenSession) Delegate

func (o *TKTokenSession) Delegate() TKTokenSessionDelegate

func (*TKTokenSession) InitWithToken

func (o *TKTokenSession) InitWithToken(token *TKToken) *TKTokenSession

@param token Token instance to which is this session instance bound.

func (*TKTokenSession) SetDelegate

func (o *TKTokenSession) SetDelegate(delegate TKTokenSessionDelegate)

func (*TKTokenSession) Token

func (o *TKTokenSession) Token() *TKToken

type TKTokenSessionDelegate

type TKTokenSessionDelegate interface {
}

TKTokenSessionDelegate wraps the ObjC protocol TKTokenSessionDelegate.

type TKTokenSmartCardPINAuthOperation

type TKTokenSmartCardPINAuthOperation struct {
	TKTokenAuthOperation
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tktokensmartcardpinauthoperation

func TKTokenSmartCardPINAuthOperationFromID

func TKTokenSmartCardPINAuthOperationFromID(id objc.ID) *TKTokenSmartCardPINAuthOperation

func (*TKTokenSmartCardPINAuthOperation) APDUTemplate

@discussion APDU template into which PIN gets filled in. If set to nil, the system will not attempt to authenticate by sending the formatted APDU to the SmartCard, but rather the token itself is expected to perform the authentication. It is preferred to provide APDUTemplate if possible, because it allows using hardware PINPad for secure PIN entry (provided that the reader has one).

func (*TKTokenSmartCardPINAuthOperation) PIN

@discussion PIN value which will be set when 'finishWithError:' gets triggered. Note that the PIN is not set in case that APDUTemplate was set. In this case, PIN was already sent to the card using specified template.

func (*TKTokenSmartCardPINAuthOperation) PINByteOffset

func (o *TKTokenSmartCardPINAuthOperation) PINByteOffset() int

@discussion Offset in bytes within APDU template to mark the location for filling in the PIN.

func (*TKTokenSmartCardPINAuthOperation) PINFormat

@discussion PIN formatting properties. @note The property is initialized with a default instance of TKSmartCardPINFormat.

func (*TKTokenSmartCardPINAuthOperation) SetAPDUTemplate

func (o *TKTokenSmartCardPINAuthOperation) SetAPDUTemplate(aPDUTemplate *foundation.NSData)

func (*TKTokenSmartCardPINAuthOperation) SetPIN

func (*TKTokenSmartCardPINAuthOperation) SetPINByteOffset

func (o *TKTokenSmartCardPINAuthOperation) SetPINByteOffset(pINByteOffset int)

func (*TKTokenSmartCardPINAuthOperation) SetPINFormat

func (o *TKTokenSmartCardPINAuthOperation) SetPINFormat(pINFormat *TKSmartCardPINFormat)

func (*TKTokenSmartCardPINAuthOperation) SetSmartCard

func (o *TKTokenSmartCardPINAuthOperation) SetSmartCard(smartCard *TKSmartCard)

func (*TKTokenSmartCardPINAuthOperation) SmartCard

@discussion TKSmartCard to which the formatted APDU gets sent in order to authenticate (used only if 'APDUTemplate' is set).

type TKTokenWatcher

type TKTokenWatcher struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tktokenwatcher

func TKTokenWatcherFromID

func TKTokenWatcherFromID(id objc.ID) *TKTokenWatcher

func (*TKTokenWatcher) AddRemovalHandlerForTokenID

func (o *TKTokenWatcher) AddRemovalHandlerForTokenID(removalHandler func(*foundation.NSString), tokenID *foundation.NSString)

Add removal watcher for specific tokenID @disscussion after removalHandler for a specific tokenID is called the reference to this handler is removed. For one tokenID just one handler can be added, so next call to addRemovalHandler will replace previous handler @param removalHandler called when a token is removed @param tokenID specified tokenID, if tokenID does not exist removal handler is called imediately

func (*TKTokenWatcher) Init

func (o *TKTokenWatcher) Init() *TKTokenWatcher

Init watcher

func (*TKTokenWatcher) InitWithInsertionHandler

func (o *TKTokenWatcher) InitWithInsertionHandler(insertionHandler func(*foundation.NSString)) *TKTokenWatcher

Init watcher with insertion handler @disscussion init watcher with insertion handler which is called when a new token arrives @param insertionHandler called when a new token is inserted Deprecated: since macOS 10.13.

func (*TKTokenWatcher) SetInsertionHandler

func (o *TKTokenWatcher) SetInsertionHandler(insertionHandler func(*foundation.NSString))

Set insertion handler @disscussion when an insertion handler is set the TokenWatcher will call this handler when new token appears in the system. TokenWatcher will call the handler also for tokens which was registered in the system before the handler was set. @param insertionHandler called when a new token is inserted

func (*TKTokenWatcher) TokenIDs

Array of currently known TokenIDs in the system. Tokens are identified by instance's names. It is possible to use KVO to be notified about token arrivals and removals.

func (*TKTokenWatcher) TokenInfoForTokenID

func (o *TKTokenWatcher) TokenInfoForTokenID(tokenID *foundation.NSString) *TKTokenWatcherTokenInfo

Return TokenInfo for specific tokenID @param tokenID specified tokenID @return A TokenInfo object, or nil if tokenID does not exist

type TKTokenWatcherTokenInfo

type TKTokenWatcherTokenInfo struct {
	foundation.NSObject
}

Apple documentation: https://developer.apple.com/documentation/cryptotokenkit/tktokenwatchertokeninfo

func TKTokenWatcherTokenInfoFromID

func TKTokenWatcherTokenInfoFromID(id objc.ID) *TKTokenWatcherTokenInfo

func (*TKTokenWatcherTokenInfo) DriverName

func (o *TKTokenWatcherTokenInfo) DriverName() *foundation.NSString

Localized driver name (if available)

func (*TKTokenWatcherTokenInfo) SlotName

The slot name (if available)

func (*TKTokenWatcherTokenInfo) TokenID

TokenID

type Virtual_memory_guard_exception_code_t

type Virtual_memory_guard_exception_code_t int64
const (
	KGUARD_EXC_DEALLOC_GAP                   Virtual_memory_guard_exception_code_t = 1
	KGUARD_EXC_RECLAIM_COPYIO_FAILURE        Virtual_memory_guard_exception_code_t = 2
	KGUARD_EXC_RECLAIM_INDEX_FAILURE         Virtual_memory_guard_exception_code_t = 4
	KGUARD_EXC_RECLAIM_DEALLOCATE_FAILURE    Virtual_memory_guard_exception_code_t = 8
	KGUARD_EXC_RECLAIM_ACCOUNTING_FAILURE    Virtual_memory_guard_exception_code_t = 9
	KGUARD_EXC_SEC_IOPL_ON_EXEC_PAGE         Virtual_memory_guard_exception_code_t = 10
	KGUARD_EXC_SEC_EXEC_ON_IOPL_PAGE         Virtual_memory_guard_exception_code_t = 11
	KGUARD_EXC_SEC_UPL_WRITE_ON_EXEC_REGION  Virtual_memory_guard_exception_code_t = 12
	KGUARD_EXC_LARGE_ALLOCATION_TELEMETRY    Virtual_memory_guard_exception_code_t = 13
	KGUARD_EXC_SEC_ACCESS_FAULT              Virtual_memory_guard_exception_code_t = 98
	KGUARD_EXC_SEC_ASYNC_ACCESS_FAULT        Virtual_memory_guard_exception_code_t = 99
	KGUARD_EXC_SEC_COPY_DENIED               Virtual_memory_guard_exception_code_t = 100
	KGUARD_EXC_SEC_SHARING_DENIED            Virtual_memory_guard_exception_code_t = 101
	KGUARD_EXC_MTE_SYNC_FAULT                Virtual_memory_guard_exception_code_t = 200
	KGUARD_EXC_MTE_ASYNC_USER_FAULT          Virtual_memory_guard_exception_code_t = 201
	KGUARD_EXC_MTE_ASYNC_KERN_FAULT          Virtual_memory_guard_exception_code_t = 202
	KGUARD_EXC_GUARD_OBJECT_ASYNC_USER_FAULT Virtual_memory_guard_exception_code_t = 203
	KGUARD_EXC_GUARD_OBJECT_ASYNC_KERN_FAULT Virtual_memory_guard_exception_code_t = 204
)

func (Virtual_memory_guard_exception_code_t) String

type Xpc_listener_create_flags_t

type Xpc_listener_create_flags_t int64
const (
	XPC_LISTENER_CREATE_NONE             Xpc_listener_create_flags_t = 0
	XPC_LISTENER_CREATE_INACTIVE         Xpc_listener_create_flags_t = 1
	XPC_LISTENER_CREATE_FORCE_MACH       Xpc_listener_create_flags_t = 2
	XPC_LISTENER_CREATE_FORCE_XPCSERVICE Xpc_listener_create_flags_t = 4
)

func (Xpc_listener_create_flags_t) String

type Xpc_session_create_flags_t

type Xpc_session_create_flags_t int64
const (
	XPC_SESSION_CREATE_NONE            Xpc_session_create_flags_t = 0
	XPC_SESSION_CREATE_INACTIVE        Xpc_session_create_flags_t = 1
	XPC_SESSION_CREATE_MACH_PRIVILEGED Xpc_session_create_flags_t = 2
)

func (Xpc_session_create_flags_t) String

Jump to

Keyboard shortcuts

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