Documentation
¶
Overview ¶
Package cryptotokenkit provides Go bindings for the CryptoTokenKit framework.
Access security tokens and the cryptographic assets they store.
You use the CryptoTokenKit framework to easily access cryptographic tokens. Tokens are physical devices built in to the system, located on attached hardware (like a smart card), or accessible through a network connection. Tokens store cryptographic objects like keys and certificates. They also may perform operations—for example, encryption or digital signature verification—using these objects. You use the framework to work with a token’s assets as if they were part of your system, even though they remain secured by the token.
Smart Cards ¶
- Using Cryptographic Assets Stored on a Smart Card: Access certificates, keys, and identities stored on a smart card as if they were part of the keychain.
- TKSmartCardSlotManager: An interface to all available smart card reader slots.
- TKSmartCardSlot: A single smart card reader slot in the system. (TKSmartCardATR)
- TKSmartCard: A representation of a smart card. (TKSmartCardProtocol, TKSmartCardPINFormat, TKSmartCardUserInteraction, TKSmartCardUserInteractionForPINOperation, TKSmartCardUserInteractionForSecurePINChange)
Smart Card App Extensions ¶
- Authenticating Users with a Cryptographic Token: Grant access to user accounts and the keychain by creating a smart card app extension.
- Configuring Smart Card Authentication: Set preferences for smart card authentication operations, including those on managed devices.
- TKSmartCardTokenDriver: The driver that acts as an entry point for smart card app extensions. (TKSmartCardTokenDriverDelegate)
- TKSmartCardToken: A representation of a smart card based cryptographic token. (TKSmartCard, TKTLVRecord, TKBERTLVRecord, TKCompactTLVRecord, TKSimpleTLVRecord)
- TKSmartCardTokenSession: A token session that is based on a smart card token.
Tokens ¶
- TKTokenWatcher: An object that tracks the tokens available in the system.
- TKTokenDriver: A base class for building token drivers. (TKTokenDriverDelegate)
- TKToken: A representation of a hardware-based cryptographic token. (TKTokenDelegate, TKTokenKeychainContents, TKTokenKeychainItem, TKTokenKeychainCertificate, TKTokenKeychainKey)
- TKTokenSession: A token session that manages the authentication state of a token. (TKTokenSessionDelegate)
Errors ¶
- TKErrorDomain: The domain for all CryptoTokenKit framework errors.
- TKErrorCode: Error codes from CryptoTokenKit.
Classes ¶
Key Types ¶
- TKSmartCard - A representation of a smart card.
- TKTokenKeychainKey - A token’s key as stored in the keychain.
- TKSmartCardPINFormat - The formatting properties for a PIN, such as character encoding and length constraints.
- TKSmartCardATR - A parsed ATR (Answer To Reset) message from a Smart Card.
- TKSmartCardSlot - A single smart card reader slot in the system.
- TKSmartCardSlotManager - An interface to all available smart card reader slots.
- TKSmartCardUserInteraction - The base class for encapsulating user interaction with a Smart Card reader.
- TKSmartCardUserInteractionForPINOperation - A representation of user interaction for secure PIN operations on a Smart Card reader.
- TKTLVRecord - The base class encapsulating a Tag-Length-Value record.
- TKToken - A representation of a hardware-based cryptographic token.
Code generated from Apple documentation. DO NOT EDIT.
Index ¶
- Variables
- func NewBoolErrorBlock(handler BoolErrorHandler) (objc.ID, func())
- func NewDataErrorBlock(handler DataErrorHandler) (objc.ID, func())
- func NewIntVoidBlock(handler IntVoidHandler) (objc.ID, func())
- func NewStringBlock(handler StringHandler) (objc.ID, func())
- func NewTKSmartCardSlotBlock(handler TKSmartCardSlotHandler) (objc.ID, func())
- type BoolErrorHandler
- type DataErrorHandler
- type ITKBERTLVRecord
- type ITKCompactTLVRecord
- type ITKSimpleTLVRecord
- type ITKSmartCard
- type ITKSmartCardATR
- type ITKSmartCardATRInterfaceGroup
- type ITKSmartCardPINFormat
- type ITKSmartCardSlot
- type ITKSmartCardSlotManager
- type ITKSmartCardToken
- type ITKSmartCardTokenDriver
- type ITKSmartCardTokenSession
- type ITKSmartCardUserInteraction
- type ITKSmartCardUserInteractionForPINOperation
- type ITKSmartCardUserInteractionForSecurePINChange
- type ITKSmartCardUserInteractionForSecurePINVerification
- type ITKTLVRecord
- type ITKToken
- type ITKTokenAuthOperation
- type ITKTokenConfiguration
- type ITKTokenDriver
- type ITKTokenDriverConfiguration
- type ITKTokenKeyAlgorithm
- type ITKTokenKeyExchangeParameters
- type ITKTokenKeychainCertificate
- type ITKTokenKeychainContents
- type ITKTokenKeychainItem
- type ITKTokenKeychainKey
- type ITKTokenPasswordAuthOperation
- type ITKTokenSession
- type ITKTokenSmartCardPINAuthOperation
- type ITKTokenWatcher
- type ITKTokenWatcherTokenInfo
- type IntVoidHandler
- type StringHandler
- type TKBERTLVRecord
- func NewTKBERTLVRecord() TKBERTLVRecord
- func NewTKBERTLVRecordFromData(data foundation.NSData) TKBERTLVRecord
- func NewTKBERTLVRecordWithTagRecords(tag TKTLVTag, records []TKTLVRecord) TKBERTLVRecord
- func NewTKBERTLVRecordWithTagValue(tag TKTLVTag, value foundation.NSData) TKBERTLVRecord
- func TKBERTLVRecordFromID(id objc.ID) TKBERTLVRecord
- type TKBERTLVRecordClass
- type TKCompactTLVRecord
- type TKCompactTLVRecordClass
- type TKErrorCode
- type TKSimpleTLVRecord
- type TKSimpleTLVRecordClass
- type TKSmartCard
- func (t TKSmartCard) AllowedProtocols() TKSmartCardProtocol
- func (t TKSmartCard) Autorelease() TKSmartCard
- func (t TKSmartCard) BeginSessionWithReply(reply BoolErrorHandler)
- func (t TKSmartCard) BeginSessionWithReplySync(ctx context.Context) (bool, error)
- func (t TKSmartCard) Cla() uint8
- func (t TKSmartCard) Context() objectivec.IObject
- func (t TKSmartCard) CurrentProtocol() TKSmartCardProtocol
- func (t TKSmartCard) EndSession()
- func (t TKSmartCard) Init() TKSmartCard
- func (t TKSmartCard) Sensitive() bool
- func (t TKSmartCard) SetAllowedProtocols(value TKSmartCardProtocol)
- func (t TKSmartCard) SetCla(value uint8)
- func (t TKSmartCard) SetContext(value objectivec.IObject)
- func (t TKSmartCard) SetSensitive(value bool)
- func (t TKSmartCard) SetUseCommandChaining(value bool)
- func (t TKSmartCard) SetUseExtendedLength(value bool)
- func (t TKSmartCard) Slot() ITKSmartCardSlot
- func (t TKSmartCard) TransmitRequestReply(request foundation.NSData, reply DataErrorHandler)
- func (t TKSmartCard) TransmitRequestReplySync(ctx context.Context, request foundation.NSData) (*foundation.NSData, error)
- func (t TKSmartCard) UseCommandChaining() bool
- func (t TKSmartCard) UseExtendedLength() bool
- func (t TKSmartCard) UserInteractionForSecurePINChangeWithPINFormatAPDUCurrentPINByteOffsetNewPINByteOffset(PINFormat ITKSmartCardPINFormat, APDU foundation.NSData, ...) ITKSmartCardUserInteractionForSecurePINChange
- func (t TKSmartCard) UserInteractionForSecurePINVerificationWithPINFormatAPDUPINByteOffset(PINFormat ITKSmartCardPINFormat, APDU foundation.NSData, PINByteOffset int) ITKSmartCardUserInteractionForSecurePINVerification
- func (t TKSmartCard) Valid() bool
- type TKSmartCardATR
- func (t TKSmartCardATR) Autorelease() TKSmartCardATR
- func (t TKSmartCardATR) Bytes() foundation.NSData
- func (t TKSmartCardATR) HistoricalBytes() foundation.NSData
- func (t TKSmartCardATR) HistoricalRecords() []TKCompactTLVRecord
- func (t TKSmartCardATR) Init() TKSmartCardATR
- func (t TKSmartCardATR) InitWithBytes(bytes foundation.NSData) TKSmartCardATR
- func (t TKSmartCardATR) InitWithSource(source IntVoidHandler) TKSmartCardATR
- func (t TKSmartCardATR) InterfaceGroupAtIndex(index int) ITKSmartCardATRInterfaceGroup
- func (t TKSmartCardATR) InterfaceGroupForProtocol(protocol_ TKSmartCardProtocol) ITKSmartCardATRInterfaceGroup
- func (t TKSmartCardATR) Protocols() []foundation.NSNumber
- type TKSmartCardATRClass
- type TKSmartCardATRInterfaceGroup
- func (t TKSmartCardATRInterfaceGroup) Autorelease() TKSmartCardATRInterfaceGroup
- func (t TKSmartCardATRInterfaceGroup) Init() TKSmartCardATRInterfaceGroup
- func (t TKSmartCardATRInterfaceGroup) Protocol() foundation.NSNumber
- func (t TKSmartCardATRInterfaceGroup) TA() foundation.NSNumber
- func (t TKSmartCardATRInterfaceGroup) TB() foundation.NSNumber
- func (t TKSmartCardATRInterfaceGroup) TC() foundation.NSNumber
- type TKSmartCardATRInterfaceGroupClass
- type TKSmartCardClass
- type TKSmartCardPINCharset
- type TKSmartCardPINCompletion
- type TKSmartCardPINConfirmation
- type TKSmartCardPINEncoding
- type TKSmartCardPINFormat
- func (t TKSmartCardPINFormat) Autorelease() TKSmartCardPINFormat
- func (t TKSmartCardPINFormat) Charset() TKSmartCardPINCharset
- func (t TKSmartCardPINFormat) Encoding() TKSmartCardPINEncoding
- func (t TKSmartCardPINFormat) Init() TKSmartCardPINFormat
- func (t TKSmartCardPINFormat) MaxPINLength() int
- func (t TKSmartCardPINFormat) MinPINLength() int
- func (t TKSmartCardPINFormat) PINBitOffset() int
- func (t TKSmartCardPINFormat) PINBlockByteLength() int
- func (t TKSmartCardPINFormat) PINJustification() TKSmartCardPINJustification
- func (t TKSmartCardPINFormat) PINLengthBitOffset() int
- func (t TKSmartCardPINFormat) PINLengthBitSize() int
- func (t TKSmartCardPINFormat) SetCharset(value TKSmartCardPINCharset)
- func (t TKSmartCardPINFormat) SetEncoding(value TKSmartCardPINEncoding)
- func (t TKSmartCardPINFormat) SetMaxPINLength(value int)
- func (t TKSmartCardPINFormat) SetMinPINLength(value int)
- func (t TKSmartCardPINFormat) SetPINBitOffset(value int)
- func (t TKSmartCardPINFormat) SetPINBlockByteLength(value int)
- func (t TKSmartCardPINFormat) SetPINJustification(value TKSmartCardPINJustification)
- func (t TKSmartCardPINFormat) SetPINLengthBitOffset(value int)
- func (t TKSmartCardPINFormat) SetPINLengthBitSize(value int)
- type TKSmartCardPINFormatClass
- type TKSmartCardPINJustification
- type TKSmartCardProtocol
- type TKSmartCardSlot
- func (t TKSmartCardSlot) ATR() ITKSmartCardATR
- func (t TKSmartCardSlot) Autorelease() TKSmartCardSlot
- func (t TKSmartCardSlot) Init() TKSmartCardSlot
- func (t TKSmartCardSlot) MakeSmartCard() ITKSmartCard
- func (t TKSmartCardSlot) MaxInputLength() int
- func (t TKSmartCardSlot) MaxOutputLength() int
- func (t TKSmartCardSlot) Name() string
- func (t TKSmartCardSlot) State() TKSmartCardSlotState
- type TKSmartCardSlotClass
- type TKSmartCardSlotHandler
- type TKSmartCardSlotManager
- func (t TKSmartCardSlotManager) Autorelease() TKSmartCardSlotManager
- func (t TKSmartCardSlotManager) GetSlotWithNameReply(name string, reply TKSmartCardSlotHandler)
- func (t TKSmartCardSlotManager) GetSlotWithNameReplySync(ctx context.Context, name string) (*TKSmartCardSlot, error)
- func (t TKSmartCardSlotManager) Init() TKSmartCardSlotManager
- func (t TKSmartCardSlotManager) SlotNamed(name string) ITKSmartCardSlot
- func (t TKSmartCardSlotManager) SlotNames() []string
- type TKSmartCardSlotManagerClass
- type TKSmartCardSlotNFCSessionErrorHandler
- type TKSmartCardSlotState
- type TKSmartCardToken
- func NewTKSmartCardToken() TKSmartCardToken
- func NewTKSmartCardTokenWithSmartCardAIDInstanceIDTokenDriver(smartCard ITKSmartCard, AID foundation.NSData, instanceID string, ...) TKSmartCardToken
- func NewTKSmartCardTokenWithTokenDriverInstanceID(tokenDriver ITKTokenDriver, instanceID TKTokenInstanceID) TKSmartCardToken
- func TKSmartCardTokenFromID(id objc.ID) TKSmartCardToken
- func (t TKSmartCardToken) AID() foundation.NSData
- func (t TKSmartCardToken) Autorelease() TKSmartCardToken
- func (t TKSmartCardToken) Init() TKSmartCardToken
- func (t TKSmartCardToken) InitWithSmartCardAIDInstanceIDTokenDriver(smartCard ITKSmartCard, AID foundation.NSData, instanceID string, ...) TKSmartCardToken
- type TKSmartCardTokenClass
- type TKSmartCardTokenDriver
- type TKSmartCardTokenDriverClass
- type TKSmartCardTokenDriverDelegate
- type TKSmartCardTokenDriverDelegateConfig
- type TKSmartCardTokenDriverDelegateObject
- func (o TKSmartCardTokenDriverDelegateObject) BaseObject() objectivec.Object
- func (o TKSmartCardTokenDriverDelegateObject) TokenDriverCreateTokenForSmartCardAIDError(driver ITKSmartCardTokenDriver, smartCard ITKSmartCard, AID foundation.NSData) (ITKSmartCardToken, error)
- func (o TKSmartCardTokenDriverDelegateObject) TokenDriverTerminateToken(driver ITKTokenDriver, token ITKToken)
- func (o TKSmartCardTokenDriverDelegateObject) TokenDriverTokenForConfigurationError(driver ITKTokenDriver, configuration ITKTokenConfiguration) (ITKToken, error)
- type TKSmartCardTokenSession
- type TKSmartCardTokenSessionClass
- type TKSmartCardUserInteraction
- func (t TKSmartCardUserInteraction) Autorelease() TKSmartCardUserInteraction
- func (t TKSmartCardUserInteraction) Cancel() bool
- func (t TKSmartCardUserInteraction) Delegate() TKSmartCardUserInteractionDelegate
- func (t TKSmartCardUserInteraction) Init() TKSmartCardUserInteraction
- func (t TKSmartCardUserInteraction) InitialTimeout() foundation.NSTimeInterval
- func (t TKSmartCardUserInteraction) InteractionTimeout() foundation.NSTimeInterval
- func (t TKSmartCardUserInteraction) RunWithReply(reply BoolErrorHandler)
- func (t TKSmartCardUserInteraction) RunWithReplySync(ctx context.Context) (bool, error)
- func (t TKSmartCardUserInteraction) SetDelegate(value TKSmartCardUserInteractionDelegate)
- func (t TKSmartCardUserInteraction) SetInitialTimeout(value foundation.NSTimeInterval)
- func (t TKSmartCardUserInteraction) SetInteractionTimeout(value foundation.NSTimeInterval)
- type TKSmartCardUserInteractionClass
- type TKSmartCardUserInteractionDelegate
- type TKSmartCardUserInteractionDelegateConfig
- type TKSmartCardUserInteractionDelegateObject
- func (o TKSmartCardUserInteractionDelegateObject) BaseObject() objectivec.Object
- func (o TKSmartCardUserInteractionDelegateObject) CharacterEnteredInUserInteraction(interaction ITKSmartCardUserInteraction)
- func (o TKSmartCardUserInteractionDelegateObject) CorrectionKeyPressedInUserInteraction(interaction ITKSmartCardUserInteraction)
- func (o TKSmartCardUserInteractionDelegateObject) InvalidCharacterEnteredInUserInteraction(interaction ITKSmartCardUserInteraction)
- func (o TKSmartCardUserInteractionDelegateObject) NewPINConfirmationRequestedInUserInteraction(interaction ITKSmartCardUserInteraction)
- func (o TKSmartCardUserInteractionDelegateObject) NewPINRequestedInUserInteraction(interaction ITKSmartCardUserInteraction)
- func (o TKSmartCardUserInteractionDelegateObject) OldPINRequestedInUserInteraction(interaction ITKSmartCardUserInteraction)
- func (o TKSmartCardUserInteractionDelegateObject) ValidationKeyPressedInUserInteraction(interaction ITKSmartCardUserInteraction)
- type TKSmartCardUserInteractionForPINOperation
- func (t TKSmartCardUserInteractionForPINOperation) Autorelease() TKSmartCardUserInteractionForPINOperation
- func (t TKSmartCardUserInteractionForPINOperation) Init() TKSmartCardUserInteractionForPINOperation
- func (t TKSmartCardUserInteractionForPINOperation) Locale() foundation.NSLocale
- func (t TKSmartCardUserInteractionForPINOperation) PINCompletion() TKSmartCardPINCompletion
- func (t TKSmartCardUserInteractionForPINOperation) PINMessageIndices() []foundation.NSNumber
- func (t TKSmartCardUserInteractionForPINOperation) ResultData() foundation.NSData
- func (t TKSmartCardUserInteractionForPINOperation) ResultSW() uint16
- func (t TKSmartCardUserInteractionForPINOperation) SetLocale(value foundation.NSLocale)
- func (t TKSmartCardUserInteractionForPINOperation) SetPINCompletion(value TKSmartCardPINCompletion)
- func (t TKSmartCardUserInteractionForPINOperation) SetPINMessageIndices(value []foundation.NSNumber)
- func (t TKSmartCardUserInteractionForPINOperation) SetResultData(value foundation.NSData)
- func (t TKSmartCardUserInteractionForPINOperation) SetResultSW(value uint16)
- type TKSmartCardUserInteractionForPINOperationClass
- type TKSmartCardUserInteractionForSecurePINChange
- func (t TKSmartCardUserInteractionForSecurePINChange) Autorelease() TKSmartCardUserInteractionForSecurePINChange
- func (t TKSmartCardUserInteractionForSecurePINChange) Init() TKSmartCardUserInteractionForSecurePINChange
- func (t TKSmartCardUserInteractionForSecurePINChange) PINConfirmation() TKSmartCardPINConfirmation
- func (t TKSmartCardUserInteractionForSecurePINChange) SetPINConfirmation(value TKSmartCardPINConfirmation)
- type TKSmartCardUserInteractionForSecurePINChangeClass
- type TKSmartCardUserInteractionForSecurePINVerification
- type TKSmartCardUserInteractionForSecurePINVerificationClass
- type TKTLVRecord
- type TKTLVRecordClass
- type TKTLVTag
- type TKToken
- func (t TKToken) Autorelease() TKToken
- func (t TKToken) Configuration() ITKTokenConfiguration
- func (t TKToken) Delegate() TKTokenDelegate
- func (t TKToken) Init() TKToken
- func (t TKToken) InitWithTokenDriverInstanceID(tokenDriver ITKTokenDriver, instanceID TKTokenInstanceID) TKToken
- func (t TKToken) KeychainContents() ITKTokenKeychainContents
- func (t TKToken) SetDelegate(value TKTokenDelegate)
- func (t TKToken) TokenDriver() ITKTokenDriver
- type TKTokenAuthOperation
- type TKTokenAuthOperationClass
- type TKTokenClass
- type TKTokenConfiguration
- func (t TKTokenConfiguration) Autorelease() TKTokenConfiguration
- func (t TKTokenConfiguration) CertificateForObjectIDError(objectID TKTokenObjectID) (ITKTokenKeychainCertificate, error)
- func (t TKTokenConfiguration) ConfigurationData() foundation.NSData
- func (t TKTokenConfiguration) Init() TKTokenConfiguration
- func (t TKTokenConfiguration) InstanceID() TKTokenInstanceID
- func (t TKTokenConfiguration) KeyForObjectIDError(objectID TKTokenObjectID) (ITKTokenKeychainKey, error)
- func (t TKTokenConfiguration) KeychainItems() []TKTokenKeychainItem
- func (t TKTokenConfiguration) SetConfigurationData(value foundation.NSData)
- func (t TKTokenConfiguration) SetKeychainItems(value []TKTokenKeychainItem)
- type TKTokenConfigurationClass
- type TKTokenDelegate
- type TKTokenDelegateConfig
- type TKTokenDelegateObject
- type TKTokenDriver
- type TKTokenDriverClass
- type TKTokenDriverClassID
- type TKTokenDriverConfiguration
- func (t TKTokenDriverConfiguration) AddTokenConfigurationForTokenInstanceID(instanceID TKTokenInstanceID) ITKTokenConfiguration
- func (t TKTokenDriverConfiguration) Autorelease() TKTokenDriverConfiguration
- func (t TKTokenDriverConfiguration) ClassID() TKTokenDriverClassID
- func (t TKTokenDriverConfiguration) Init() TKTokenDriverConfiguration
- func (t TKTokenDriverConfiguration) RemoveTokenConfigurationForTokenInstanceID(instanceID TKTokenInstanceID)
- func (t TKTokenDriverConfiguration) TokenConfigurations() foundation.INSDictionary
- type TKTokenDriverConfigurationClass
- type TKTokenDriverDelegate
- type TKTokenDriverDelegateConfig
- type TKTokenDriverDelegateObject
- func (o TKTokenDriverDelegateObject) BaseObject() objectivec.Object
- func (o TKTokenDriverDelegateObject) TokenDriverTerminateToken(driver ITKTokenDriver, token ITKToken)
- func (o TKTokenDriverDelegateObject) TokenDriverTokenForConfigurationError(driver ITKTokenDriver, configuration ITKTokenConfiguration) (ITKToken, error)
- type TKTokenInstanceID
- type TKTokenKeyAlgorithm
- type TKTokenKeyAlgorithmClass
- type TKTokenKeyExchangeParameters
- type TKTokenKeyExchangeParametersClass
- type TKTokenKeychainCertificate
- func NewTKTokenKeychainCertificate() TKTokenKeychainCertificate
- func NewTKTokenKeychainCertificateWithCertificateObjectID(certificateRef security.SecCertificateRef, objectID TKTokenObjectID) TKTokenKeychainCertificate
- func NewTKTokenKeychainCertificateWithObjectID(objectID TKTokenObjectID) TKTokenKeychainCertificate
- func TKTokenKeychainCertificateFromID(id objc.ID) TKTokenKeychainCertificate
- func (t TKTokenKeychainCertificate) Autorelease() TKTokenKeychainCertificate
- func (t TKTokenKeychainCertificate) Data() foundation.NSData
- func (t TKTokenKeychainCertificate) Init() TKTokenKeychainCertificate
- func (t TKTokenKeychainCertificate) InitWithCertificateObjectID(certificateRef security.SecCertificateRef, objectID TKTokenObjectID) TKTokenKeychainCertificate
- type TKTokenKeychainCertificateClass
- type TKTokenKeychainContents
- func (t TKTokenKeychainContents) Autorelease() TKTokenKeychainContents
- func (t TKTokenKeychainContents) CertificateForObjectIDError(objectID TKTokenObjectID) (ITKTokenKeychainCertificate, error)
- func (t TKTokenKeychainContents) FillWithItems(items []TKTokenKeychainItem)
- func (t TKTokenKeychainContents) Init() TKTokenKeychainContents
- func (t TKTokenKeychainContents) Items() []TKTokenKeychainItem
- func (t TKTokenKeychainContents) KeyForObjectIDError(objectID TKTokenObjectID) (ITKTokenKeychainKey, error)
- type TKTokenKeychainContentsClass
- type TKTokenKeychainItem
- func (t TKTokenKeychainItem) Autorelease() TKTokenKeychainItem
- func (t TKTokenKeychainItem) Constraints() foundation.INSDictionary
- func (t TKTokenKeychainItem) Init() TKTokenKeychainItem
- func (t TKTokenKeychainItem) InitWithObjectID(objectID TKTokenObjectID) TKTokenKeychainItem
- func (t TKTokenKeychainItem) Label() string
- func (t TKTokenKeychainItem) ObjectID() TKTokenObjectID
- func (t TKTokenKeychainItem) SetConstraints(value foundation.INSDictionary)
- func (t TKTokenKeychainItem) SetLabel(value string)
- type TKTokenKeychainItemClass
- type TKTokenKeychainKey
- func NewTKTokenKeychainKey() TKTokenKeychainKey
- func NewTKTokenKeychainKeyWithCertificateObjectID(certificateRef security.SecCertificateRef, objectID TKTokenObjectID) TKTokenKeychainKey
- func NewTKTokenKeychainKeyWithObjectID(objectID TKTokenObjectID) TKTokenKeychainKey
- func TKTokenKeychainKeyFromID(id objc.ID) TKTokenKeychainKey
- func (t TKTokenKeychainKey) ApplicationTag() foundation.NSData
- func (t TKTokenKeychainKey) Autorelease() TKTokenKeychainKey
- func (t TKTokenKeychainKey) CanDecrypt() bool
- func (t TKTokenKeychainKey) CanPerformKeyExchange() bool
- func (t TKTokenKeychainKey) CanSign() bool
- func (t TKTokenKeychainKey) Init() TKTokenKeychainKey
- func (t TKTokenKeychainKey) InitWithCertificateObjectID(certificateRef security.SecCertificateRef, objectID TKTokenObjectID) TKTokenKeychainKey
- func (t TKTokenKeychainKey) IsSuitableForLogin() bool
- func (t TKTokenKeychainKey) KeySizeInBits() int
- func (t TKTokenKeychainKey) KeyType() string
- func (t TKTokenKeychainKey) PublicKeyData() foundation.NSData
- func (t TKTokenKeychainKey) PublicKeyHash() foundation.NSData
- func (t TKTokenKeychainKey) SetApplicationTag(value foundation.NSData)
- func (t TKTokenKeychainKey) SetCanDecrypt(value bool)
- func (t TKTokenKeychainKey) SetCanPerformKeyExchange(value bool)
- func (t TKTokenKeychainKey) SetCanSign(value bool)
- func (t TKTokenKeychainKey) SetKeySizeInBits(value int)
- func (t TKTokenKeychainKey) SetKeyType(value string)
- func (t TKTokenKeychainKey) SetPublicKeyData(value foundation.NSData)
- func (t TKTokenKeychainKey) SetPublicKeyHash(value foundation.NSData)
- func (t TKTokenKeychainKey) SetSuitableForLogin(value bool)
- type TKTokenKeychainKeyClass
- type TKTokenObjectID
- type TKTokenOperation
- type TKTokenOperationConstraint
- type TKTokenPasswordAuthOperation
- type TKTokenPasswordAuthOperationClass
- type TKTokenSession
- func (t TKTokenSession) Autorelease() TKTokenSession
- func (t TKTokenSession) Delegate() TKTokenSessionDelegate
- func (t TKTokenSession) Init() TKTokenSession
- func (t TKTokenSession) InitWithToken(token ITKToken) TKTokenSession
- func (t TKTokenSession) SetDelegate(value TKTokenSessionDelegate)
- func (t TKTokenSession) Token() ITKToken
- type TKTokenSessionClass
- type TKTokenSessionDelegate
- type TKTokenSessionDelegateConfig
- type TKTokenSessionDelegateObject
- func (o TKTokenSessionDelegateObject) BaseObject() objectivec.Object
- func (o TKTokenSessionDelegateObject) TokenSessionBeginAuthForOperationConstraintError(session ITKTokenSession, operation TKTokenOperation, ...) (ITKTokenAuthOperation, error)
- func (o TKTokenSessionDelegateObject) TokenSessionDecryptDataUsingKeyAlgorithmError(session ITKTokenSession, ciphertext foundation.NSData, ...) (foundation.NSData, error)
- func (o TKTokenSessionDelegateObject) TokenSessionPerformKeyExchangeWithPublicKeyUsingKeyAlgorithmParametersError(session ITKTokenSession, otherPartyPublicKeyData foundation.NSData, ...) (foundation.NSData, error)
- func (o TKTokenSessionDelegateObject) TokenSessionSignDataUsingKeyAlgorithmError(session ITKTokenSession, dataToSign foundation.NSData, ...) (foundation.NSData, error)
- func (o TKTokenSessionDelegateObject) TokenSessionSupportsOperationUsingKeyAlgorithm(session ITKTokenSession, operation TKTokenOperation, ...) bool
- type TKTokenSmartCardPINAuthOperation
- func (t TKTokenSmartCardPINAuthOperation) APDUTemplate() foundation.NSData
- func (t TKTokenSmartCardPINAuthOperation) Autorelease() TKTokenSmartCardPINAuthOperation
- func (t TKTokenSmartCardPINAuthOperation) Init() TKTokenSmartCardPINAuthOperation
- func (t TKTokenSmartCardPINAuthOperation) PIN() string
- func (t TKTokenSmartCardPINAuthOperation) PINByteOffset() int
- func (t TKTokenSmartCardPINAuthOperation) PINFormat() ITKSmartCardPINFormat
- func (t TKTokenSmartCardPINAuthOperation) SetAPDUTemplate(value foundation.NSData)
- func (t TKTokenSmartCardPINAuthOperation) SetPIN(value string)
- func (t TKTokenSmartCardPINAuthOperation) SetPINByteOffset(value int)
- func (t TKTokenSmartCardPINAuthOperation) SetPINFormat(value ITKSmartCardPINFormat)
- func (t TKTokenSmartCardPINAuthOperation) SetSmartCard(value ITKSmartCard)
- func (t TKTokenSmartCardPINAuthOperation) SmartCard() ITKSmartCard
- type TKTokenSmartCardPINAuthOperationClass
- type TKTokenWatcher
- func (t TKTokenWatcher) AddRemovalHandlerForTokenID(removalHandler StringHandler, tokenID string)
- func (t TKTokenWatcher) Autorelease() TKTokenWatcher
- func (t TKTokenWatcher) Init() TKTokenWatcher
- func (t TKTokenWatcher) SetInsertionHandler(insertionHandler StringHandler)
- func (t TKTokenWatcher) SetInsertionHandlerSync(ctx context.Context) (*string, error)
- func (t TKTokenWatcher) TokenIDs() []string
- func (t TKTokenWatcher) TokenInfoForTokenID(tokenID string) ITKTokenWatcherTokenInfo
- type TKTokenWatcherClass
- type TKTokenWatcherTokenInfo
- type TKTokenWatcherTokenInfoClass
Constants ¶
This section is empty.
Variables ¶
var ( // TKErrorDomain is the domain for all CryptoTokenKit framework errors. // // See: https://developer.apple.com/documentation/CryptoTokenKit/TKErrorDomain TKErrorDomain string )
Functions ¶
func NewBoolErrorBlock ¶
func NewBoolErrorBlock(handler BoolErrorHandler) (objc.ID, func())
NewBoolErrorBlock wraps a Go BoolErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewDataErrorBlock ¶
func NewDataErrorBlock(handler DataErrorHandler) (objc.ID, func())
NewDataErrorBlock wraps a Go DataErrorHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewIntVoidBlock ¶
func NewIntVoidBlock(handler IntVoidHandler) (objc.ID, func())
NewIntVoidBlock wraps a Go IntVoidHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewStringBlock ¶
func NewStringBlock(handler StringHandler) (objc.ID, func())
NewStringBlock wraps a Go StringHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
func NewTKSmartCardSlotBlock ¶
func NewTKSmartCardSlotBlock(handler TKSmartCardSlotHandler) (objc.ID, func())
NewTKSmartCardSlotBlock wraps a Go TKSmartCardSlotHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
Types ¶
type BoolErrorHandler ¶
BoolErrorHandler handles success: Whether the session could be established successfully.
- success: Whether the session could be established successfully.
- error: Contains information about the error preventing the transaction from being established.
The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type DataErrorHandler ¶
type DataErrorHandler = func(*foundation.NSData, error)
DataErrorHandler handles response: The APDU response data, or `nil` if communication with the Smart Card failed.
- response: The APDU response data, or `nil` if communication with the Smart Card failed.
- error: Contains information about the the error preventing the transaction from being established.
The error can be type-asserted to *foundation.NSError for Domain, Code, and UserInfo.
Used by:
type ITKBERTLVRecord ¶
type ITKBERTLVRecord interface {
ITKTLVRecord
// Initializes a BER-TLV record with the specified tag and value.
InitWithTagValue(tag TKTLVTag, value foundation.NSData) TKBERTLVRecord
// Initializes a BER-TLV record with the specified tag and an array of TLV subrecords.
InitWithTagRecords(tag TKTLVTag, records []TKTLVRecord) TKBERTLVRecord
}
An interface definition for the TKBERTLVRecord class.
Creating TLV Records ¶
- ITKBERTLVRecord.InitWithTagValue: Initializes a BER-TLV record with the specified tag and value.
- ITKBERTLVRecord.InitWithTagRecords: Initializes a BER-TLV record with the specified tag and an array of TLV subrecords.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKBERTLVRecord
type ITKCompactTLVRecord ¶
type ITKCompactTLVRecord interface {
ITKTLVRecord
// Initializes a TLV record with the specified tag and value.
InitWithTagValue(tag uint8, value foundation.NSData) TKCompactTLVRecord
}
An interface definition for the TKCompactTLVRecord class.
Creating TLV Records ¶
- ITKCompactTLVRecord.InitWithTagValue: Initializes a TLV record with the specified tag and value.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKCompactTLVRecord
type ITKSimpleTLVRecord ¶
type ITKSimpleTLVRecord interface {
ITKTLVRecord
// Initializes a TLV record with the specified tag and value.
InitWithTagValue(tag uint8, value foundation.NSData) TKSimpleTLVRecord
}
An interface definition for the TKSimpleTLVRecord class.
Creating TLV Records ¶
- ITKSimpleTLVRecord.InitWithTagValue: Initializes a TLV record with the specified tag and value.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSimpleTLVRecord
type ITKSmartCard ¶
type ITKSmartCard interface {
objectivec.IObject
// The slot in which the Smart Card is inserted.
Slot() ITKSmartCardSlot
// Whether the Smart Card is valid and accessible from its slot.
Valid() bool
// Whether sessions established for the Smart Card should be considered sensitive. [false](<https://developer.apple.com/documentation/Swift/false>) by default.
Sensitive() bool
SetSensitive(value bool)
// User-specified information. This property is automatically set to `nil` if the Smart Card is removed or another [TKSmartCard] object begins a session.
Context() objectivec.IObject
SetContext(value objectivec.IObject)
// The protocols allowed for communication with the Smart Card. [any](<https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardProtocol/any>) by default.
AllowedProtocols() TKSmartCardProtocol
SetAllowedProtocols(value TKSmartCardProtocol)
// The protocol used for communication with the Smart Card. Returns [TKSmartCardProtocolNone](<https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardProtocol/TKSmartCardProtocolNone>) if no session is currently established.
CurrentProtocol() TKSmartCardProtocol
// Begins a session with the Smart Card.
BeginSessionWithReply(reply BoolErrorHandler)
// Transmits data in Application Protocol Data Unit (APDU) format to the Smart Card.
TransmitRequestReply(request foundation.NSData, reply DataErrorHandler)
// Completes any pending transmissions and ends the session to the Smart Card.
EndSession()
// Creates and returns a new user interaction object for secure PIN verification using the Smart Card reader facilities.
UserInteractionForSecurePINVerificationWithPINFormatAPDUPINByteOffset(PINFormat ITKSmartCardPINFormat, APDU foundation.NSData, PINByteOffset int) ITKSmartCardUserInteractionForSecurePINVerification
// Creates a new user interaction object for secure PIN change using the smart card reader facilities (typically a HW keypad).
UserInteractionForSecurePINChangeWithPINFormatAPDUCurrentPINByteOffsetNewPINByteOffset(PINFormat ITKSmartCardPINFormat, APDU foundation.NSData, currentPINByteOffset int, newPINByteOffset int) ITKSmartCardUserInteractionForSecurePINChange
// The CLA byte used for APDU transmission. `0x00` by default.
Cla() uint8
SetCla(value uint8)
// Whether to use extended length APDU.
UseExtendedLength() bool
SetUseExtendedLength(value bool)
// Whether to use command chaining of APDU with a data field longer than 255 bytes.
UseCommandChaining() bool
SetUseCommandChaining(value bool)
}
An interface definition for the TKSmartCard class.
Configuring the Smart Card ¶
- ITKSmartCard.Slot: The slot in which the Smart Card is inserted.
- ITKSmartCard.Valid: Whether the Smart Card is valid and accessible from its slot.
- ITKSmartCard.Sensitive: Whether sessions established for the Smart Card should be considered sensitive. [false](<https://developer.apple.com/documentation/Swift/false>) by default.
- ITKSmartCard.SetSensitive
- ITKSmartCard.Context: User-specified information. This property is automatically set to `nil` if the Smart Card is removed or another TKSmartCard object begins a session.
- ITKSmartCard.SetContext
Setting the Communication Protocol ¶
- ITKSmartCard.AllowedProtocols: The protocols allowed for communication with the Smart Card. [any](<https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardProtocol/any>) by default.
- ITKSmartCard.SetAllowedProtocols
- ITKSmartCard.CurrentProtocol: The protocol used for communication with the Smart Card. Returns TKSmartCardProtocolNone(<https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardProtocol/TKSmartCardProtocolNone>) if no session is currently established.
Communicating with the Smart Card ¶
- ITKSmartCard.BeginSessionWithReply: Begins a session with the Smart Card.
- ITKSmartCard.TransmitRequestReply: Transmits data in Application Protocol Data Unit (APDU) format to the Smart Card.
- ITKSmartCard.EndSession: Completes any pending transmissions and ends the session to the Smart Card.
Managing User Interaction ¶
- ITKSmartCard.UserInteractionForSecurePINVerificationWithPINFormatAPDUPINByteOffset: Creates and returns a new user interaction object for secure PIN verification using the Smart Card reader facilities.
- ITKSmartCard.UserInteractionForSecurePINChangeWithPINFormatAPDUCurrentPINByteOffsetNewPINByteOffset: Creates a new user interaction object for secure PIN change using the smart card reader facilities (typically a HW keypad).
Configuring APDU Behavior ¶
- ITKSmartCard.Cla: The CLA byte used for APDU transmission. `0x00` by default.
- ITKSmartCard.SetCla
- ITKSmartCard.UseExtendedLength: Whether to use extended length APDU.
- ITKSmartCard.SetUseExtendedLength
- ITKSmartCard.UseCommandChaining: Whether to use command chaining of APDU with a data field longer than 255 bytes.
- ITKSmartCard.SetUseCommandChaining
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCard
type ITKSmartCardATR ¶
type ITKSmartCardATR interface {
objectivec.IObject
// Initializes a [TKSmartCardATR] object from a provided data object.
InitWithBytes(bytes foundation.NSData) TKSmartCardATR
// Initializes a [TKSmartCardATR] object from a provided data source.
InitWithSource(source IntVoidHandler) TKSmartCardATR
// An array of protocols indicated in the ATR
Protocols() []foundation.NSNumber
// The ATR message data.
Bytes() foundation.NSData
// The ATR historical bytes, not including interface bytes or the TCK (check byte).
HistoricalBytes() foundation.NSData
// A list of compact TLV records parsed from historical bytes.
HistoricalRecords() []TKCompactTLVRecord
// Returns the interface group at the specified index.
InterfaceGroupAtIndex(index int) ITKSmartCardATRInterfaceGroup
// Returns the interface group with the specified protocol.
InterfaceGroupForProtocol(protocol_ TKSmartCardProtocol) ITKSmartCardATRInterfaceGroup
}
An interface definition for the TKSmartCardATR class.
Creating a Smart Card ATR ¶
- ITKSmartCardATR.InitWithBytes: Initializes a TKSmartCardATR object from a provided data object.
- ITKSmartCardATR.InitWithSource: Initializes a TKSmartCardATR object from a provided data source.
Accessing ATR Attributes ¶
- ITKSmartCardATR.Protocols: An array of protocols indicated in the ATR
- ITKSmartCardATR.Bytes: The ATR message data.
- ITKSmartCardATR.HistoricalBytes: The ATR historical bytes, not including interface bytes or the TCK (check byte).
- ITKSmartCardATR.HistoricalRecords: A list of compact TLV records parsed from historical bytes.
Retrieving Interface Groups ¶
- ITKSmartCardATR.InterfaceGroupAtIndex: Returns the interface group at the specified index.
- ITKSmartCardATR.InterfaceGroupForProtocol: Returns the interface group with the specified protocol.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardATR
type ITKSmartCardATRInterfaceGroup ¶
type ITKSmartCardATRInterfaceGroup interface {
objectivec.IObject
// The protocol for this group.
Protocol() foundation.NSNumber
// The TA interface byte of ATR group, or `nil` if TA is not present.
TA() foundation.NSNumber
// The TB interface byte of ATR group, or `nil` if TB is not present.
TB() foundation.NSNumber
// The TC interface byte of ATR group, or `nil` if TC is not present.
TC() foundation.NSNumber
}
An interface definition for the TKSmartCardATRInterfaceGroup class.
Accessing Interface Group Protocol and Bytes ¶
- ITKSmartCardATRInterfaceGroup.Protocol: The protocol for this group.
- ITKSmartCardATRInterfaceGroup.TA: The TA interface byte of ATR group, or `nil` if TA is not present.
- ITKSmartCardATRInterfaceGroup.TB: The TB interface byte of ATR group, or `nil` if TB is not present.
- ITKSmartCardATRInterfaceGroup.TC: The TC interface byte of ATR group, or `nil` if TC is not present.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardATR/InterfaceGroup
type ITKSmartCardPINFormat ¶
type ITKSmartCardPINFormat interface {
objectivec.IObject
// The format of PIN characters. [TKSmartCardPINCharsetNumeric] by default.
Charset() TKSmartCardPINCharset
SetCharset(value TKSmartCardPINCharset)
// The encoding of PIN characters. [TKSmartCardPINEncodingASCII] by default.
Encoding() TKSmartCardPINEncoding
SetEncoding(value TKSmartCardPINEncoding)
// The minimum number of characters to form a valid PIN. `4` by default.
MinPINLength() int
SetMinPINLength(value int)
// The maximum number of characters to form a valid PIN. `8` by default.
MaxPINLength() int
SetMaxPINLength(value int)
// The total length of the PIN block in bytes. `8` by default.
PINBlockByteLength() int
SetPINBlockByteLength(value int)
// The justification within the PIN block. [TKSmartCardPINJustificationLeft] by default.
PINJustification() TKSmartCardPINJustification
SetPINJustification(value TKSmartCardPINJustification)
// 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](<https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardPINFormat/pinJustification>) property value. `0` by default.
PINBitOffset() int
SetPINBitOffset(value int)
// The offset, in bits, within the PIN block to mark a location for filling in the PIN length, which is always left justified. `0` by default.
PINLengthBitOffset() int
SetPINLengthBitOffset(value int)
// The size, in bits, of the PIN length field. If set to `0`, PIN length is not written. `0` by default.
PINLengthBitSize() int
SetPINLengthBitSize(value int)
}
An interface definition for the TKSmartCardPINFormat class.
Configuring PIN Formatting ¶
- ITKSmartCardPINFormat.Charset: The format of PIN characters. TKSmartCardPINCharsetNumeric by default.
- ITKSmartCardPINFormat.SetCharset
- ITKSmartCardPINFormat.Encoding: The encoding of PIN characters. TKSmartCardPINEncodingASCII by default.
- ITKSmartCardPINFormat.SetEncoding
- ITKSmartCardPINFormat.MinPINLength: The minimum number of characters to form a valid PIN. `4` by default.
- ITKSmartCardPINFormat.SetMinPINLength
- ITKSmartCardPINFormat.MaxPINLength: The maximum number of characters to form a valid PIN. `8` by default.
- ITKSmartCardPINFormat.SetMaxPINLength
- ITKSmartCardPINFormat.PINBlockByteLength: The total length of the PIN block in bytes. `8` by default.
- ITKSmartCardPINFormat.SetPINBlockByteLength
- ITKSmartCardPINFormat.PINJustification: The justification within the PIN block. TKSmartCardPINJustificationLeft by default.
- ITKSmartCardPINFormat.SetPINJustification
- ITKSmartCardPINFormat.PINBitOffset: 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](<https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardPINFormat/pinJustification>) property value. `0` by default.
- ITKSmartCardPINFormat.SetPINBitOffset
- ITKSmartCardPINFormat.PINLengthBitOffset: The offset, in bits, within the PIN block to mark a location for filling in the PIN length, which is always left justified. `0` by default.
- ITKSmartCardPINFormat.SetPINLengthBitOffset
- ITKSmartCardPINFormat.PINLengthBitSize: The size, in bits, of the PIN length field. If set to `0`, PIN length is not written. `0` by default.
- ITKSmartCardPINFormat.SetPINLengthBitSize
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardPINFormat
type ITKSmartCardSlot ¶
type ITKSmartCardSlot interface {
objectivec.IObject
// Creates a new [TKSmartCard](<https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCard>) object representing the currently inserted Smart Card.
MakeSmartCard() ITKSmartCard
// The current state of the Smart Card reader slot.
State() TKSmartCardSlotState
// The name of the Smart Card reader slot.
Name() string
// The maximum length of input APDU (Application Protocol Data Unit) that the Smart Card reader slot is able to transfer to the Smart Card.
MaxInputLength() int
// The maximum length of output APDU (Application Protocol Data Unit) that the Smart Card reader slot is able to transfer from the Smart Card.
MaxOutputLength() int
// The ATR (Answer to Reset) of the inserted Smart Card, or `nil` if no Smart Card is inserted or the inserted Smart Card is mute.
ATR() ITKSmartCardATR
}
An interface definition for the TKSmartCardSlot class.
Instantiating Smart Cards ¶
- ITKSmartCardSlot.MakeSmartCard: Creates a new TKSmartCard(<https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCard>) object representing the currently inserted Smart Card.
Getting the Slot State ¶
- ITKSmartCardSlot.State: The current state of the Smart Card reader slot.
Getting the Slot Configuration ¶
- ITKSmartCardSlot.Name: The name of the Smart Card reader slot.
- ITKSmartCardSlot.MaxInputLength: The maximum length of input APDU (Application Protocol Data Unit) that the Smart Card reader slot is able to transfer to the Smart Card.
- ITKSmartCardSlot.MaxOutputLength: The maximum length of output APDU (Application Protocol Data Unit) that the Smart Card reader slot is able to transfer from the Smart Card.
Reading the Answer to Reset ¶
- ITKSmartCardSlot.ATR: The ATR (Answer to Reset) of the inserted Smart Card, or `nil` if no Smart Card is inserted or the inserted Smart Card is mute.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardSlot
type ITKSmartCardSlotManager ¶
type ITKSmartCardSlotManager interface {
objectivec.IObject
// A list of identifiers for all the Smart Card reader slots available to the system.
SlotNames() []string
// Asynchronously calls a block with a Smart Card reader slot for a specified name.
GetSlotWithNameReply(name string, reply TKSmartCardSlotHandler)
// Returns the Smart Card slot with a given name.
SlotNamed(name string) ITKSmartCardSlot
}
An interface definition for the TKSmartCardSlotManager class.
Accessing Smart Card Slots ¶
- ITKSmartCardSlotManager.SlotNames: A list of identifiers for all the Smart Card reader slots available to the system.
- ITKSmartCardSlotManager.GetSlotWithNameReply: Asynchronously calls a block with a Smart Card reader slot for a specified name.
- ITKSmartCardSlotManager.SlotNamed: Returns the Smart Card slot with a given name.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardSlotManager
type ITKSmartCardToken ¶
type ITKSmartCardToken interface {
ITKToken
// Initializes a smart card token with the specified smart card, application identifier, and token driver.
InitWithSmartCardAIDInstanceIDTokenDriver(smartCard ITKSmartCard, AID foundation.NSData, instanceID string, tokenDriver ITKSmartCardTokenDriver) TKSmartCardToken
// The ISO 7816-4 application identifiers of the Smart Card.
AID() foundation.NSData
}
An interface definition for the TKSmartCardToken class.
Creating Smart Card Tokens ¶
- ITKSmartCardToken.InitWithSmartCardAIDInstanceIDTokenDriver: Initializes a smart card token with the specified smart card, application identifier, and token driver.
Accessing the Application Identifier ¶
- ITKSmartCardToken.AID: The ISO 7816-4 application identifiers of the Smart Card.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardToken
type ITKSmartCardTokenDriver ¶
type ITKSmartCardTokenDriver interface {
ITKTokenDriver
}
An interface definition for the TKSmartCardTokenDriver class.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardTokenDriver
type ITKSmartCardTokenSession ¶
type ITKSmartCardTokenSession interface {
ITKTokenSession
// The smart card for the active exclusive session and selected application.
SmartCard() ITKSmartCard
GetSmartCardWithError() (ITKSmartCard, error)
}
An interface definition for the TKSmartCardTokenSession class.
Accessing the Smart Card ¶
- ITKSmartCardTokenSession.SmartCard: The smart card for the active exclusive session and selected application.
Instance Methods ¶
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardTokenSession
type ITKSmartCardUserInteraction ¶
type ITKSmartCardUserInteraction interface {
objectivec.IObject
// The delegate for observing events that occur during the user interaction.
Delegate() TKSmartCardUserInteractionDelegate
SetDelegate(value TKSmartCardUserInteractionDelegate)
// The timeout, in seconds, for initial interaction. If set to `0`, the reader-defined default timeout is used. `0` by default.
InitialTimeout() foundation.NSTimeInterval
SetInitialTimeout(value foundation.NSTimeInterval)
// The timeout, in seconds, after the first key stroke. If set to `0`, the reader-defined default timeout is used. `0` by default.
InteractionTimeout() foundation.NSTimeInterval
SetInteractionTimeout(value foundation.NSTimeInterval)
// Runs the user interaction and asynchronously receives a reply.
RunWithReply(reply BoolErrorHandler)
// Attempts to cancel an interaction started by calling [run(reply:)](<https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardUserInteraction/run(reply:)>). For certain interactions, cancellation may not be available.
Cancel() bool
}
An interface definition for the TKSmartCardUserInteraction class.
Handling User Interaction Events ¶
- ITKSmartCardUserInteraction.Delegate: The delegate for observing events that occur during the user interaction.
- ITKSmartCardUserInteraction.SetDelegate
Configuring Timeout ¶
- ITKSmartCardUserInteraction.InitialTimeout: The timeout, in seconds, for initial interaction. If set to `0`, the reader-defined default timeout is used. `0` by default.
- ITKSmartCardUserInteraction.SetInitialTimeout
- ITKSmartCardUserInteraction.InteractionTimeout: The timeout, in seconds, after the first key stroke. If set to `0`, the reader-defined default timeout is used. `0` by default.
- ITKSmartCardUserInteraction.SetInteractionTimeout
Starting and Stopping ¶
- ITKSmartCardUserInteraction.RunWithReply: Runs the user interaction and asynchronously receives a reply.
- ITKSmartCardUserInteraction.Cancel: Attempts to cancel an interaction started by calling [run(reply:)](<https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardUserInteraction/run(reply:)>). For certain interactions, cancellation may not be available.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardUserInteraction
type ITKSmartCardUserInteractionForPINOperation ¶
type ITKSmartCardUserInteractionForPINOperation interface {
ITKSmartCardUserInteraction
// The conditions under which PIN entry should be considered complete.
PINCompletion() TKSmartCardPINCompletion
SetPINCompletion(value TKSmartCardPINCompletion)
// A list of message indices referring to a predefined message table, used to specify the type and number of messages displayed during the PIN operation. `nil` by default.
PINMessageIndices() []foundation.NSNumber
SetPINMessageIndices(value []foundation.NSNumber)
// The locale for the displayed messages. If `nil`, the user’s current locale is used. By default, this value is the current locale of the system.
Locale() foundation.NSLocale
SetLocale(value foundation.NSLocale)
// The SW1-SW2 status bytes.
ResultSW() uint16
SetResultSW(value uint16)
// The returned data without SW1-SW2 bytes, if any.
ResultData() foundation.NSData
SetResultData(value foundation.NSData)
}
An interface definition for the TKSmartCardUserInteractionForPINOperation class.
Managing Pin Completion ¶
- ITKSmartCardUserInteractionForPINOperation.PINCompletion: The conditions under which PIN entry should be considered complete.
- ITKSmartCardUserInteractionForPINOperation.SetPINCompletion
Configuring Messages ¶
- ITKSmartCardUserInteractionForPINOperation.PINMessageIndices: A list of message indices referring to a predefined message table, used to specify the type and number of messages displayed during the PIN operation. `nil` by default.
- ITKSmartCardUserInteractionForPINOperation.SetPINMessageIndices
- ITKSmartCardUserInteractionForPINOperation.Locale: The locale for the displayed messages. If `nil`, the user’s current locale is used. By default, this value is the current locale of the system.
- ITKSmartCardUserInteractionForPINOperation.SetLocale
Accessing Response Data ¶
- ITKSmartCardUserInteractionForPINOperation.ResultSW: The SW1-SW2 status bytes.
- ITKSmartCardUserInteractionForPINOperation.SetResultSW
- ITKSmartCardUserInteractionForPINOperation.ResultData: The returned data without SW1-SW2 bytes, if any.
- ITKSmartCardUserInteractionForPINOperation.SetResultData
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardUserInteractionForPINOperation
type ITKSmartCardUserInteractionForSecurePINChange ¶
type ITKSmartCardUserInteractionForSecurePINChange interface {
ITKSmartCardUserInteractionForPINOperation
// The way PIN confirmation is requested. [TKSmartCardPINConfirmationNone] by default.
PINConfirmation() TKSmartCardPINConfirmation
SetPINConfirmation(value TKSmartCardPINConfirmation)
}
An interface definition for the TKSmartCardUserInteractionForSecurePINChange class.
Configuring User Interaction ¶
- ITKSmartCardUserInteractionForSecurePINChange.PINConfirmation: The way PIN confirmation is requested. TKSmartCardPINConfirmationNone by default.
- ITKSmartCardUserInteractionForSecurePINChange.SetPINConfirmation
type ITKSmartCardUserInteractionForSecurePINVerification ¶
type ITKSmartCardUserInteractionForSecurePINVerification interface {
ITKSmartCardUserInteractionForPINOperation
}
An interface definition for the TKSmartCardUserInteractionForSecurePINVerification class.
type ITKTLVRecord ¶
type ITKTLVRecord interface {
objectivec.IObject
// The tag field of the record.
Tag() TKTLVTag
// The value field of the record.
Value() foundation.NSData
// The record data, including the tag, length, and value fields.
Data() foundation.NSData
}
An interface definition for the TKTLVRecord class.
Accessing the Tag Field ¶
- ITKTLVRecord.Tag: The tag field of the record.
Accessing the Value Field ¶
- ITKTLVRecord.Value: The value field of the record.
Accessing Record Data ¶
- ITKTLVRecord.Data: The record data, including the tag, length, and value fields.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTLVRecord
type ITKToken ¶
type ITKToken interface {
objectivec.IObject
// Initializes a token with the driver you specify.
InitWithTokenDriverInstanceID(tokenDriver ITKTokenDriver, instanceID TKTokenInstanceID) TKToken
// The token delegate.
Delegate() TKTokenDelegate
SetDelegate(value TKTokenDelegate)
// The token driver.
TokenDriver() ITKTokenDriver
// The contents of the keychain for this token.
KeychainContents() ITKTokenKeychainContents
// The current configuration for a token.
Configuration() ITKTokenConfiguration
}
An interface definition for the TKToken class.
Creating Tokens ¶
- ITKToken.InitWithTokenDriverInstanceID: Initializes a token with the driver you specify.
Responding to Session Creation ¶
- ITKToken.Delegate: The token delegate.
- ITKToken.SetDelegate
Accessing the Driver ¶
- ITKToken.TokenDriver: The token driver.
Accessing Keychain Items ¶
- ITKToken.KeychainContents: The contents of the keychain for this token.
Configuring the Token ¶
- ITKToken.Configuration: The current configuration for a token.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKToken
type ITKTokenAuthOperation ¶
type ITKTokenAuthOperation interface {
objectivec.IObject
// Finishes the authentication operation.
FinishWithError() (bool, error)
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the TKTokenAuthOperation class.
Finishing the Operation ¶
- ITKTokenAuthOperation.FinishWithError: Finishes the authentication operation.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenAuthOperation
type ITKTokenConfiguration ¶
type ITKTokenConfiguration interface {
objectivec.IObject
// The unique, persistent identifier of this token that the token implementation creates.
InstanceID() TKTokenInstanceID
// Additional configuration information for the token instance.
ConfigurationData() foundation.NSData
SetConfigurationData(value foundation.NSData)
// The keychain items associated with this token.
KeychainItems() []TKTokenKeychainItem
SetKeychainItems(value []TKTokenKeychainItem)
// Returns a certificate from the keychain with the object identifier you specify.
CertificateForObjectIDError(objectID TKTokenObjectID) (ITKTokenKeychainCertificate, error)
// Returns a key from the keychain with the object identifier you specify.
KeyForObjectIDError(objectID TKTokenObjectID) (ITKTokenKeychainKey, error)
}
An interface definition for the TKTokenConfiguration class.
Reporting Configuration Information ¶
- ITKTokenConfiguration.InstanceID: The unique, persistent identifier of this token that the token implementation creates.
- ITKTokenConfiguration.ConfigurationData: Additional configuration information for the token instance.
- ITKTokenConfiguration.SetConfigurationData
Retrieving Keys and Certificates ¶
- ITKTokenConfiguration.KeychainItems: The keychain items associated with this token.
- ITKTokenConfiguration.SetKeychainItems
- ITKTokenConfiguration.CertificateForObjectIDError: Returns a certificate from the keychain with the object identifier you specify.
- ITKTokenConfiguration.KeyForObjectIDError: Returns a key from the keychain with the object identifier you specify.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKToken/Configuration-swift.class
type ITKTokenDriver ¶
type ITKTokenDriver interface {
objectivec.IObject
// The token driver delegate.
Delegate() TKTokenDriverDelegate
SetDelegate(value TKTokenDriverDelegate)
}
An interface definition for the TKTokenDriver class.
Responding to Token Creation ¶
- ITKTokenDriver.Delegate: The token driver delegate.
- ITKTokenDriver.SetDelegate
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenDriver
type ITKTokenDriverConfiguration ¶
type ITKTokenDriverConfiguration interface {
objectivec.IObject
// The class identifier of the token driver.
ClassID() TKTokenDriverClassID
// A dictionary of all currently configured tokens for this token class, which the token instance identifier keys.
TokenConfigurations() foundation.INSDictionary
// Creates a configuration object for a token with the token instance identifier you specify.
AddTokenConfigurationForTokenInstanceID(instanceID TKTokenInstanceID) ITKTokenConfiguration
// Removes a configuration for a token with the token instance identifier you specify.
RemoveTokenConfigurationForTokenInstanceID(instanceID TKTokenInstanceID)
}
An interface definition for the TKTokenDriverConfiguration class.
Reporting Configuration Information ¶
- ITKTokenDriverConfiguration.ClassID: The class identifier of the token driver.
- ITKTokenDriverConfiguration.TokenConfigurations: A dictionary of all currently configured tokens for this token class, which the token instance identifier keys.
Adding and Removing Configurations ¶
- ITKTokenDriverConfiguration.AddTokenConfigurationForTokenInstanceID: Creates a configuration object for a token with the token instance identifier you specify.
- ITKTokenDriverConfiguration.RemoveTokenConfigurationForTokenInstanceID: Removes a configuration for a token with the token instance identifier you specify.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenDriver/Configuration
type ITKTokenKeyAlgorithm ¶
type ITKTokenKeyAlgorithm interface {
objectivec.IObject
// Returns whether the specified algorithm is the target operation algorithm.
IsAlgorithm(algorithm corefoundation.CFStringRef) bool
// Whether the specified algorithm is the target operation algorithm, or one of the other algorithms used.
SupportsAlgorithm(algorithm corefoundation.CFStringRef) bool
}
An interface definition for the TKTokenKeyAlgorithm class.
Determining Algorithm Usage ¶
- ITKTokenKeyAlgorithm.IsAlgorithm: Returns whether the specified algorithm is the target operation algorithm.
- ITKTokenKeyAlgorithm.SupportsAlgorithm: Whether the specified algorithm is the target operation algorithm, or one of the other algorithms used.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeyAlgorithm
type ITKTokenKeyExchangeParameters ¶
type ITKTokenKeyExchangeParameters interface {
objectivec.IObject
// Returns the requested output size, in bytes, of key exchange result.
RequestedSize() int
SharedInfo() foundation.NSData
}
An interface definition for the TKTokenKeyExchangeParameters class.
Accessing Parameters ¶
- ITKTokenKeyExchangeParameters.RequestedSize: Returns the requested output size, in bytes, of key exchange result.
- ITKTokenKeyExchangeParameters.SharedInfo: Returns shared information typically used during the key derivation (KDF) step of a key exchange algorithm.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeyExchangeParameters
type ITKTokenKeychainCertificate ¶
type ITKTokenKeychainCertificate interface {
ITKTokenKeychainItem
// Initializes a token keychain certificate with data from the specified certificate reference and a given object ID.
InitWithCertificateObjectID(certificateRef security.SecCertificateRef, objectID TKTokenObjectID) TKTokenKeychainCertificate
// Returns a DER-encoded representation of an X.509 certificate.
Data() foundation.NSData
}
An interface definition for the TKTokenKeychainCertificate class.
Creating Token Keychain Certificates ¶
- ITKTokenKeychainCertificate.InitWithCertificateObjectID: Initializes a token keychain certificate with data from the specified certificate reference and a given object ID.
Accessing Certificate Data ¶
- ITKTokenKeychainCertificate.Data: Returns a DER-encoded representation of an X.509 certificate.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainCertificate
type ITKTokenKeychainContents ¶
type ITKTokenKeychainContents interface {
objectivec.IObject
// Fills the keychain with the specified items.
FillWithItems(items []TKTokenKeychainItem)
// Returns all items for token in the keychain.
Items() []TKTokenKeychainItem
// Returns the key for a specified object identifier.
KeyForObjectIDError(objectID TKTokenObjectID) (ITKTokenKeychainKey, error)
// Returns the key for a specified object identifier.
CertificateForObjectIDError(objectID TKTokenObjectID) (ITKTokenKeychainCertificate, error)
}
An interface definition for the TKTokenKeychainContents class.
Adding Keychain Items ¶
- ITKTokenKeychainContents.FillWithItems: Fills the keychain with the specified items.
Accessing Keychain Items ¶
- ITKTokenKeychainContents.Items: Returns all items for token in the keychain.
- ITKTokenKeychainContents.KeyForObjectIDError: Returns the key for a specified object identifier.
- ITKTokenKeychainContents.CertificateForObjectIDError: Returns the key for a specified object identifier.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainContents
type ITKTokenKeychainItem ¶
type ITKTokenKeychainItem interface {
objectivec.IObject
// Initializes a token keychain item with the specified object ID.
InitWithObjectID(objectID TKTokenObjectID) TKTokenKeychainItem
// Returns the object ID used for keychain item identification.
ObjectID() TKTokenObjectID
// The user-visible label for the keychain item.
Label() string
SetLabel(value string)
// Access constraints for the keychain item, keyed by [TKTokenOperation](<https://developer.apple.com/documentation/CryptoTokenKit/TKTokenOperation>) values wrapped in [NSNumber](<https://developer.apple.com/documentation/Foundation/NSNumber>) objects.
Constraints() foundation.INSDictionary
SetConstraints(value foundation.INSDictionary)
}
An interface definition for the TKTokenKeychainItem class.
Creating Token Keychain Items ¶
- ITKTokenKeychainItem.InitWithObjectID: Initializes a token keychain item with the specified object ID.
Accessing Keychain Item Attributes ¶
- ITKTokenKeychainItem.ObjectID: Returns the object ID used for keychain item identification.
- ITKTokenKeychainItem.Label: The user-visible label for the keychain item.
- ITKTokenKeychainItem.SetLabel
- ITKTokenKeychainItem.Constraints: Access constraints for the keychain item, keyed by TKTokenOperation(<https://developer.apple.com/documentation/CryptoTokenKit/TKTokenOperation>) values wrapped in [NSNumber](<https://developer.apple.com/documentation/Foundation/NSNumber>) objects.
- ITKTokenKeychainItem.SetConstraints
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainItem
type ITKTokenKeychainKey ¶
type ITKTokenKeychainKey interface {
ITKTokenKeychainItem
// Initializes a token keychain key with data from the specified certificate reference and a given object ID.
InitWithCertificateObjectID(certificateRef security.SecCertificateRef, objectID TKTokenObjectID) TKTokenKeychainKey
// The type of the key. Currently, only [kSecAttrKeyTypeRSA](<https://developer.apple.com/documentation/Security/kSecAttrKeyTypeRSA>) and `kSecAttrKeyTypeECSECPrimeRandom` are supported values.
KeyType() string
SetKeyType(value string)
KeySizeInBits() int
SetKeySizeInBits(value int)
// The private tag data.
ApplicationTag() foundation.NSData
SetApplicationTag(value foundation.NSData)
// The public key data.
PublicKeyData() foundation.NSData
SetPublicKeyData(value foundation.NSData)
// The SHA1 hash of the raw public key.
PublicKeyHash() foundation.NSData
SetPublicKeyHash(value foundation.NSData)
// Whether the key can be used to decrypt data.
CanDecrypt() bool
SetCanDecrypt(value bool)
// Whether the key can be used to sign data.
CanSign() bool
SetCanSign(value bool)
// Whether the key can be used to perform Diffie-Hellman style cryptographic key exchange.
CanPerformKeyExchange() bool
SetCanPerformKeyExchange(value bool)
// Whether the key can be used for system login.
IsSuitableForLogin() bool
SetSuitableForLogin(value bool)
}
An interface definition for the TKTokenKeychainKey class.
Creating Token Keychain Keys ¶
- ITKTokenKeychainKey.InitWithCertificateObjectID: Initializes a token keychain key with data from the specified certificate reference and a given object ID.
Accessing Key Attributes ¶
- ITKTokenKeychainKey.KeyType: The type of the key. Currently, only [kSecAttrKeyTypeRSA](<https://developer.apple.com/documentation/Security/kSecAttrKeyTypeRSA>) and `kSecAttrKeyTypeECSECPrimeRandom` are supported values.
- ITKTokenKeychainKey.SetKeyType
- ITKTokenKeychainKey.KeySizeInBits
- ITKTokenKeychainKey.SetKeySizeInBits
- ITKTokenKeychainKey.ApplicationTag: The private tag data.
- ITKTokenKeychainKey.SetApplicationTag
- ITKTokenKeychainKey.PublicKeyData: The public key data.
- ITKTokenKeychainKey.SetPublicKeyData
- ITKTokenKeychainKey.PublicKeyHash: The SHA1 hash of the raw public key.
- ITKTokenKeychainKey.SetPublicKeyHash
- ITKTokenKeychainKey.CanDecrypt: Whether the key can be used to decrypt data.
- ITKTokenKeychainKey.SetCanDecrypt
- ITKTokenKeychainKey.CanSign: Whether the key can be used to sign data.
- ITKTokenKeychainKey.SetCanSign
- ITKTokenKeychainKey.CanPerformKeyExchange: Whether the key can be used to perform Diffie-Hellman style cryptographic key exchange.
- ITKTokenKeychainKey.SetCanPerformKeyExchange
- ITKTokenKeychainKey.IsSuitableForLogin: Whether the key can be used for system login.
- ITKTokenKeychainKey.SetSuitableForLogin
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainKey
type ITKTokenPasswordAuthOperation ¶
type ITKTokenPasswordAuthOperation interface {
ITKTokenAuthOperation
// The password to be filled in when the “ is called.
Password() string
SetPassword(value string)
}
An interface definition for the TKTokenPasswordAuthOperation class.
Managing the Password ¶
- ITKTokenPasswordAuthOperation.Password: The password to be filled in when the “ is called.
- ITKTokenPasswordAuthOperation.SetPassword
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenPasswordAuthOperation
type ITKTokenSession ¶
type ITKTokenSession interface {
objectivec.IObject
// Initializes a token session with the specified token.
InitWithToken(token ITKToken) TKTokenSession
// The token session delegate.
Delegate() TKTokenSessionDelegate
SetDelegate(value TKTokenSessionDelegate)
// The token to which the session is bound.
Token() ITKToken
}
An interface definition for the TKTokenSession class.
Creating Token Sessions ¶
- ITKTokenSession.InitWithToken: Initializes a token session with the specified token.
Responding to Authentication Events ¶
- ITKTokenSession.Delegate: The token session delegate.
- ITKTokenSession.SetDelegate
Accessing the Token ¶
- ITKTokenSession.Token: The token to which the session is bound.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenSession
type ITKTokenSmartCardPINAuthOperation ¶
type ITKTokenSmartCardPINAuthOperation interface {
ITKTokenAuthOperation
// The PIN format.
PINFormat() ITKSmartCardPINFormat
SetPINFormat(value ITKSmartCardPINFormat)
// The template into which the PIN is filled in. `nil` by default.
APDUTemplate() foundation.NSData
SetAPDUTemplate(value foundation.NSData)
// The offset, in bytes, within the APDU template to mark the location for filling in the PIN.
PINByteOffset() int
SetPINByteOffset(value int)
// A Smart Card to which the formatted APDU is sent in order to authenticate.
SmartCard() ITKSmartCard
SetSmartCard(value ITKSmartCard)
// The PIN value resulting from performing the operation.
PIN() string
SetPIN(value string)
}
An interface definition for the TKTokenSmartCardPINAuthOperation class.
Configuring the Operation ¶
- ITKTokenSmartCardPINAuthOperation.PINFormat: The PIN format.
- ITKTokenSmartCardPINAuthOperation.SetPINFormat
- ITKTokenSmartCardPINAuthOperation.APDUTemplate: The template into which the PIN is filled in. `nil` by default.
- ITKTokenSmartCardPINAuthOperation.SetAPDUTemplate
- ITKTokenSmartCardPINAuthOperation.PINByteOffset: The offset, in bytes, within the APDU template to mark the location for filling in the PIN.
- ITKTokenSmartCardPINAuthOperation.SetPINByteOffset
- ITKTokenSmartCardPINAuthOperation.SmartCard: A Smart Card to which the formatted APDU is sent in order to authenticate.
- ITKTokenSmartCardPINAuthOperation.SetSmartCard
Accessing the PIN ¶
- ITKTokenSmartCardPINAuthOperation.PIN: The PIN value resulting from performing the operation.
- ITKTokenSmartCardPINAuthOperation.SetPIN
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenSmartCardPINAuthOperation
type ITKTokenWatcher ¶
type ITKTokenWatcher interface {
objectivec.IObject
// The token IDs currently available in the system.
TokenIDs() []string
// Adds a removal handler for the specified token ID.
AddRemovalHandlerForTokenID(removalHandler StringHandler, tokenID string)
// Sets an insertion handler closure to be called when a new token is inserted into the system.
SetInsertionHandler(insertionHandler StringHandler)
TokenInfoForTokenID(tokenID string) ITKTokenWatcherTokenInfo
}
An interface definition for the TKTokenWatcher class.
Accessing Token Identifiers ¶
- ITKTokenWatcher.TokenIDs: The token IDs currently available in the system.
Configuring Handlers ¶
- ITKTokenWatcher.AddRemovalHandlerForTokenID: Adds a removal handler for the specified token ID.
- ITKTokenWatcher.SetInsertionHandler: Sets an insertion handler closure to be called when a new token is inserted into the system.
Instance Methods ¶
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenWatcher
type ITKTokenWatcherTokenInfo ¶
type ITKTokenWatcherTokenInfo interface {
objectivec.IObject
DriverName() string
SlotName() string
TokenID() string
}
An interface definition for the TKTokenWatcherTokenInfo class.
Instance Properties ¶
- ITKTokenWatcherTokenInfo.DriverName
- ITKTokenWatcherTokenInfo.SlotName
- ITKTokenWatcherTokenInfo.TokenID
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenWatcher/TokenInfo
type IntVoidHandler ¶
type IntVoidHandler = func() int
IntVoidHandler handles The block providing a stream of data for an ATR.
Used by:
type StringHandler ¶
type StringHandler = func(*string)
StringHandler handles A block to be called when the specified token is removed.
- tokenID: The identifier of the removed token.
Used by:
type TKBERTLVRecord ¶
type TKBERTLVRecord struct {
TKTLVRecord
}
An object that parses BER-encoded data and produces DER-encoded data for TLV records.
Creating TLV Records ¶
- TKBERTLVRecord.InitWithTagValue: Initializes a BER-TLV record with the specified tag and value.
- TKBERTLVRecord.InitWithTagRecords: Initializes a BER-TLV record with the specified tag and an array of TLV subrecords.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKBERTLVRecord
func NewTKBERTLVRecord ¶
func NewTKBERTLVRecord() TKBERTLVRecord
NewTKBERTLVRecord creates a new TKBERTLVRecord instance.
func NewTKBERTLVRecordFromData ¶
func NewTKBERTLVRecordFromData(data foundation.NSData) TKBERTLVRecord
Creates and returns a TLV record from by parsing the specified data.
data: A data object containing the serialized representation of a TLV record.
Return Value ¶
A TLV record, or `nil` if `data` does not specify a valid record.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTLVRecord/init(from:)
func NewTKBERTLVRecordWithTagRecords ¶
func NewTKBERTLVRecordWithTagRecords(tag TKTLVTag, records []TKTLVRecord) TKBERTLVRecord
Initializes a BER-TLV record with the specified tag and an array of TLV subrecords.
tag: The tag field of the record.
records: The TLV subrecords of the record.
Return Value ¶
A new TLV record containing the specified tag field and subrecords.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKBERTLVRecord/init(tag:records:)
func NewTKBERTLVRecordWithTagValue ¶
func NewTKBERTLVRecordWithTagValue(tag TKTLVTag, value foundation.NSData) TKBERTLVRecord
Initializes a BER-TLV record with the specified tag and value.
tag: The tag field of the record.
value: The value field of the record.
Return Value ¶
A new TLV record containing the specified tag and value fields.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKBERTLVRecord/init(tag:value:)
func TKBERTLVRecordFromID ¶
func TKBERTLVRecordFromID(id objc.ID) TKBERTLVRecord
TKBERTLVRecordFromID constructs a TKBERTLVRecord from an objc.ID.
An object that parses BER-encoded data and produces DER-encoded data for TLV records.
func (TKBERTLVRecord) Autorelease ¶
func (t TKBERTLVRecord) Autorelease() TKBERTLVRecord
Autorelease adds the receiver to the current autorelease pool.
func (TKBERTLVRecord) Init ¶
func (t TKBERTLVRecord) Init() TKBERTLVRecord
Init initializes the instance.
func (TKBERTLVRecord) InitWithTagRecords ¶
func (t TKBERTLVRecord) InitWithTagRecords(tag TKTLVTag, records []TKTLVRecord) TKBERTLVRecord
Initializes a BER-TLV record with the specified tag and an array of TLV subrecords.
tag: The tag field of the record.
records: The TLV subrecords of the record.
Return Value ¶
A new TLV record containing the specified tag field and subrecords.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKBERTLVRecord/init(tag:records:)
func (TKBERTLVRecord) InitWithTagValue ¶
func (t TKBERTLVRecord) InitWithTagValue(tag TKTLVTag, value foundation.NSData) TKBERTLVRecord
Initializes a BER-TLV record with the specified tag and value.
tag: The tag field of the record.
value: The value field of the record.
Return Value ¶
A new TLV record containing the specified tag and value fields.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKBERTLVRecord/init(tag:value:)
type TKBERTLVRecordClass ¶
type TKBERTLVRecordClass struct {
// contains filtered or unexported fields
}
func GetTKBERTLVRecordClass ¶
func GetTKBERTLVRecordClass() TKBERTLVRecordClass
GetTKBERTLVRecordClass returns the class object for TKBERTLVRecord.
func (TKBERTLVRecordClass) Alloc ¶
func (tc TKBERTLVRecordClass) Alloc() TKBERTLVRecord
Alloc allocates memory for a new instance of the class.
func (TKBERTLVRecordClass) Class ¶
func (tc TKBERTLVRecordClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (TKBERTLVRecordClass) DataForTag ¶
func (_TKBERTLVRecordClass TKBERTLVRecordClass) DataForTag(tag TKTLVTag) foundation.NSData
Encodes a specified tag using BER-TLV tag encoding rules.
tag: The tag value to encode.
Return Value ¶
A data object that encodes a tag value using BER-TLV encoding.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKBERTLVRecord/data(forTag:)
type TKCompactTLVRecord ¶
type TKCompactTLVRecord struct {
TKTLVRecord
}
An object that implements encoding using Compact-TLV encoding according to ISO 7816-4.
Creating TLV Records ¶
- TKCompactTLVRecord.InitWithTagValue: Initializes a TLV record with the specified tag and value.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKCompactTLVRecord
func NewTKCompactTLVRecord ¶
func NewTKCompactTLVRecord() TKCompactTLVRecord
NewTKCompactTLVRecord creates a new TKCompactTLVRecord instance.
func NewTKCompactTLVRecordFromData ¶
func NewTKCompactTLVRecordFromData(data foundation.NSData) TKCompactTLVRecord
Creates and returns a TLV record from by parsing the specified data.
data: A data object containing the serialized representation of a TLV record.
Return Value ¶
A TLV record, or `nil` if `data` does not specify a valid record.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTLVRecord/init(from:)
func NewTKCompactTLVRecordWithTagValue ¶
func NewTKCompactTLVRecordWithTagValue(tag uint8, value foundation.NSData) TKCompactTLVRecord
Initializes a TLV record with the specified tag and value.
tag: The tag field of the record.
value: The value field of the record.
Return Value ¶
A new TLV record containing the specified tag and value fields.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKCompactTLVRecord/init(tag:value:)
func TKCompactTLVRecordFromID ¶
func TKCompactTLVRecordFromID(id objc.ID) TKCompactTLVRecord
TKCompactTLVRecordFromID constructs a TKCompactTLVRecord from an objc.ID.
An object that implements encoding using Compact-TLV encoding according to ISO 7816-4.
func (TKCompactTLVRecord) Autorelease ¶
func (t TKCompactTLVRecord) Autorelease() TKCompactTLVRecord
Autorelease adds the receiver to the current autorelease pool.
func (TKCompactTLVRecord) Init ¶
func (t TKCompactTLVRecord) Init() TKCompactTLVRecord
Init initializes the instance.
func (TKCompactTLVRecord) InitWithTagValue ¶
func (t TKCompactTLVRecord) InitWithTagValue(tag uint8, value foundation.NSData) TKCompactTLVRecord
Initializes a TLV record with the specified tag and value.
tag: The tag field of the record.
value: The value field of the record.
Return Value ¶
A new TLV record containing the specified tag and value fields.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKCompactTLVRecord/init(tag:value:)
type TKCompactTLVRecordClass ¶
type TKCompactTLVRecordClass struct {
// contains filtered or unexported fields
}
func GetTKCompactTLVRecordClass ¶
func GetTKCompactTLVRecordClass() TKCompactTLVRecordClass
GetTKCompactTLVRecordClass returns the class object for TKCompactTLVRecord.
func (TKCompactTLVRecordClass) Alloc ¶
func (tc TKCompactTLVRecordClass) Alloc() TKCompactTLVRecord
Alloc allocates memory for a new instance of the class.
func (TKCompactTLVRecordClass) Class ¶
func (tc TKCompactTLVRecordClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKErrorCode ¶
type TKErrorCode int
See: https://developer.apple.com/documentation/CryptoTokenKit/TKError/Code
const ( TKErrorAuthenticationFailed TKErrorCode = -5 // TKErrorCodeAuthenticationFailed: Authentication failed. TKErrorCodeAuthenticationFailed TKErrorCode = -5 // TKErrorCodeAuthenticationNeeded: Authentication is needed. TKErrorCodeAuthenticationNeeded TKErrorCode = -9 // TKErrorCodeBadParameter: An invalid parameter was provided. TKErrorCodeBadParameter TKErrorCode = -8 // TKErrorCodeCanceledByUser: The operation was canceled by the user. TKErrorCodeCanceledByUser TKErrorCode = -4 // TKErrorCodeCommunicationError: A communication error occurred. TKErrorCodeCommunicationError TKErrorCode = -2 // TKErrorCodeCorruptedData: The data was corrupted. TKErrorCodeCorruptedData TKErrorCode = -3 // TKErrorCodeNotImplemented: The functionality is not implemented. TKErrorCodeNotImplemented TKErrorCode = -1 // TKErrorCodeObjectNotFound: The object was not found. TKErrorCodeObjectNotFound TKErrorCode = -6 // TKErrorCodeTokenNotFound: The token was not found. TKErrorCodeTokenNotFound TKErrorCode = -7 TKErrorObjectNotFound TKErrorCode = -6 TKErrorTokenNotFound TKErrorCode = -7 )
func (TKErrorCode) String ¶
func (e TKErrorCode) String() string
type TKSimpleTLVRecord ¶
type TKSimpleTLVRecord struct {
TKTLVRecord
}
An object that implements encoding using Simple-TLV encoding according to ISO 7816-4.
Creating TLV Records ¶
- TKSimpleTLVRecord.InitWithTagValue: Initializes a TLV record with the specified tag and value.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSimpleTLVRecord
func NewTKSimpleTLVRecord ¶
func NewTKSimpleTLVRecord() TKSimpleTLVRecord
NewTKSimpleTLVRecord creates a new TKSimpleTLVRecord instance.
func NewTKSimpleTLVRecordFromData ¶
func NewTKSimpleTLVRecordFromData(data foundation.NSData) TKSimpleTLVRecord
Creates and returns a TLV record from by parsing the specified data.
data: A data object containing the serialized representation of a TLV record.
Return Value ¶
A TLV record, or `nil` if `data` does not specify a valid record.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTLVRecord/init(from:)
func NewTKSimpleTLVRecordWithTagValue ¶
func NewTKSimpleTLVRecordWithTagValue(tag uint8, value foundation.NSData) TKSimpleTLVRecord
Initializes a TLV record with the specified tag and value.
tag: The tag field of the record.
value: The value field of the record.
Return Value ¶
A new TLV record containing the specified tag and value fields.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSimpleTLVRecord/init(tag:value:)
func TKSimpleTLVRecordFromID ¶
func TKSimpleTLVRecordFromID(id objc.ID) TKSimpleTLVRecord
TKSimpleTLVRecordFromID constructs a TKSimpleTLVRecord from an objc.ID.
An object that implements encoding using Simple-TLV encoding according to ISO 7816-4.
func (TKSimpleTLVRecord) Autorelease ¶
func (t TKSimpleTLVRecord) Autorelease() TKSimpleTLVRecord
Autorelease adds the receiver to the current autorelease pool.
func (TKSimpleTLVRecord) Init ¶
func (t TKSimpleTLVRecord) Init() TKSimpleTLVRecord
Init initializes the instance.
func (TKSimpleTLVRecord) InitWithTagValue ¶
func (t TKSimpleTLVRecord) InitWithTagValue(tag uint8, value foundation.NSData) TKSimpleTLVRecord
Initializes a TLV record with the specified tag and value.
tag: The tag field of the record.
value: The value field of the record.
Return Value ¶
A new TLV record containing the specified tag and value fields.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSimpleTLVRecord/init(tag:value:)
type TKSimpleTLVRecordClass ¶
type TKSimpleTLVRecordClass struct {
// contains filtered or unexported fields
}
func GetTKSimpleTLVRecordClass ¶
func GetTKSimpleTLVRecordClass() TKSimpleTLVRecordClass
GetTKSimpleTLVRecordClass returns the class object for TKSimpleTLVRecord.
func (TKSimpleTLVRecordClass) Alloc ¶
func (tc TKSimpleTLVRecordClass) Alloc() TKSimpleTLVRecord
Alloc allocates memory for a new instance of the class.
func (TKSimpleTLVRecordClass) Class ¶
func (tc TKSimpleTLVRecordClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKSmartCard ¶
type TKSmartCard struct {
objectivec.Object
}
A representation of a smart card.
Overview ¶
This class provides an interface for managing sessions with a smart card, transmitting requests, and facilitating user interaction.
You can create a TKSmartCard object when a smart card is inserted into a slot, by calling the [TKSmartCardSlot.SmartCard] method on the corresponding TKSmartCardSlot object. To start communicating with the smart card, call the TKSmartCard.BeginSessionWithReply method on the TKSmartCard object. Once an exclusive session has been established, you transmit data using the TKSmartCard.TransmitRequestReply method. After you’ve finished communicating with a smart card, you call the TKSmartCard.EndSession method.
If the smart card is physically removed from its slot, the session object becomes invalid, and any further calls to TKSmartCard.TransmitRequestReply will return an error. You can use Key-Value Observing on the TKSmartCard.Valid property to be notified when a smart card is invalidated, due to being removed from the slot or another reason.
Configuring the Smart Card ¶
- TKSmartCard.Slot: The slot in which the Smart Card is inserted.
- TKSmartCard.Valid: Whether the Smart Card is valid and accessible from its slot.
- TKSmartCard.Sensitive: Whether sessions established for the Smart Card should be considered sensitive. [false](<https://developer.apple.com/documentation/Swift/false>) by default.
- TKSmartCard.SetSensitive
- TKSmartCard.Context: User-specified information. This property is automatically set to `nil` if the Smart Card is removed or another TKSmartCard object begins a session.
- TKSmartCard.SetContext
Setting the Communication Protocol ¶
- TKSmartCard.AllowedProtocols: The protocols allowed for communication with the Smart Card. [any](<https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardProtocol/any>) by default.
- TKSmartCard.SetAllowedProtocols
- TKSmartCard.CurrentProtocol: The protocol used for communication with the Smart Card. Returns TKSmartCardProtocolNone(<https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardProtocol/TKSmartCardProtocolNone>) if no session is currently established.
Communicating with the Smart Card ¶
- TKSmartCard.BeginSessionWithReply: Begins a session with the Smart Card.
- TKSmartCard.TransmitRequestReply: Transmits data in Application Protocol Data Unit (APDU) format to the Smart Card.
- TKSmartCard.EndSession: Completes any pending transmissions and ends the session to the Smart Card.
Managing User Interaction ¶
- TKSmartCard.UserInteractionForSecurePINVerificationWithPINFormatAPDUPINByteOffset: Creates and returns a new user interaction object for secure PIN verification using the Smart Card reader facilities.
- TKSmartCard.UserInteractionForSecurePINChangeWithPINFormatAPDUCurrentPINByteOffsetNewPINByteOffset: Creates a new user interaction object for secure PIN change using the smart card reader facilities (typically a HW keypad).
Configuring APDU Behavior ¶
- TKSmartCard.Cla: The CLA byte used for APDU transmission. `0x00` by default.
- TKSmartCard.SetCla
- TKSmartCard.UseExtendedLength: Whether to use extended length APDU.
- TKSmartCard.SetUseExtendedLength
- TKSmartCard.UseCommandChaining: Whether to use command chaining of APDU with a data field longer than 255 bytes.
- TKSmartCard.SetUseCommandChaining
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCard
func NewTKSmartCard ¶
func NewTKSmartCard() TKSmartCard
NewTKSmartCard creates a new TKSmartCard instance.
func TKSmartCardFromID ¶
func TKSmartCardFromID(id objc.ID) TKSmartCard
TKSmartCardFromID constructs a TKSmartCard from an objc.ID.
A representation of a smart card.
func (TKSmartCard) AllowedProtocols ¶
func (t TKSmartCard) AllowedProtocols() TKSmartCardProtocol
The protocols allowed for communication with the Smart Card. TKSmartCardProtocolAny by default.
Discussion ¶
This property is consulted only when beginning a session to a Smart Card. Any changes to this property will not be reflected by the current session, if one is already established.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCard/allowedProtocols
func (TKSmartCard) Autorelease ¶
func (t TKSmartCard) Autorelease() TKSmartCard
Autorelease adds the receiver to the current autorelease pool.
func (TKSmartCard) BeginSessionWithReply ¶
func (t TKSmartCard) BeginSessionWithReply(reply BoolErrorHandler)
Begins a session with the Smart Card.
reply: success: Whether the session could be established successfully. error: Contains information about the error preventing the transaction from being established.
The [NSError] object is created in the TKErrorDomain domain with a code in the TKError.Code enumeration.
Discussion ¶
This method will fail if there is already an existing session for the Smart Card.
Calls to this method must be balanced with calls to TKSmartCard.EndSession.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCard/beginSession(reply:)
func (TKSmartCard) BeginSessionWithReplySync ¶
func (t TKSmartCard) BeginSessionWithReplySync(ctx context.Context) (bool, error)
BeginSessionWithReplySync is a synchronous wrapper around TKSmartCard.BeginSessionWithReply. It blocks until the completion handler fires or the context is cancelled.
func (TKSmartCard) Cla ¶
func (t TKSmartCard) Cla() uint8
The CLA byte used for APDU transmission. `0x00` by default.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCard/cla
func (TKSmartCard) Context ¶
func (t TKSmartCard) Context() objectivec.IObject
User-specified information. This property is automatically set to `nil` if the Smart Card is removed or another TKSmartCard object begins a session.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCard/context
func (TKSmartCard) CurrentProtocol ¶
func (t TKSmartCard) CurrentProtocol() TKSmartCardProtocol
The protocol used for communication with the Smart Card. Returns TKSmartCardProtocolNone if no session is currently established.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCard/currentProtocol
func (TKSmartCard) EndSession ¶
func (t TKSmartCard) EndSession()
Completes any pending transmissions and ends the session to the Smart Card.
Discussion ¶
Calls to this method should balance calls to TKSmartCard.BeginSessionWithReply.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCard/endSession()
func (TKSmartCard) Sensitive ¶
func (t TKSmartCard) Sensitive() bool
Whether sessions established for the Smart Card should be considered sensitive. false by default.
Discussion ¶
When this property is set to true, any sessions established for the receiver will begin and end by sending a reset command to the Smart Card. This is recommended anytime potentially sensitive information is transferred.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCard/isSensitive
func (TKSmartCard) SetAllowedProtocols ¶
func (t TKSmartCard) SetAllowedProtocols(value TKSmartCardProtocol)
func (TKSmartCard) SetCla ¶
func (t TKSmartCard) SetCla(value uint8)
func (TKSmartCard) SetContext ¶
func (t TKSmartCard) SetContext(value objectivec.IObject)
func (TKSmartCard) SetSensitive ¶
func (t TKSmartCard) SetSensitive(value bool)
func (TKSmartCard) SetUseCommandChaining ¶
func (t TKSmartCard) SetUseCommandChaining(value bool)
func (TKSmartCard) SetUseExtendedLength ¶
func (t TKSmartCard) SetUseExtendedLength(value bool)
func (TKSmartCard) Slot ¶
func (t TKSmartCard) Slot() ITKSmartCardSlot
The slot in which the Smart Card is inserted.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCard/slot
func (TKSmartCard) TransmitRequestReply ¶
func (t TKSmartCard) TransmitRequestReply(request foundation.NSData, reply DataErrorHandler)
Transmits data in Application Protocol Data Unit (APDU) format to the Smart Card.
request: The APDU request data.
reply: response: The APDU response data, or `nil` if communication with the Smart Card failed. error: Contains information about the the error preventing the transaction from being established.
The [NSError] object is created in the TKErrorDomain domain with a code in the TKError.Code enumeration.
Discussion ¶
You should only call this method after a session to the Smart Card has been established using the TKSmartCard.BeginSessionWithReply method, and before the session is terminated using the TKSmartCard.EndSession method.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCard/transmit(_:reply:)
func (TKSmartCard) TransmitRequestReplySync ¶
func (t TKSmartCard) TransmitRequestReplySync(ctx context.Context, request foundation.NSData) (*foundation.NSData, error)
TransmitRequestReplySync is a synchronous wrapper around TKSmartCard.TransmitRequestReply. It blocks until the completion handler fires or the context is cancelled.
func (TKSmartCard) UseCommandChaining ¶
func (t TKSmartCard) UseCommandChaining() bool
Whether to use command chaining of APDU with a data field longer than 255 bytes.
Discussion ¶
By default, this property is set to true when the Smart Card ATR announces that command chaining is supported.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCard/useCommandChaining
func (TKSmartCard) UseExtendedLength ¶
func (t TKSmartCard) UseExtendedLength() bool
Whether to use extended length APDU.
Discussion ¶
By default, this property is set to true when the Smart Card slot supports transmitting extended length commands, and the ATR announces that extended length APDU is supported.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCard/useExtendedLength
func (TKSmartCard) UserInteractionForSecurePINChangeWithPINFormatAPDUCurrentPINByteOffsetNewPINByteOffset ¶
func (t TKSmartCard) UserInteractionForSecurePINChangeWithPINFormatAPDUCurrentPINByteOffsetNewPINByteOffset(PINFormat ITKSmartCardPINFormat, APDU foundation.NSData, currentPINByteOffset int, newPINByteOffset int) ITKSmartCardUserInteractionForSecurePINChange
Creates a new user interaction object for secure PIN change using the smart card reader facilities (typically a HW keypad).
PINFormat: The PIN format descriptor.
APDU: The Application Protocol Data Unit (APDU) used by the Smart Card to fill in PIN data.
currentPINByteOffset: The offset, in bytes, within the Application Protocol Data Unit (APDU) field to mark a location of a PIN block for filling in the entered PIN.
newPINByteOffset: The offset, in bytes, within the Application Protocol Data Unit (APDU) field to mark a location of a PIN block for filling in the new PIN.
Return Value ¶
A new user interaction object for secure PIN verification, or `nil` if this feature is not supported by the Smart Card reader.
Discussion ¶
You should only call this method after a session to the Smart Card has been established using the TKSmartCard.BeginSessionWithReply method, and before the session is terminated using the TKSmartCard.EndSession method.
Once the interaction has been successfully completed, the results are available via the TKSmartCardUserInteractionForPINOperation.ResultData and TKSmartCardUserInteractionForPINOperation.ResultSW properties of the returned TKSmartCardUserInteractionForSecurePINVerification object.
func (TKSmartCard) UserInteractionForSecurePINVerificationWithPINFormatAPDUPINByteOffset ¶
func (t TKSmartCard) UserInteractionForSecurePINVerificationWithPINFormatAPDUPINByteOffset(PINFormat ITKSmartCardPINFormat, APDU foundation.NSData, PINByteOffset int) ITKSmartCardUserInteractionForSecurePINVerification
Creates and returns a new user interaction object for secure PIN verification using the Smart Card reader facilities.
PINFormat: The PIN format descriptor.
APDU: The Application Protocol Data Unit (APDU) used by the Smart Card to fill in PIN data.
PINByteOffset: The offset, in bytes, within the Application Protocol Data Unit (APDU) field to mark a location of a PIN block for filling in the entered PIN.
Return Value ¶
A new user interaction object for secure PIN verification, or `nil` if this feature is not supported by the Smart Card reader.
Discussion ¶
You should only call this method after a session to the Smart Card has been established using the TKSmartCard.BeginSessionWithReply method, and before the session is terminated using the TKSmartCard.EndSession method.
Once the interaction has been successfully completed, the results are available via the TKSmartCardUserInteractionForPINOperation.ResultData and TKSmartCardUserInteractionForPINOperation.ResultSW properties of the returned TKSmartCardUserInteractionForSecurePINVerification object.
func (TKSmartCard) Valid ¶
func (t TKSmartCard) Valid() bool
Whether the Smart Card is valid and accessible from its slot.
Discussion ¶
Use Key-Value-Observing to be notified for changes to accessibility, such as when a Smart Card is physically removed from its slot. For more information, see Key-Value Observing Programming Guide.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCard/isValid
type TKSmartCardATR ¶
type TKSmartCardATR struct {
objectivec.Object
}
A parsed ATR (Answer To Reset) message from a Smart Card.
Overview ¶
This class declares a programmatic interface to parsing an ATR from data or a byte stream, and accessing the individual parts.
Creating a Smart Card ATR ¶
- TKSmartCardATR.InitWithBytes: Initializes a TKSmartCardATR object from a provided data object.
- TKSmartCardATR.InitWithSource: Initializes a TKSmartCardATR object from a provided data source.
Accessing ATR Attributes ¶
- TKSmartCardATR.Protocols: An array of protocols indicated in the ATR
- TKSmartCardATR.Bytes: The ATR message data.
- TKSmartCardATR.HistoricalBytes: The ATR historical bytes, not including interface bytes or the TCK (check byte).
- TKSmartCardATR.HistoricalRecords: A list of compact TLV records parsed from historical bytes.
Retrieving Interface Groups ¶
- TKSmartCardATR.InterfaceGroupAtIndex: Returns the interface group at the specified index.
- TKSmartCardATR.InterfaceGroupForProtocol: Returns the interface group with the specified protocol.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardATR
func NewTKSmartCardATR ¶
func NewTKSmartCardATR() TKSmartCardATR
NewTKSmartCardATR creates a new TKSmartCardATR instance.
func NewTKSmartCardATRWithBytes ¶
func NewTKSmartCardATRWithBytes(bytes foundation.NSData) TKSmartCardATR
Initializes a TKSmartCardATR object from a provided data object.
bytes: The ATR data to be parsed.
Return Value ¶
A TKSmartCardATR object initialized with the parsed data. If `bytes` does not contain a valid ATR, returns `nil`.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardATR/init(bytes:)
func TKSmartCardATRFromID ¶
func TKSmartCardATRFromID(id objc.ID) TKSmartCardATR
TKSmartCardATRFromID constructs a TKSmartCardATR from an objc.ID.
A parsed ATR (Answer To Reset) message from a Smart Card.
func (TKSmartCardATR) Autorelease ¶
func (t TKSmartCardATR) Autorelease() TKSmartCardATR
Autorelease adds the receiver to the current autorelease pool.
func (TKSmartCardATR) Bytes ¶
func (t TKSmartCardATR) Bytes() foundation.NSData
The ATR message data.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardATR/bytes
func (TKSmartCardATR) HistoricalBytes ¶
func (t TKSmartCardATR) HistoricalBytes() foundation.NSData
The ATR historical bytes, not including interface bytes or the TCK (check byte).
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardATR/historicalBytes
func (TKSmartCardATR) HistoricalRecords ¶
func (t TKSmartCardATR) HistoricalRecords() []TKCompactTLVRecord
A list of compact TLV records parsed from historical bytes.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardATR/historicalRecords
func (TKSmartCardATR) Init ¶
func (t TKSmartCardATR) Init() TKSmartCardATR
Init initializes the instance.
func (TKSmartCardATR) InitWithBytes ¶
func (t TKSmartCardATR) InitWithBytes(bytes foundation.NSData) TKSmartCardATR
Initializes a TKSmartCardATR object from a provided data object.
bytes: The ATR data to be parsed.
Return Value ¶
A TKSmartCardATR object initialized with the parsed data. If `bytes` does not contain a valid ATR, returns `nil`.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardATR/init(bytes:)
func (TKSmartCardATR) InitWithSource ¶
func (t TKSmartCardATR) InitWithSource(source IntVoidHandler) TKSmartCardATR
Initializes a TKSmartCardATR object from a provided data source.
source: The block providing a stream of data for an ATR.
The block takes no arguments and returns one byte. To indicate that an error occured, the block returns `-1`.
Return Value ¶
A TKSmartCardATR object initialized with the parsed data. If the byte stream produces an error or does not contain a valid ATR, returns `nil`.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardATR/init(source:)
func (TKSmartCardATR) InterfaceGroupAtIndex ¶
func (t TKSmartCardATR) InterfaceGroupAtIndex(index int) ITKSmartCardATRInterfaceGroup
Returns the interface group at the specified index.
index: The index of the desired interface group.
Return Value ¶
The interface group at the specified index, or `nil` if not present.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardATR/interfaceGroup(at:)
func (TKSmartCardATR) InterfaceGroupForProtocol ¶
func (t TKSmartCardATR) InterfaceGroupForProtocol(protocol_ TKSmartCardProtocol) ITKSmartCardATRInterfaceGroup
Returns the interface group with the specified protocol.
protocol: The protocol used by the desired interface group.
Return Value ¶
The interface group with the specified protocol, or `nil` if none exists.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardATR/interfaceGroup(for:)
func (TKSmartCardATR) Protocols ¶
func (t TKSmartCardATR) Protocols() []foundation.NSNumber
An array of protocols indicated in the ATR
Discussion ¶
Each element in the returned array is an [NSNumber] object containing an [NSUInteger] value corresponding to a member of the TKSmartCardProtocol enumeration.
The returned protocols are ordered such that the default protocol is at index `0`, and any duplicate values are removed.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardATR/protocols
type TKSmartCardATRClass ¶
type TKSmartCardATRClass struct {
// contains filtered or unexported fields
}
func GetTKSmartCardATRClass ¶
func GetTKSmartCardATRClass() TKSmartCardATRClass
GetTKSmartCardATRClass returns the class object for TKSmartCardATR.
func (TKSmartCardATRClass) Alloc ¶
func (tc TKSmartCardATRClass) Alloc() TKSmartCardATR
Alloc allocates memory for a new instance of the class.
func (TKSmartCardATRClass) Class ¶
func (tc TKSmartCardATRClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKSmartCardATRInterfaceGroup ¶
type TKSmartCardATRInterfaceGroup struct {
objectivec.Object
}
A single interface-bytes group for a Smart Card ATR (Answer to Reset).
Overview ¶
You access instances of this class by calling the TKSmartCardATR.InterfaceGroupAtIndex and TKSmartCardATR.InterfaceGroupForProtocol methods on an TKSmartCardATR object.
Accessing Interface Group Protocol and Bytes ¶
- TKSmartCardATRInterfaceGroup.Protocol: The protocol for this group.
- TKSmartCardATRInterfaceGroup.TA: The TA interface byte of ATR group, or `nil` if TA is not present.
- TKSmartCardATRInterfaceGroup.TB: The TB interface byte of ATR group, or `nil` if TB is not present.
- TKSmartCardATRInterfaceGroup.TC: The TC interface byte of ATR group, or `nil` if TC is not present.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardATR/InterfaceGroup
func NewTKSmartCardATRInterfaceGroup ¶
func NewTKSmartCardATRInterfaceGroup() TKSmartCardATRInterfaceGroup
NewTKSmartCardATRInterfaceGroup creates a new TKSmartCardATRInterfaceGroup instance.
func TKSmartCardATRInterfaceGroupFromID ¶
func TKSmartCardATRInterfaceGroupFromID(id objc.ID) TKSmartCardATRInterfaceGroup
TKSmartCardATRInterfaceGroupFromID constructs a TKSmartCardATRInterfaceGroup from an objc.ID.
A single interface-bytes group for a Smart Card ATR (Answer to Reset).
func (TKSmartCardATRInterfaceGroup) Autorelease ¶
func (t TKSmartCardATRInterfaceGroup) Autorelease() TKSmartCardATRInterfaceGroup
Autorelease adds the receiver to the current autorelease pool.
func (TKSmartCardATRInterfaceGroup) Init ¶
func (t TKSmartCardATRInterfaceGroup) Init() TKSmartCardATRInterfaceGroup
Init initializes the instance.
func (TKSmartCardATRInterfaceGroup) Protocol ¶
func (t TKSmartCardATRInterfaceGroup) Protocol() foundation.NSNumber
The protocol for this group.
Discussion ¶
This property returns an [NSNumber] object containing an [NSUInteger] value corresponding to a member of the TKSmartCardProtocol enumeration.
This property is `nil` for the first interface group (global), as it has no assigned protocol.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardATR/InterfaceGroup/protocol
func (TKSmartCardATRInterfaceGroup) TA ¶
func (t TKSmartCardATRInterfaceGroup) TA() foundation.NSNumber
The TA interface byte of ATR group, or `nil` if TA is not present.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardATR/InterfaceGroup/ta
func (TKSmartCardATRInterfaceGroup) TB ¶
func (t TKSmartCardATRInterfaceGroup) TB() foundation.NSNumber
The TB interface byte of ATR group, or `nil` if TB is not present.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardATR/InterfaceGroup/tb
func (TKSmartCardATRInterfaceGroup) TC ¶
func (t TKSmartCardATRInterfaceGroup) TC() foundation.NSNumber
The TC interface byte of ATR group, or `nil` if TC is not present.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardATR/InterfaceGroup/tc
type TKSmartCardATRInterfaceGroupClass ¶
type TKSmartCardATRInterfaceGroupClass struct {
// contains filtered or unexported fields
}
func GetTKSmartCardATRInterfaceGroupClass ¶
func GetTKSmartCardATRInterfaceGroupClass() TKSmartCardATRInterfaceGroupClass
GetTKSmartCardATRInterfaceGroupClass returns the class object for TKSmartCardATRInterfaceGroup.
func (TKSmartCardATRInterfaceGroupClass) Alloc ¶
func (tc TKSmartCardATRInterfaceGroupClass) Alloc() TKSmartCardATRInterfaceGroup
Alloc allocates memory for a new instance of the class.
func (TKSmartCardATRInterfaceGroupClass) Class ¶
func (tc TKSmartCardATRInterfaceGroupClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKSmartCardClass ¶
type TKSmartCardClass struct {
// contains filtered or unexported fields
}
func GetTKSmartCardClass ¶
func GetTKSmartCardClass() TKSmartCardClass
GetTKSmartCardClass returns the class object for TKSmartCard.
func (TKSmartCardClass) Alloc ¶
func (tc TKSmartCardClass) Alloc() TKSmartCard
Alloc allocates memory for a new instance of the class.
func (TKSmartCardClass) Class ¶
func (tc TKSmartCardClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKSmartCardPINCharset ¶
type TKSmartCardPINCharset int
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardPINFormat/Charset-swift.enum
const ( TKSmartCardPINCharsetAlphanumeric TKSmartCardPINCharset = 1 TKSmartCardPINCharsetNumeric TKSmartCardPINCharset = 0 TKSmartCardPINCharsetUpperAlphanumeric TKSmartCardPINCharset = 2 )
func (TKSmartCardPINCharset) String ¶
func (e TKSmartCardPINCharset) String() string
type TKSmartCardPINCompletion ¶
type TKSmartCardPINCompletion uint
const ( TKSmartCardPINCompletionKey TKSmartCardPINCompletion = 2 TKSmartCardPINCompletionMaxLength TKSmartCardPINCompletion = 1 TKSmartCardPINCompletionTimeout TKSmartCardPINCompletion = 4 )
func (TKSmartCardPINCompletion) String ¶
func (e TKSmartCardPINCompletion) String() string
type TKSmartCardPINConfirmation ¶
type TKSmartCardPINConfirmation uint
const ( TKSmartCardPINConfirmationCurrent TKSmartCardPINConfirmation = 2 TKSmartCardPINConfirmationNew TKSmartCardPINConfirmation = 1 TKSmartCardPINConfirmationNone TKSmartCardPINConfirmation = 0 )
func (TKSmartCardPINConfirmation) String ¶
func (e TKSmartCardPINConfirmation) String() string
type TKSmartCardPINEncoding ¶
type TKSmartCardPINEncoding int
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardPINFormat/Encoding-swift.enum
const ( TKSmartCardPINEncodingASCII TKSmartCardPINEncoding = 1 TKSmartCardPINEncodingBCD TKSmartCardPINEncoding = 2 TKSmartCardPINEncodingBinary TKSmartCardPINEncoding = 0 )
func (TKSmartCardPINEncoding) String ¶
func (e TKSmartCardPINEncoding) String() string
type TKSmartCardPINFormat ¶
type TKSmartCardPINFormat struct {
objectivec.Object
}
The formatting properties for a PIN, such as character encoding and length constraints.
Overview ¶
You typically interact with TKSmartCardPINFormat objects when calling the TKSmartCard.UserInteractionForSecurePINChangeWithPINFormatAPDUCurrentPINByteOffsetNewPINByteOffset and TKSmartCard.UserInteractionForSecurePINVerificationWithPINFormatAPDUPINByteOffset methods on an instance of TKSmartCard.
Configuring PIN Formatting ¶
- TKSmartCardPINFormat.Charset: The format of PIN characters. TKSmartCardPINCharsetNumeric by default.
- TKSmartCardPINFormat.SetCharset
- TKSmartCardPINFormat.Encoding: The encoding of PIN characters. TKSmartCardPINEncodingASCII by default.
- TKSmartCardPINFormat.SetEncoding
- TKSmartCardPINFormat.MinPINLength: The minimum number of characters to form a valid PIN. `4` by default.
- TKSmartCardPINFormat.SetMinPINLength
- TKSmartCardPINFormat.MaxPINLength: The maximum number of characters to form a valid PIN. `8` by default.
- TKSmartCardPINFormat.SetMaxPINLength
- TKSmartCardPINFormat.PINBlockByteLength: The total length of the PIN block in bytes. `8` by default.
- TKSmartCardPINFormat.SetPINBlockByteLength
- TKSmartCardPINFormat.PINJustification: The justification within the PIN block. TKSmartCardPINJustificationLeft by default.
- TKSmartCardPINFormat.SetPINJustification
- TKSmartCardPINFormat.PINBitOffset: 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](<https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardPINFormat/pinJustification>) property value. `0` by default.
- TKSmartCardPINFormat.SetPINBitOffset
- TKSmartCardPINFormat.PINLengthBitOffset: The offset, in bits, within the PIN block to mark a location for filling in the PIN length, which is always left justified. `0` by default.
- TKSmartCardPINFormat.SetPINLengthBitOffset
- TKSmartCardPINFormat.PINLengthBitSize: The size, in bits, of the PIN length field. If set to `0`, PIN length is not written. `0` by default.
- TKSmartCardPINFormat.SetPINLengthBitSize
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardPINFormat
func NewTKSmartCardPINFormat ¶
func NewTKSmartCardPINFormat() TKSmartCardPINFormat
NewTKSmartCardPINFormat creates a new TKSmartCardPINFormat instance.
func TKSmartCardPINFormatFromID ¶
func TKSmartCardPINFormatFromID(id objc.ID) TKSmartCardPINFormat
TKSmartCardPINFormatFromID constructs a TKSmartCardPINFormat from an objc.ID.
The formatting properties for a PIN, such as character encoding and length constraints.
func (TKSmartCardPINFormat) Autorelease ¶
func (t TKSmartCardPINFormat) Autorelease() TKSmartCardPINFormat
Autorelease adds the receiver to the current autorelease pool.
func (TKSmartCardPINFormat) Charset ¶
func (t TKSmartCardPINFormat) Charset() TKSmartCardPINCharset
The format of PIN characters. TKSmartCardPINCharsetNumeric by default.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardPINFormat/charset-swift.property
func (TKSmartCardPINFormat) Encoding ¶
func (t TKSmartCardPINFormat) Encoding() TKSmartCardPINEncoding
The encoding of PIN characters. TKSmartCardPINEncodingASCII by default.
func (TKSmartCardPINFormat) Init ¶
func (t TKSmartCardPINFormat) Init() TKSmartCardPINFormat
Init initializes the instance.
func (TKSmartCardPINFormat) MaxPINLength ¶
func (t TKSmartCardPINFormat) MaxPINLength() int
The maximum number of characters to form a valid PIN. `8` by default.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardPINFormat/maxPINLength
func (TKSmartCardPINFormat) MinPINLength ¶
func (t TKSmartCardPINFormat) MinPINLength() int
The minimum number of characters to form a valid PIN. `4` by default.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardPINFormat/minPINLength
func (TKSmartCardPINFormat) PINBitOffset ¶
func (t TKSmartCardPINFormat) PINBitOffset() int
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 TKSmartCardPINFormat.PINJustification property value. `0` by default.
Discussion ¶
The value of [PINBitOffset] indirectly controls the internal system units indicator. If [PINBitOffset] is byte aligned (that is, `PINBitOffset % 8 == 0`), the internal representation of [PINBitOffset] gets converted from bits to bytes.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardPINFormat/pinBitOffset
func (TKSmartCardPINFormat) PINBlockByteLength ¶
func (t TKSmartCardPINFormat) PINBlockByteLength() int
The total length of the PIN block in bytes. `8` by default.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardPINFormat/pinBlockByteLength
func (TKSmartCardPINFormat) PINJustification ¶
func (t TKSmartCardPINFormat) PINJustification() TKSmartCardPINJustification
The justification within the PIN block. TKSmartCardPINJustificationLeft by default.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardPINFormat/pinJustification
func (TKSmartCardPINFormat) PINLengthBitOffset ¶
func (t TKSmartCardPINFormat) PINLengthBitOffset() int
The offset, in bits, within the PIN block to mark a location for filling in the PIN length, which is always left justified. `0` by default.
Discussion ¶
The value of [PINLengthBitOffset] indirectly controls the internal system units indicator. If [PINLengthBitOffset] is byte aligned (that is, `PINLengthBitOffset % 8 == 0`), the internal representation of [PINLengthBitOffset] gets converted from bits to bytes.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardPINFormat/pinLengthBitOffset
func (TKSmartCardPINFormat) PINLengthBitSize ¶
func (t TKSmartCardPINFormat) PINLengthBitSize() int
The size, in bits, of the PIN length field. If set to `0`, PIN length is not written. `0` by default.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardPINFormat/pinLengthBitSize
func (TKSmartCardPINFormat) SetCharset ¶
func (t TKSmartCardPINFormat) SetCharset(value TKSmartCardPINCharset)
func (TKSmartCardPINFormat) SetEncoding ¶
func (t TKSmartCardPINFormat) SetEncoding(value TKSmartCardPINEncoding)
func (TKSmartCardPINFormat) SetMaxPINLength ¶
func (t TKSmartCardPINFormat) SetMaxPINLength(value int)
func (TKSmartCardPINFormat) SetMinPINLength ¶
func (t TKSmartCardPINFormat) SetMinPINLength(value int)
func (TKSmartCardPINFormat) SetPINBitOffset ¶
func (t TKSmartCardPINFormat) SetPINBitOffset(value int)
func (TKSmartCardPINFormat) SetPINBlockByteLength ¶
func (t TKSmartCardPINFormat) SetPINBlockByteLength(value int)
func (TKSmartCardPINFormat) SetPINJustification ¶
func (t TKSmartCardPINFormat) SetPINJustification(value TKSmartCardPINJustification)
func (TKSmartCardPINFormat) SetPINLengthBitOffset ¶
func (t TKSmartCardPINFormat) SetPINLengthBitOffset(value int)
func (TKSmartCardPINFormat) SetPINLengthBitSize ¶
func (t TKSmartCardPINFormat) SetPINLengthBitSize(value int)
type TKSmartCardPINFormatClass ¶
type TKSmartCardPINFormatClass struct {
// contains filtered or unexported fields
}
func GetTKSmartCardPINFormatClass ¶
func GetTKSmartCardPINFormatClass() TKSmartCardPINFormatClass
GetTKSmartCardPINFormatClass returns the class object for TKSmartCardPINFormat.
func (TKSmartCardPINFormatClass) Alloc ¶
func (tc TKSmartCardPINFormatClass) Alloc() TKSmartCardPINFormat
Alloc allocates memory for a new instance of the class.
func (TKSmartCardPINFormatClass) Class ¶
func (tc TKSmartCardPINFormatClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKSmartCardPINJustification ¶
type TKSmartCardPINJustification int
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardPINFormat/Justification
const ( TKSmartCardPINJustificationLeft TKSmartCardPINJustification = 0 TKSmartCardPINJustificationRight TKSmartCardPINJustification = 1 )
func (TKSmartCardPINJustification) String ¶
func (e TKSmartCardPINJustification) String() string
type TKSmartCardProtocol ¶
type TKSmartCardProtocol uint
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardProtocol
const ( // TKSmartCardProtocolAny: # Discussion TKSmartCardProtocolAny TKSmartCardProtocol = 65535 TKSmartCardProtocolNone TKSmartCardProtocol = 0 // TKSmartCardProtocolT0: # Discussion TKSmartCardProtocolT0 TKSmartCardProtocol = 1 // TKSmartCardProtocolT1: # Discussion TKSmartCardProtocolT1 TKSmartCardProtocol = 2 // TKSmartCardProtocolT15: # Discussion TKSmartCardProtocolT15 TKSmartCardProtocol = 32768 )
func (TKSmartCardProtocol) String ¶
func (e TKSmartCardProtocol) String() string
type TKSmartCardSlot ¶
type TKSmartCardSlot struct {
objectivec.Object
}
A single smart card reader slot in the system.
Overview ¶
Use the TKSmartCardSlotManager class to manage all the smart card reader slots available to the system. You can retrieve the names of available smart card reader slots for a system using the TKSmartCardSlotManager.SlotNames property of a manager object, and access instances of TKSmartCardSlot using the TKSmartCardSlotManager.GetSlotWithNameReply method.
Instantiating Smart Cards ¶
- TKSmartCardSlot.MakeSmartCard: Creates a new TKSmartCard(<https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCard>) object representing the currently inserted Smart Card.
Getting the Slot State ¶
- TKSmartCardSlot.State: The current state of the Smart Card reader slot.
Getting the Slot Configuration ¶
- TKSmartCardSlot.Name: The name of the Smart Card reader slot.
- TKSmartCardSlot.MaxInputLength: The maximum length of input APDU (Application Protocol Data Unit) that the Smart Card reader slot is able to transfer to the Smart Card.
- TKSmartCardSlot.MaxOutputLength: The maximum length of output APDU (Application Protocol Data Unit) that the Smart Card reader slot is able to transfer from the Smart Card.
Reading the Answer to Reset ¶
- TKSmartCardSlot.ATR: The ATR (Answer to Reset) of the inserted Smart Card, or `nil` if no Smart Card is inserted or the inserted Smart Card is mute.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardSlot
func NewTKSmartCardSlot ¶
func NewTKSmartCardSlot() TKSmartCardSlot
NewTKSmartCardSlot creates a new TKSmartCardSlot instance.
func TKSmartCardSlotFromID ¶
func TKSmartCardSlotFromID(id objc.ID) TKSmartCardSlot
TKSmartCardSlotFromID constructs a TKSmartCardSlot from an objc.ID.
A single smart card reader slot in the system.
func (TKSmartCardSlot) ATR ¶
func (t TKSmartCardSlot) ATR() ITKSmartCardATR
The ATR (Answer to Reset) of the inserted Smart Card, or `nil` if no Smart Card is inserted or the inserted Smart Card is mute.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardSlot/atr
func (TKSmartCardSlot) Autorelease ¶
func (t TKSmartCardSlot) Autorelease() TKSmartCardSlot
Autorelease adds the receiver to the current autorelease pool.
func (TKSmartCardSlot) Init ¶
func (t TKSmartCardSlot) Init() TKSmartCardSlot
Init initializes the instance.
func (TKSmartCardSlot) MakeSmartCard ¶
func (t TKSmartCardSlot) MakeSmartCard() ITKSmartCard
Creates a new TKSmartCard object representing the currently inserted Smart Card.
Return Value ¶
A new TKSmartCard object, or `nil` if no Smart Card is currently inserted.
Discussion ¶
You can create multiple instances of TKSmartCard that represent the same Smart Card. Exclusivity of data transfer is handled by sessions on the individual TKSmartCard objects.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardSlot/makeSmartCard()
func (TKSmartCardSlot) MaxInputLength ¶
func (t TKSmartCardSlot) MaxInputLength() int
The maximum length of input APDU (Application Protocol Data Unit) that the Smart Card reader slot is able to transfer to the Smart Card.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardSlot/maxInputLength
func (TKSmartCardSlot) MaxOutputLength ¶
func (t TKSmartCardSlot) MaxOutputLength() int
The maximum length of output APDU (Application Protocol Data Unit) that the Smart Card reader slot is able to transfer from the Smart Card.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardSlot/maxOutputLength
func (TKSmartCardSlot) Name ¶
func (t TKSmartCardSlot) Name() string
The name of the Smart Card reader slot.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardSlot/name
func (TKSmartCardSlot) State ¶
func (t TKSmartCardSlot) State() TKSmartCardSlotState
The current state of the Smart Card reader slot.
Discussion ¶
Use Key-Value-Observing to be notified for changes to the state. For more information, see Key-Value Observing Programming Guide.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardSlot/state-swift.property
type TKSmartCardSlotClass ¶
type TKSmartCardSlotClass struct {
// contains filtered or unexported fields
}
func GetTKSmartCardSlotClass ¶
func GetTKSmartCardSlotClass() TKSmartCardSlotClass
GetTKSmartCardSlotClass returns the class object for TKSmartCardSlot.
func (TKSmartCardSlotClass) Alloc ¶
func (tc TKSmartCardSlotClass) Alloc() TKSmartCardSlot
Alloc allocates memory for a new instance of the class.
func (TKSmartCardSlotClass) Class ¶
func (tc TKSmartCardSlotClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKSmartCardSlotHandler ¶
type TKSmartCardSlotHandler = func(*TKSmartCardSlot)
TKSmartCardSlotHandler handles slot: The Smart Card reader slot corresponding to the specified name.
- slot: The Smart Card reader slot corresponding to the specified name. If no slot exists with that name, this argument is `nil`.
Used by:
type TKSmartCardSlotManager ¶
type TKSmartCardSlotManager struct {
objectivec.Object
}
An interface to all available smart card reader slots.
Overview ¶
Get a list of all known smart card reader slots in the system using the TKSmartCardSlotManager.SlotNames property, and access individual slots by name using the TKSmartCardSlotManager.GetSlotWithNameReply method.
Accessing Smart Card Slots ¶
- TKSmartCardSlotManager.SlotNames: A list of identifiers for all the Smart Card reader slots available to the system.
- TKSmartCardSlotManager.GetSlotWithNameReply: Asynchronously calls a block with a Smart Card reader slot for a specified name.
- TKSmartCardSlotManager.SlotNamed: Returns the Smart Card slot with a given name.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardSlotManager
func NewTKSmartCardSlotManager ¶
func NewTKSmartCardSlotManager() TKSmartCardSlotManager
NewTKSmartCardSlotManager creates a new TKSmartCardSlotManager instance.
func TKSmartCardSlotManagerFromID ¶
func TKSmartCardSlotManagerFromID(id objc.ID) TKSmartCardSlotManager
TKSmartCardSlotManagerFromID constructs a TKSmartCardSlotManager from an objc.ID.
An interface to all available smart card reader slots.
func (TKSmartCardSlotManager) Autorelease ¶
func (t TKSmartCardSlotManager) Autorelease() TKSmartCardSlotManager
Autorelease adds the receiver to the current autorelease pool.
func (TKSmartCardSlotManager) GetSlotWithNameReply ¶
func (t TKSmartCardSlotManager) GetSlotWithNameReply(name string, reply TKSmartCardSlotHandler)
Asynchronously calls a block with a Smart Card reader slot for a specified name.
name: The name of the Smart Card reader slot.
reply: slot: The Smart Card reader slot corresponding to the specified name. If no slot exists with that name, this argument is `nil`.
func (TKSmartCardSlotManager) GetSlotWithNameReplySync ¶
func (t TKSmartCardSlotManager) GetSlotWithNameReplySync(ctx context.Context, name string) (*TKSmartCardSlot, error)
GetSlotWithNameReplySync is a synchronous wrapper around TKSmartCardSlotManager.GetSlotWithNameReply. It blocks until the completion handler fires or the context is cancelled.
func (TKSmartCardSlotManager) Init ¶
func (t TKSmartCardSlotManager) Init() TKSmartCardSlotManager
Init initializes the instance.
func (TKSmartCardSlotManager) SlotNamed ¶
func (t TKSmartCardSlotManager) SlotNamed(name string) ITKSmartCardSlot
Returns the Smart Card slot with a given name.
Return Value ¶
The slot with the specified name, or `nil` if no slot with that name exists.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardSlotManager/slotNamed(_:)
func (TKSmartCardSlotManager) SlotNames ¶
func (t TKSmartCardSlotManager) SlotNames() []string
A list of identifiers for all the Smart Card reader slots available to the system.
Discussion ¶
Use Key-Value Observing on this property to be notified for changes to available Smart Card reader slots. For more information, see Key-Value Observing Programming Guide.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardSlotManager/slotNames
type TKSmartCardSlotManagerClass ¶
type TKSmartCardSlotManagerClass struct {
// contains filtered or unexported fields
}
func GetTKSmartCardSlotManagerClass ¶
func GetTKSmartCardSlotManagerClass() TKSmartCardSlotManagerClass
GetTKSmartCardSlotManagerClass returns the class object for TKSmartCardSlotManager.
func (TKSmartCardSlotManagerClass) Alloc ¶
func (tc TKSmartCardSlotManagerClass) Alloc() TKSmartCardSlotManager
Alloc allocates memory for a new instance of the class.
func (TKSmartCardSlotManagerClass) Class ¶
func (tc TKSmartCardSlotManagerClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (TKSmartCardSlotManagerClass) DefaultManager ¶
func (_TKSmartCardSlotManagerClass TKSmartCardSlotManagerClass) DefaultManager() TKSmartCardSlotManager
The shared singleton Smart Card reader slot manager.
Discussion ¶
This method returns `nil` unless the com.apple.security.smartcard entitlement is enabled.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardSlotManager/default
type TKSmartCardSlotNFCSessionErrorHandler ¶
TKSmartCardSlotNFCSessionErrorHandler handles Completion handler which returns the NFC session of the created slot or an error on failure.
Used by:
- [TKSmartCardSlotManager.CreateNFCSlotWithMessageCompletion]
type TKSmartCardSlotState ¶
type TKSmartCardSlotState int
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardSlot/State-swift.enum
const ( TKSmartCardSlotStateEmpty TKSmartCardSlotState = 1 TKSmartCardSlotStateMissing TKSmartCardSlotState = 0 TKSmartCardSlotStateMuteCard TKSmartCardSlotState = 3 TKSmartCardSlotStateProbing TKSmartCardSlotState = 2 TKSmartCardSlotStateValidCard TKSmartCardSlotState = 4 )
func (TKSmartCardSlotState) String ¶
func (e TKSmartCardSlotState) String() string
type TKSmartCardToken ¶
type TKSmartCardToken struct {
TKToken
}
A representation of a smart card based cryptographic token.
Creating Smart Card Tokens ¶
- TKSmartCardToken.InitWithSmartCardAIDInstanceIDTokenDriver: Initializes a smart card token with the specified smart card, application identifier, and token driver.
Accessing the Application Identifier ¶
- TKSmartCardToken.AID: The ISO 7816-4 application identifiers of the Smart Card.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardToken
func NewTKSmartCardToken ¶
func NewTKSmartCardToken() TKSmartCardToken
NewTKSmartCardToken creates a new TKSmartCardToken instance.
func NewTKSmartCardTokenWithSmartCardAIDInstanceIDTokenDriver ¶
func NewTKSmartCardTokenWithSmartCardAIDInstanceIDTokenDriver(smartCard ITKSmartCard, AID foundation.NSData, instanceID string, tokenDriver ITKSmartCardTokenDriver) TKSmartCardToken
Initializes a smart card token with the specified smart card, application identifier, and token driver.
smartCard: The smart card on which the created token should operate.
AID: The ISO 7816-4 application identifier for the smart card.
instanceID: A unique, persistent identifier for this token. This value is typically generated from the serial number of the target hardware.
tokenDriver: The driver associated with the created token.
Discussion ¶
This is the designated initializer.
func NewTKSmartCardTokenWithTokenDriverInstanceID ¶
func NewTKSmartCardTokenWithTokenDriverInstanceID(tokenDriver ITKTokenDriver, instanceID TKTokenInstanceID) TKSmartCardToken
Initializes a token with the driver you specify.
tokenDriver: The driver of the token.
instanceID: A unique, persistent identifier for this token. This value is typically generated from the serial number of the target hardware.
Return Value ¶
A new token object.
Discussion ¶
This is the designated initializer.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKToken/init(tokenDriver:instanceID:)
func TKSmartCardTokenFromID ¶
func TKSmartCardTokenFromID(id objc.ID) TKSmartCardToken
TKSmartCardTokenFromID constructs a TKSmartCardToken from an objc.ID.
A representation of a smart card based cryptographic token.
func (TKSmartCardToken) AID ¶
func (t TKSmartCardToken) AID() foundation.NSData
The ISO 7816-4 application identifiers of the Smart Card.
Discussion ¶
This value is specified in the Smart Card token extension’s [NSExtensionAttributes] property list by the `com.AppleXCUIElementTypeCtkXCUIElementTypeAid()` attribute. If this attribute specifies multiple AIDs, this parameter represents the application identifier found on the card that is already preselected. If the `com.AppleXCUIElementTypeCtkXCUIElementTypeAid()` attribute is not present, no application is automatically preselected and the value of this property is `nil`.
For more information, see App Extension Keys in Information Property List Key Reference.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardToken/aid
func (TKSmartCardToken) Autorelease ¶
func (t TKSmartCardToken) Autorelease() TKSmartCardToken
Autorelease adds the receiver to the current autorelease pool.
func (TKSmartCardToken) Init ¶
func (t TKSmartCardToken) Init() TKSmartCardToken
Init initializes the instance.
func (TKSmartCardToken) InitWithSmartCardAIDInstanceIDTokenDriver ¶
func (t TKSmartCardToken) InitWithSmartCardAIDInstanceIDTokenDriver(smartCard ITKSmartCard, AID foundation.NSData, instanceID string, tokenDriver ITKSmartCardTokenDriver) TKSmartCardToken
Initializes a smart card token with the specified smart card, application identifier, and token driver.
smartCard: The smart card on which the created token should operate.
AID: The ISO 7816-4 application identifier for the smart card.
instanceID: A unique, persistent identifier for this token. This value is typically generated from the serial number of the target hardware.
tokenDriver: The driver associated with the created token.
Discussion ¶
This is the designated initializer.
type TKSmartCardTokenClass ¶
type TKSmartCardTokenClass struct {
// contains filtered or unexported fields
}
func GetTKSmartCardTokenClass ¶
func GetTKSmartCardTokenClass() TKSmartCardTokenClass
GetTKSmartCardTokenClass returns the class object for TKSmartCardToken.
func (TKSmartCardTokenClass) Alloc ¶
func (tc TKSmartCardTokenClass) Alloc() TKSmartCardToken
Alloc allocates memory for a new instance of the class.
func (TKSmartCardTokenClass) Class ¶
func (tc TKSmartCardTokenClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKSmartCardTokenDriver ¶
type TKSmartCardTokenDriver struct {
TKTokenDriver
}
The driver that acts as an entry point for smart card app extensions.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardTokenDriver
func NewTKSmartCardTokenDriver ¶
func NewTKSmartCardTokenDriver() TKSmartCardTokenDriver
NewTKSmartCardTokenDriver creates a new TKSmartCardTokenDriver instance.
func TKSmartCardTokenDriverFromID ¶
func TKSmartCardTokenDriverFromID(id objc.ID) TKSmartCardTokenDriver
TKSmartCardTokenDriverFromID constructs a TKSmartCardTokenDriver from an objc.ID.
The driver that acts as an entry point for smart card app extensions.
func (TKSmartCardTokenDriver) Autorelease ¶
func (t TKSmartCardTokenDriver) Autorelease() TKSmartCardTokenDriver
Autorelease adds the receiver to the current autorelease pool.
func (TKSmartCardTokenDriver) Init ¶
func (t TKSmartCardTokenDriver) Init() TKSmartCardTokenDriver
Init initializes the instance.
type TKSmartCardTokenDriverClass ¶
type TKSmartCardTokenDriverClass struct {
// contains filtered or unexported fields
}
func GetTKSmartCardTokenDriverClass ¶
func GetTKSmartCardTokenDriverClass() TKSmartCardTokenDriverClass
GetTKSmartCardTokenDriverClass returns the class object for TKSmartCardTokenDriver.
func (TKSmartCardTokenDriverClass) Alloc ¶
func (tc TKSmartCardTokenDriverClass) Alloc() TKSmartCardTokenDriver
Alloc allocates memory for a new instance of the class.
func (TKSmartCardTokenDriverClass) Class ¶
func (tc TKSmartCardTokenDriverClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKSmartCardTokenDriverDelegate ¶
type TKSmartCardTokenDriverDelegate interface {
objectivec.IObject
TKTokenDriverDelegate
// Tells the delegate that a new Smart Card is detected.
//
// See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardTokenDriverDelegate/tokenDriver(_:createTokenFor:aid:)
TokenDriverCreateTokenForSmartCardAIDError(driver ITKSmartCardTokenDriver, smartCard ITKSmartCard, AID foundation.NSData) (ITKSmartCardToken, error)
}
The interface that a smart card token driver delegate implements to respond to token creation events.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardTokenDriverDelegate
type TKSmartCardTokenDriverDelegateConfig ¶
type TKSmartCardTokenDriverDelegateConfig struct {
// Other Methods
// TokenDriverCreateTokenForSmartCardAIDError — Tells the delegate that a new Smart Card is detected.
TokenDriverCreateTokenForSmartCardAIDError func(driver TKSmartCardTokenDriver, smartCard TKSmartCard, AID foundation.NSData, error_ foundation.NSError) TKSmartCardToken
}
TKSmartCardTokenDriverDelegateConfig holds optional typed callbacks for TKSmartCardTokenDriverDelegate methods. Set non-nil fields to register the corresponding Objective-C delegate method. Methods with nil callbacks are not registered, so [NSObject.RespondsToSelector] returns false for them — matching the Objective-C delegate pattern exactly.
See Apple Documentation for protocol details.
type TKSmartCardTokenDriverDelegateObject ¶
type TKSmartCardTokenDriverDelegateObject struct {
objectivec.Object
}
TKSmartCardTokenDriverDelegateObject wraps an existing Objective-C object that conforms to the TKSmartCardTokenDriverDelegate protocol.
func NewTKSmartCardTokenDriverDelegate ¶
func NewTKSmartCardTokenDriverDelegate(config TKSmartCardTokenDriverDelegateConfig) TKSmartCardTokenDriverDelegateObject
NewTKSmartCardTokenDriverDelegate creates an Objective-C object implementing the TKSmartCardTokenDriverDelegate protocol.
Each call registers a unique Objective-C class containing only the methods set in config. This means [NSObject.RespondsToSelector] works correctly for optional delegate methods — only non-nil callbacks are registered.
The returned TKSmartCardTokenDriverDelegateObject satisfies the TKSmartCardTokenDriverDelegate interface and can be passed directly to SetDelegate and similar methods.
See Apple Documentation for protocol details.
func TKSmartCardTokenDriverDelegateObjectFromID ¶
func TKSmartCardTokenDriverDelegateObjectFromID(id objc.ID) TKSmartCardTokenDriverDelegateObject
TKSmartCardTokenDriverDelegateObjectFromID constructs a TKSmartCardTokenDriverDelegateObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (TKSmartCardTokenDriverDelegateObject) BaseObject ¶
func (o TKSmartCardTokenDriverDelegateObject) BaseObject() objectivec.Object
func (TKSmartCardTokenDriverDelegateObject) TokenDriverCreateTokenForSmartCardAIDError ¶
func (o TKSmartCardTokenDriverDelegateObject) TokenDriverCreateTokenForSmartCardAIDError(driver ITKSmartCardTokenDriver, smartCard ITKSmartCard, AID foundation.NSData) (ITKSmartCardToken, error)
Tells the delegate that a new Smart Card is detected.
driver: The Smart Card token driver.
smartCard: The detected Smart Card.
AID: The ISO 7816-4 application identifier that is selected on the Smart Card. If the `com.AppleXCUIElementTypeCtkXCUIElementTypeAid()` attributes is not present in the Smart Card token extension property list, no application is selected.
Return Value ¶
The token created for the Smart Card, or `nil` if an error occurs or the delegate decides not to provide a token.
func (TKSmartCardTokenDriverDelegateObject) TokenDriverTerminateToken ¶
func (o TKSmartCardTokenDriverDelegateObject) TokenDriverTerminateToken(driver ITKTokenDriver, token ITKToken)
Tells the delegate to terminate the token you specify.
driver: The token driver.
token: The token to be terminated.
func (TKSmartCardTokenDriverDelegateObject) TokenDriverTokenForConfigurationError ¶
func (o TKSmartCardTokenDriverDelegateObject) TokenDriverTokenForConfigurationError(driver ITKTokenDriver, configuration ITKTokenConfiguration) (ITKToken, error)
Creates a new token for the configuration you specify.
driver: The token driver.
configuration: The configuration that identifies the token to create.
Return Value ¶
The created token.
Discussion ¶
The system invokes this method to request creation of a token instance, which the TKTokenConfiguration.InstanceID property of the configuration you specify identifies.
The created token has access to its current configuration using the TKTokenConfiguration.ConfigurationData property, which can provide token-implementation-specific additional data. The token can access keychain items this token exports with the methods TKTokenConfiguration.KeyForObjectIDError and TKTokenConfiguration.CertificateForObjectIDError that the configuration provides.
type TKSmartCardTokenSession ¶
type TKSmartCardTokenSession struct {
TKTokenSession
}
A token session that is based on a smart card token.
Overview ¶
You can use the TKSmartCardTokenSession.SmartCard property to access and send APDUs to the underlying smart card.
Accessing the Smart Card ¶
- TKSmartCardTokenSession.SmartCard: The smart card for the active exclusive session and selected application.
Instance Methods ¶
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardTokenSession
func NewTKSmartCardTokenSession ¶
func NewTKSmartCardTokenSession() TKSmartCardTokenSession
NewTKSmartCardTokenSession creates a new TKSmartCardTokenSession instance.
func NewTKSmartCardTokenSessionWithToken ¶
func NewTKSmartCardTokenSessionWithToken(token ITKToken) TKSmartCardTokenSession
Initializes a token session with the specified token.
token: The token to which the initialized session is bound.
Return Value ¶
A new token session created with the specified token.
Discussion ¶
This is the designated initializer.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenSession/init(token:)
func TKSmartCardTokenSessionFromID ¶
func TKSmartCardTokenSessionFromID(id objc.ID) TKSmartCardTokenSession
TKSmartCardTokenSessionFromID constructs a TKSmartCardTokenSession from an objc.ID.
A token session that is based on a smart card token.
func (TKSmartCardTokenSession) Autorelease ¶
func (t TKSmartCardTokenSession) Autorelease() TKSmartCardTokenSession
Autorelease adds the receiver to the current autorelease pool.
func (TKSmartCardTokenSession) GetSmartCardWithError ¶
func (t TKSmartCardTokenSession) GetSmartCardWithError() (ITKSmartCard, error)
Discussion ¶
Returns a TKSmartCard instance with an active exclusive session and the SmartCard application selected. Replaces the deprecated @c smartCard property.
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.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardTokenSession/getSmartCard()
func (TKSmartCardTokenSession) Init ¶
func (t TKSmartCardTokenSession) Init() TKSmartCardTokenSession
Init initializes the instance.
func (TKSmartCardTokenSession) SmartCard ¶
func (t TKSmartCardTokenSession) SmartCard() ITKSmartCard
The smart card for the active exclusive session and selected application.
Discussion ¶
This property can only be accessed in the implementation of a TKTokenSessionDelegate protocol delegate method. If the associated token has a value set for the TKSmartCardToken.AID property, this property opens an exclusive session to the card, with the application already selected.
You should not call TKSmartCard.BeginSessionWithReply or TKSmartCard.EndSession on the returned value. Instead, the system will take care of beginning the exclusive session and terminating it when the current token request servicing is finished.
You can store any kind of information representing state of the card using the TKSmartCard.Context property. This property will be automatically set to `nil` if the card is reset or accessed by different TKSmartCard instance, such as by another process. You can check the TKSmartCard.Context property for any previously stored values as a way to avoid costly state restoration before performing an operation.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardTokenSession/smartCard
type TKSmartCardTokenSessionClass ¶
type TKSmartCardTokenSessionClass struct {
// contains filtered or unexported fields
}
func GetTKSmartCardTokenSessionClass ¶
func GetTKSmartCardTokenSessionClass() TKSmartCardTokenSessionClass
GetTKSmartCardTokenSessionClass returns the class object for TKSmartCardTokenSession.
func (TKSmartCardTokenSessionClass) Alloc ¶
func (tc TKSmartCardTokenSessionClass) Alloc() TKSmartCardTokenSession
Alloc allocates memory for a new instance of the class.
func (TKSmartCardTokenSessionClass) Class ¶
func (tc TKSmartCardTokenSessionClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKSmartCardUserInteraction ¶
type TKSmartCardUserInteraction struct {
objectivec.Object
}
The base class for encapsulating user interaction with a Smart Card reader.
Overview ¶
There are two types of user interactions: those for secure PIN change and those for secure PIN validation. These interactions are instances of the TKSmartCardUserInteractionForSecurePINChange, or TKSmartCardUserInteractionForSecurePINVerification subclasses of TKSmartCardUserInteractionForPINOperation, respectively. TKSmartCardUserInteractionForPINOperation is a subclass of TKSmartCardUserInteraction.
You interact with instances of one of the subclasses of [TKSmartCardUserInteractionForPINOperation]when calling the TKSmartCard.UserInteractionForSecurePINChangeWithPINFormatAPDUCurrentPINByteOffsetNewPINByteOffset and TKSmartCard.UserInteractionForSecurePINVerificationWithPINFormatAPDUPINByteOffset methods on an TKSmartCard object.
Handling User Interaction Events ¶
- TKSmartCardUserInteraction.Delegate: The delegate for observing events that occur during the user interaction.
- TKSmartCardUserInteraction.SetDelegate
Configuring Timeout ¶
- TKSmartCardUserInteraction.InitialTimeout: The timeout, in seconds, for initial interaction. If set to `0`, the reader-defined default timeout is used. `0` by default.
- TKSmartCardUserInteraction.SetInitialTimeout
- TKSmartCardUserInteraction.InteractionTimeout: The timeout, in seconds, after the first key stroke. If set to `0`, the reader-defined default timeout is used. `0` by default.
- TKSmartCardUserInteraction.SetInteractionTimeout
Starting and Stopping ¶
- TKSmartCardUserInteraction.RunWithReply: Runs the user interaction and asynchronously receives a reply.
- TKSmartCardUserInteraction.Cancel: Attempts to cancel an interaction started by calling [run(reply:)](<https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardUserInteraction/run(reply:)>). For certain interactions, cancellation may not be available.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardUserInteraction
func NewTKSmartCardUserInteraction ¶
func NewTKSmartCardUserInteraction() TKSmartCardUserInteraction
NewTKSmartCardUserInteraction creates a new TKSmartCardUserInteraction instance.
func TKSmartCardUserInteractionFromID ¶
func TKSmartCardUserInteractionFromID(id objc.ID) TKSmartCardUserInteraction
TKSmartCardUserInteractionFromID constructs a TKSmartCardUserInteraction from an objc.ID.
The base class for encapsulating user interaction with a Smart Card reader.
func (TKSmartCardUserInteraction) Autorelease ¶
func (t TKSmartCardUserInteraction) Autorelease() TKSmartCardUserInteraction
Autorelease adds the receiver to the current autorelease pool.
func (TKSmartCardUserInteraction) Cancel ¶
func (t TKSmartCardUserInteraction) Cancel() bool
Attempts to cancel an interaction started by calling TKSmartCardUserInteraction.RunWithReply. For certain interactions, cancellation may not be available.
Return Value ¶
Returns false if the operation is not running, or if cancelation is not supported.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardUserInteraction/cancel()
func (TKSmartCardUserInteraction) Delegate ¶
func (t TKSmartCardUserInteraction) Delegate() TKSmartCardUserInteractionDelegate
The delegate for observing events that occur during the user interaction.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardUserInteraction/delegate
func (TKSmartCardUserInteraction) Init ¶
func (t TKSmartCardUserInteraction) Init() TKSmartCardUserInteraction
Init initializes the instance.
func (TKSmartCardUserInteraction) InitialTimeout ¶
func (t TKSmartCardUserInteraction) InitialTimeout() foundation.NSTimeInterval
The timeout, in seconds, for initial interaction. If set to `0`, the reader-defined default timeout is used. `0` by default.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardUserInteraction/initialTimeout
func (TKSmartCardUserInteraction) InteractionTimeout ¶
func (t TKSmartCardUserInteraction) InteractionTimeout() foundation.NSTimeInterval
The timeout, in seconds, after the first key stroke. If set to `0`, the reader-defined default timeout is used. `0` by default.
func (TKSmartCardUserInteraction) RunWithReply ¶
func (t TKSmartCardUserInteraction) RunWithReply(reply BoolErrorHandler)
Runs the user interaction and asynchronously receives a reply.
reply: success: Whether the user interaction was successful. error: Contains information about the the error that occurred during the user interaction.
The [NSError] object is created in the TKErrorDomain domain with a code in the TKError.Code enumeration.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardUserInteraction/run(reply:)
func (TKSmartCardUserInteraction) RunWithReplySync ¶
func (t TKSmartCardUserInteraction) RunWithReplySync(ctx context.Context) (bool, error)
RunWithReplySync is a synchronous wrapper around TKSmartCardUserInteraction.RunWithReply. It blocks until the completion handler fires or the context is cancelled.
func (TKSmartCardUserInteraction) SetDelegate ¶
func (t TKSmartCardUserInteraction) SetDelegate(value TKSmartCardUserInteractionDelegate)
func (TKSmartCardUserInteraction) SetInitialTimeout ¶
func (t TKSmartCardUserInteraction) SetInitialTimeout(value foundation.NSTimeInterval)
func (TKSmartCardUserInteraction) SetInteractionTimeout ¶
func (t TKSmartCardUserInteraction) SetInteractionTimeout(value foundation.NSTimeInterval)
type TKSmartCardUserInteractionClass ¶
type TKSmartCardUserInteractionClass struct {
// contains filtered or unexported fields
}
func GetTKSmartCardUserInteractionClass ¶
func GetTKSmartCardUserInteractionClass() TKSmartCardUserInteractionClass
GetTKSmartCardUserInteractionClass returns the class object for TKSmartCardUserInteraction.
func (TKSmartCardUserInteractionClass) Alloc ¶
func (tc TKSmartCardUserInteractionClass) Alloc() TKSmartCardUserInteraction
Alloc allocates memory for a new instance of the class.
func (TKSmartCardUserInteractionClass) Class ¶
func (tc TKSmartCardUserInteractionClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKSmartCardUserInteractionDelegate ¶
type TKSmartCardUserInteractionDelegate interface {
objectivec.IObject
}
The interface implemented by a Smart Card user interaction delegate to handle user interaction events.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardUserInteractionDelegate
type TKSmartCardUserInteractionDelegateConfig ¶
type TKSmartCardUserInteractionDelegateConfig struct {
// Other Methods
// CharacterEnteredInUserInteraction — Tells the delegate that a valid character has been entered.
CharacterEnteredInUserInteraction func(interaction TKSmartCardUserInteraction)
// CorrectionKeyPressedInUserInteraction — Tells the delegate that a correction key has been pressed.
CorrectionKeyPressedInUserInteraction func(interaction TKSmartCardUserInteraction)
// ValidationKeyPressedInUserInteraction — Tells the delegate that the validation key has been pressed, indicating the end of PIN entry.
ValidationKeyPressedInUserInteraction func(interaction TKSmartCardUserInteraction)
// InvalidCharacterEnteredInUserInteraction — Tells the delegate that an invalid character has been entered.
InvalidCharacterEnteredInUserInteraction func(interaction TKSmartCardUserInteraction)
// OldPINRequestedInUserInteraction — Tells the delegate that the old PIN needs to be entered.
OldPINRequestedInUserInteraction func(interaction TKSmartCardUserInteraction)
// NewPINRequestedInUserInteraction — Tells the delegate that the new PIN needs to be entered.
NewPINRequestedInUserInteraction func(interaction TKSmartCardUserInteraction)
// NewPINConfirmationRequestedInUserInteraction — Tells the delegate that the new PIN needs to be re-entered for confirmation.
NewPINConfirmationRequestedInUserInteraction func(interaction TKSmartCardUserInteraction)
}
TKSmartCardUserInteractionDelegateConfig holds optional typed callbacks for TKSmartCardUserInteractionDelegate methods. Set non-nil fields to register the corresponding Objective-C delegate method. Methods with nil callbacks are not registered, so [NSObject.RespondsToSelector] returns false for them — matching the Objective-C delegate pattern exactly.
See Apple Documentation for protocol details.
type TKSmartCardUserInteractionDelegateObject ¶
type TKSmartCardUserInteractionDelegateObject struct {
objectivec.Object
}
TKSmartCardUserInteractionDelegateObject wraps an existing Objective-C object that conforms to the TKSmartCardUserInteractionDelegate protocol.
func NewTKSmartCardUserInteractionDelegate ¶
func NewTKSmartCardUserInteractionDelegate(config TKSmartCardUserInteractionDelegateConfig) TKSmartCardUserInteractionDelegateObject
NewTKSmartCardUserInteractionDelegate creates an Objective-C object implementing the TKSmartCardUserInteractionDelegate protocol.
Each call registers a unique Objective-C class containing only the methods set in config. This means [NSObject.RespondsToSelector] works correctly for optional delegate methods — only non-nil callbacks are registered.
The returned TKSmartCardUserInteractionDelegateObject satisfies the TKSmartCardUserInteractionDelegate interface and can be passed directly to SetDelegate and similar methods.
See Apple Documentation for protocol details.
func TKSmartCardUserInteractionDelegateObjectFromID ¶
func TKSmartCardUserInteractionDelegateObjectFromID(id objc.ID) TKSmartCardUserInteractionDelegateObject
TKSmartCardUserInteractionDelegateObjectFromID constructs a TKSmartCardUserInteractionDelegateObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (TKSmartCardUserInteractionDelegateObject) BaseObject ¶
func (o TKSmartCardUserInteractionDelegateObject) BaseObject() objectivec.Object
func (TKSmartCardUserInteractionDelegateObject) CharacterEnteredInUserInteraction ¶
func (o TKSmartCardUserInteractionDelegateObject) CharacterEnteredInUserInteraction(interaction ITKSmartCardUserInteraction)
Tells the delegate that a valid character has been entered.
interaction: The user interaction.
func (TKSmartCardUserInteractionDelegateObject) CorrectionKeyPressedInUserInteraction ¶
func (o TKSmartCardUserInteractionDelegateObject) CorrectionKeyPressedInUserInteraction(interaction ITKSmartCardUserInteraction)
Tells the delegate that a correction key has been pressed.
interaction: The user interaction.
func (TKSmartCardUserInteractionDelegateObject) InvalidCharacterEnteredInUserInteraction ¶
func (o TKSmartCardUserInteractionDelegateObject) InvalidCharacterEnteredInUserInteraction(interaction ITKSmartCardUserInteraction)
Tells the delegate that an invalid character has been entered.
interaction: The user interaction.
func (TKSmartCardUserInteractionDelegateObject) NewPINConfirmationRequestedInUserInteraction ¶
func (o TKSmartCardUserInteractionDelegateObject) NewPINConfirmationRequestedInUserInteraction(interaction ITKSmartCardUserInteraction)
Tells the delegate that the new PIN needs to be re-entered for confirmation.
interaction: The user interaction.
func (TKSmartCardUserInteractionDelegateObject) NewPINRequestedInUserInteraction ¶
func (o TKSmartCardUserInteractionDelegateObject) NewPINRequestedInUserInteraction(interaction ITKSmartCardUserInteraction)
Tells the delegate that the new PIN needs to be entered.
interaction: The user interaction.
func (TKSmartCardUserInteractionDelegateObject) OldPINRequestedInUserInteraction ¶
func (o TKSmartCardUserInteractionDelegateObject) OldPINRequestedInUserInteraction(interaction ITKSmartCardUserInteraction)
Tells the delegate that the old PIN needs to be entered.
interaction: The user interaction.
func (TKSmartCardUserInteractionDelegateObject) ValidationKeyPressedInUserInteraction ¶
func (o TKSmartCardUserInteractionDelegateObject) ValidationKeyPressedInUserInteraction(interaction ITKSmartCardUserInteraction)
Tells the delegate that the validation key has been pressed, indicating the end of PIN entry.
interaction: The user interaction.
type TKSmartCardUserInteractionForPINOperation ¶
type TKSmartCardUserInteractionForPINOperation struct {
TKSmartCardUserInteraction
}
A representation of user interaction for secure PIN operations on a Smart Card reader.
Overview ¶
There are two types of user interactions: those for secure PIN change and those for secure PIN validation. These interactions are instances of the TKSmartCardUserInteractionForSecurePINChange, or TKSmartCardUserInteractionForSecurePINVerification subclasses of TKSmartCardUserInteractionForPINOperation, respectively.
You interact with instances of one of the subclasses of TKSmartCardUserInteractionForPINOperation when calling the TKSmartCard.UserInteractionForSecurePINChangeWithPINFormatAPDUCurrentPINByteOffsetNewPINByteOffset and TKSmartCard.UserInteractionForSecurePINVerificationWithPINFormatAPDUPINByteOffset methods on an TKSmartCard object.
The result of a user interaction is available once the interaction has completed.
Managing Pin Completion ¶
- TKSmartCardUserInteractionForPINOperation.PINCompletion: The conditions under which PIN entry should be considered complete.
- TKSmartCardUserInteractionForPINOperation.SetPINCompletion
Configuring Messages ¶
- TKSmartCardUserInteractionForPINOperation.PINMessageIndices: A list of message indices referring to a predefined message table, used to specify the type and number of messages displayed during the PIN operation. `nil` by default.
- TKSmartCardUserInteractionForPINOperation.SetPINMessageIndices
- TKSmartCardUserInteractionForPINOperation.Locale: The locale for the displayed messages. If `nil`, the user’s current locale is used. By default, this value is the current locale of the system.
- TKSmartCardUserInteractionForPINOperation.SetLocale
Accessing Response Data ¶
- TKSmartCardUserInteractionForPINOperation.ResultSW: The SW1-SW2 status bytes.
- TKSmartCardUserInteractionForPINOperation.SetResultSW
- TKSmartCardUserInteractionForPINOperation.ResultData: The returned data without SW1-SW2 bytes, if any.
- TKSmartCardUserInteractionForPINOperation.SetResultData
See: https://developer.apple.com/documentation/CryptoTokenKit/TKSmartCardUserInteractionForPINOperation
func NewTKSmartCardUserInteractionForPINOperation ¶
func NewTKSmartCardUserInteractionForPINOperation() TKSmartCardUserInteractionForPINOperation
NewTKSmartCardUserInteractionForPINOperation creates a new TKSmartCardUserInteractionForPINOperation instance.
func TKSmartCardUserInteractionForPINOperationFromID ¶
func TKSmartCardUserInteractionForPINOperationFromID(id objc.ID) TKSmartCardUserInteractionForPINOperation
TKSmartCardUserInteractionForPINOperationFromID constructs a TKSmartCardUserInteractionForPINOperation from an objc.ID.
A representation of user interaction for secure PIN operations on a Smart Card reader.
func (TKSmartCardUserInteractionForPINOperation) Autorelease ¶
func (t TKSmartCardUserInteractionForPINOperation) Autorelease() TKSmartCardUserInteractionForPINOperation
Autorelease adds the receiver to the current autorelease pool.
func (TKSmartCardUserInteractionForPINOperation) Locale ¶
func (t TKSmartCardUserInteractionForPINOperation) Locale() foundation.NSLocale
The locale for the displayed messages. If `nil`, the user’s current locale is used. By default, this value is the current locale of the system.
func (TKSmartCardUserInteractionForPINOperation) PINCompletion ¶
func (t TKSmartCardUserInteractionForPINOperation) PINCompletion() TKSmartCardPINCompletion
The conditions under which PIN entry should be considered complete.
func (TKSmartCardUserInteractionForPINOperation) PINMessageIndices ¶
func (t TKSmartCardUserInteractionForPINOperation) PINMessageIndices() []foundation.NSNumber
A list of message indices referring to a predefined message table, used to specify the type and number of messages displayed during the PIN operation. `nil` by default.
Discussion ¶
If `nil`, the reader does not display any message (reader specific). Typically, PIN verification takes 1 message; PIN modification takes 1 – 3 messages.
func (TKSmartCardUserInteractionForPINOperation) ResultData ¶
func (t TKSmartCardUserInteractionForPINOperation) ResultData() foundation.NSData
The returned data without SW1-SW2 bytes, if any.
func (TKSmartCardUserInteractionForPINOperation) ResultSW ¶
func (t TKSmartCardUserInteractionForPINOperation) ResultSW() uint16
The SW1-SW2 status bytes.
func (TKSmartCardUserInteractionForPINOperation) SetLocale ¶
func (t TKSmartCardUserInteractionForPINOperation) SetLocale(value foundation.NSLocale)
func (TKSmartCardUserInteractionForPINOperation) SetPINCompletion ¶
func (t TKSmartCardUserInteractionForPINOperation) SetPINCompletion(value TKSmartCardPINCompletion)
func (TKSmartCardUserInteractionForPINOperation) SetPINMessageIndices ¶
func (t TKSmartCardUserInteractionForPINOperation) SetPINMessageIndices(value []foundation.NSNumber)
func (TKSmartCardUserInteractionForPINOperation) SetResultData ¶
func (t TKSmartCardUserInteractionForPINOperation) SetResultData(value foundation.NSData)
func (TKSmartCardUserInteractionForPINOperation) SetResultSW ¶
func (t TKSmartCardUserInteractionForPINOperation) SetResultSW(value uint16)
type TKSmartCardUserInteractionForPINOperationClass ¶
type TKSmartCardUserInteractionForPINOperationClass struct {
// contains filtered or unexported fields
}
func GetTKSmartCardUserInteractionForPINOperationClass ¶
func GetTKSmartCardUserInteractionForPINOperationClass() TKSmartCardUserInteractionForPINOperationClass
GetTKSmartCardUserInteractionForPINOperationClass returns the class object for TKSmartCardUserInteractionForPINOperation.
func (TKSmartCardUserInteractionForPINOperationClass) Alloc ¶
func (tc TKSmartCardUserInteractionForPINOperationClass) Alloc() TKSmartCardUserInteractionForPINOperation
Alloc allocates memory for a new instance of the class.
func (TKSmartCardUserInteractionForPINOperationClass) Class ¶
func (tc TKSmartCardUserInteractionForPINOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKSmartCardUserInteractionForSecurePINChange ¶
type TKSmartCardUserInteractionForSecurePINChange struct {
TKSmartCardUserInteractionForPINOperation
}
A representation of the user interaction for secure PIN change operations on a Smart Card reader.
Overview ¶
The result of a user interaction is available once the interaction has completed.
Configuring User Interaction ¶
- TKSmartCardUserInteractionForSecurePINChange.PINConfirmation: The way PIN confirmation is requested. TKSmartCardPINConfirmationNone by default.
- TKSmartCardUserInteractionForSecurePINChange.SetPINConfirmation
func NewTKSmartCardUserInteractionForSecurePINChange ¶
func NewTKSmartCardUserInteractionForSecurePINChange() TKSmartCardUserInteractionForSecurePINChange
NewTKSmartCardUserInteractionForSecurePINChange creates a new TKSmartCardUserInteractionForSecurePINChange instance.
func TKSmartCardUserInteractionForSecurePINChangeFromID ¶
func TKSmartCardUserInteractionForSecurePINChangeFromID(id objc.ID) TKSmartCardUserInteractionForSecurePINChange
TKSmartCardUserInteractionForSecurePINChangeFromID constructs a TKSmartCardUserInteractionForSecurePINChange from an objc.ID.
A representation of the user interaction for secure PIN change operations on a Smart Card reader.
func (TKSmartCardUserInteractionForSecurePINChange) Autorelease ¶
func (t TKSmartCardUserInteractionForSecurePINChange) Autorelease() TKSmartCardUserInteractionForSecurePINChange
Autorelease adds the receiver to the current autorelease pool.
func (TKSmartCardUserInteractionForSecurePINChange) Init ¶
func (t TKSmartCardUserInteractionForSecurePINChange) Init() TKSmartCardUserInteractionForSecurePINChange
Init initializes the instance.
func (TKSmartCardUserInteractionForSecurePINChange) PINConfirmation ¶
func (t TKSmartCardUserInteractionForSecurePINChange) PINConfirmation() TKSmartCardPINConfirmation
The way PIN confirmation is requested. TKSmartCardPINConfirmationNone by default.
func (TKSmartCardUserInteractionForSecurePINChange) SetPINConfirmation ¶
func (t TKSmartCardUserInteractionForSecurePINChange) SetPINConfirmation(value TKSmartCardPINConfirmation)
type TKSmartCardUserInteractionForSecurePINChangeClass ¶
type TKSmartCardUserInteractionForSecurePINChangeClass struct {
// contains filtered or unexported fields
}
func GetTKSmartCardUserInteractionForSecurePINChangeClass ¶
func GetTKSmartCardUserInteractionForSecurePINChangeClass() TKSmartCardUserInteractionForSecurePINChangeClass
GetTKSmartCardUserInteractionForSecurePINChangeClass returns the class object for TKSmartCardUserInteractionForSecurePINChange.
func (TKSmartCardUserInteractionForSecurePINChangeClass) Alloc ¶
func (tc TKSmartCardUserInteractionForSecurePINChangeClass) Alloc() TKSmartCardUserInteractionForSecurePINChange
Alloc allocates memory for a new instance of the class.
func (TKSmartCardUserInteractionForSecurePINChangeClass) Class ¶
func (tc TKSmartCardUserInteractionForSecurePINChangeClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKSmartCardUserInteractionForSecurePINVerification ¶
type TKSmartCardUserInteractionForSecurePINVerification struct {
TKSmartCardUserInteractionForPINOperation
}
A representation of the user interaction for secure PIN change verification on a Smart Card reader.
Overview ¶
The result of a user interaction is available once the interaction has completed.
func NewTKSmartCardUserInteractionForSecurePINVerification ¶
func NewTKSmartCardUserInteractionForSecurePINVerification() TKSmartCardUserInteractionForSecurePINVerification
NewTKSmartCardUserInteractionForSecurePINVerification creates a new TKSmartCardUserInteractionForSecurePINVerification instance.
func TKSmartCardUserInteractionForSecurePINVerificationFromID ¶
func TKSmartCardUserInteractionForSecurePINVerificationFromID(id objc.ID) TKSmartCardUserInteractionForSecurePINVerification
TKSmartCardUserInteractionForSecurePINVerificationFromID constructs a TKSmartCardUserInteractionForSecurePINVerification from an objc.ID.
A representation of the user interaction for secure PIN change verification on a Smart Card reader.
func (TKSmartCardUserInteractionForSecurePINVerification) Autorelease ¶
func (t TKSmartCardUserInteractionForSecurePINVerification) Autorelease() TKSmartCardUserInteractionForSecurePINVerification
Autorelease adds the receiver to the current autorelease pool.
func (TKSmartCardUserInteractionForSecurePINVerification) Init ¶
func (t TKSmartCardUserInteractionForSecurePINVerification) Init() TKSmartCardUserInteractionForSecurePINVerification
Init initializes the instance.
type TKSmartCardUserInteractionForSecurePINVerificationClass ¶
type TKSmartCardUserInteractionForSecurePINVerificationClass struct {
// contains filtered or unexported fields
}
func GetTKSmartCardUserInteractionForSecurePINVerificationClass ¶
func GetTKSmartCardUserInteractionForSecurePINVerificationClass() TKSmartCardUserInteractionForSecurePINVerificationClass
GetTKSmartCardUserInteractionForSecurePINVerificationClass returns the class object for TKSmartCardUserInteractionForSecurePINVerification.
func (TKSmartCardUserInteractionForSecurePINVerificationClass) Alloc ¶
func (tc TKSmartCardUserInteractionForSecurePINVerificationClass) Alloc() TKSmartCardUserInteractionForSecurePINVerification
Alloc allocates memory for a new instance of the class.
func (TKSmartCardUserInteractionForSecurePINVerificationClass) Class ¶
func (tc TKSmartCardUserInteractionForSecurePINVerificationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKTLVRecord ¶
type TKTLVRecord struct {
objectivec.Object
}
The base class encapsulating a Tag-Length-Value record.
Overview ¶
The CryptoTokenKit framework provides the following concrete subclasses for various TLV record encodings:
- TKBERTLVRecord for BER-TLV encoding rules - TKSimpleTLVRecord for Simple-TLV encoding according to ISO 7816-4 - TKCompactTLVRecord for Compact-TLV encoding according to ISO 7816-4
Accessing the Tag Field ¶
- TKTLVRecord.Tag: The tag field of the record.
Accessing the Value Field ¶
- TKTLVRecord.Value: The value field of the record.
Accessing Record Data ¶
- TKTLVRecord.Data: The record data, including the tag, length, and value fields.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTLVRecord
func NewTKTLVRecord ¶
func NewTKTLVRecord() TKTLVRecord
NewTKTLVRecord creates a new TKTLVRecord instance.
func NewTKTLVRecordFromData ¶
func NewTKTLVRecordFromData(data foundation.NSData) TKTLVRecord
Creates and returns a TLV record from by parsing the specified data.
data: A data object containing the serialized representation of a TLV record.
Return Value ¶
A TLV record, or `nil` if `data` does not specify a valid record.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTLVRecord/init(from:)
func TKTLVRecordFromID ¶
func TKTLVRecordFromID(id objc.ID) TKTLVRecord
TKTLVRecordFromID constructs a TKTLVRecord from an objc.ID.
The base class encapsulating a Tag-Length-Value record.
func (TKTLVRecord) Autorelease ¶
func (t TKTLVRecord) Autorelease() TKTLVRecord
Autorelease adds the receiver to the current autorelease pool.
func (TKTLVRecord) Data ¶
func (t TKTLVRecord) Data() foundation.NSData
The record data, including the tag, length, and value fields.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTLVRecord/data
func (TKTLVRecord) Tag ¶
func (t TKTLVRecord) Tag() TKTLVTag
The tag field of the record.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTLVRecord/tag
func (TKTLVRecord) Value ¶
func (t TKTLVRecord) Value() foundation.NSData
The value field of the record.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTLVRecord/value
type TKTLVRecordClass ¶
type TKTLVRecordClass struct {
// contains filtered or unexported fields
}
func GetTKTLVRecordClass ¶
func GetTKTLVRecordClass() TKTLVRecordClass
GetTKTLVRecordClass returns the class object for TKTLVRecord.
func (TKTLVRecordClass) Alloc ¶
func (tc TKTLVRecordClass) Alloc() TKTLVRecord
Alloc allocates memory for a new instance of the class.
func (TKTLVRecordClass) Class ¶
func (tc TKTLVRecordClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (TKTLVRecordClass) SequenceOfRecordsFromData ¶
func (_TKTLVRecordClass TKTLVRecordClass) SequenceOfRecordsFromData(data foundation.NSData) []TKTLVRecord
Creates and returns an array of TLV records from the specified data.
data: A data object containing the serialized representation of zero or more TLV records.
Return Value ¶
A sequence of TLV records, or `nil` if `data` does not specify a sequence of valid records.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTLVRecord/sequenceOfRecords(from:)
type TKTLVTag ¶
type TKTLVTag = uint64
TKTLVTag is the type used to identify TLV format tags.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTLVTag
type TKToken ¶
type TKToken struct {
objectivec.Object
}
A representation of a hardware-based cryptographic token.
Overview ¶
Creating Tokens ¶
- TKToken.InitWithTokenDriverInstanceID: Initializes a token with the driver you specify.
Responding to Session Creation ¶
- TKToken.Delegate: The token delegate.
- TKToken.SetDelegate
Accessing the Driver ¶
- TKToken.TokenDriver: The token driver.
Accessing Keychain Items ¶
- TKToken.KeychainContents: The contents of the keychain for this token.
Configuring the Token ¶
- TKToken.Configuration: The current configuration for a token.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKToken
func NewTKTokenWithTokenDriverInstanceID ¶
func NewTKTokenWithTokenDriverInstanceID(tokenDriver ITKTokenDriver, instanceID TKTokenInstanceID) TKToken
Initializes a token with the driver you specify.
tokenDriver: The driver of the token.
instanceID: A unique, persistent identifier for this token. This value is typically generated from the serial number of the target hardware.
Return Value ¶
A new token object.
Discussion ¶
This is the designated initializer.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKToken/init(tokenDriver:instanceID:)
func TKTokenFromID ¶
TKTokenFromID constructs a TKToken from an objc.ID.
A representation of a hardware-based cryptographic token.
func (TKToken) Autorelease ¶
Autorelease adds the receiver to the current autorelease pool.
func (TKToken) Configuration ¶
func (t TKToken) Configuration() ITKTokenConfiguration
The current configuration for a token.
Discussion ¶
Access keychain items exported by this token with the methods TKTokenConfiguration.KeyForObjectIDError and TKTokenConfiguration.CertificateForObjectIDError provided by the configuration. You can access token-implementation-specific additional data using the TKTokenConfiguration.ConfigurationData property of the configuration.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKToken/configuration-swift.property
func (TKToken) Delegate ¶
func (t TKToken) Delegate() TKTokenDelegate
The token delegate.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKToken/delegate
func (TKToken) InitWithTokenDriverInstanceID ¶
func (t TKToken) InitWithTokenDriverInstanceID(tokenDriver ITKTokenDriver, instanceID TKTokenInstanceID) TKToken
Initializes a token with the driver you specify.
tokenDriver: The driver of the token.
instanceID: A unique, persistent identifier for this token. This value is typically generated from the serial number of the target hardware.
Return Value ¶
A new token object.
Discussion ¶
This is the designated initializer.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKToken/init(tokenDriver:instanceID:)
func (TKToken) KeychainContents ¶
func (t TKToken) KeychainContents() ITKTokenKeychainContents
The contents of the keychain for this token.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKToken/keychainContents
func (TKToken) SetDelegate ¶
func (t TKToken) SetDelegate(value TKTokenDelegate)
func (TKToken) TokenDriver ¶
func (t TKToken) TokenDriver() ITKTokenDriver
The token driver.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKToken/tokenDriver
type TKTokenAuthOperation ¶
type TKTokenAuthOperation struct {
objectivec.Object
}
An authentication operation for a cryptographic token.
Overview ¶
The CryptoTokenKit framework provides the following concrete subclasses: TKTokenPasswordAuthOperation, for password-based authentication, and TKTokenSmartCardPINAuthOperation for Smart Card PIN-based authentication.
Finishing the Operation ¶
- TKTokenAuthOperation.FinishWithError: Finishes the authentication operation.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenAuthOperation
func NewTKTokenAuthOperation ¶
func NewTKTokenAuthOperation() TKTokenAuthOperation
NewTKTokenAuthOperation creates a new TKTokenAuthOperation instance.
func TKTokenAuthOperationFromID ¶
func TKTokenAuthOperationFromID(id objc.ID) TKTokenAuthOperation
TKTokenAuthOperationFromID constructs a TKTokenAuthOperation from an objc.ID.
An authentication operation for a cryptographic token.
func (TKTokenAuthOperation) Autorelease ¶
func (t TKTokenAuthOperation) Autorelease() TKTokenAuthOperation
Autorelease adds the receiver to the current autorelease pool.
func (TKTokenAuthOperation) EncodeWithCoder ¶
func (t TKTokenAuthOperation) EncodeWithCoder(coder foundation.INSCoder)
func (TKTokenAuthOperation) FinishWithError ¶
func (t TKTokenAuthOperation) FinishWithError() (bool, error)
Finishes the authentication operation.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenAuthOperation/finish()
func (TKTokenAuthOperation) Init ¶
func (t TKTokenAuthOperation) Init() TKTokenAuthOperation
Init initializes the instance.
type TKTokenAuthOperationClass ¶
type TKTokenAuthOperationClass struct {
// contains filtered or unexported fields
}
func GetTKTokenAuthOperationClass ¶
func GetTKTokenAuthOperationClass() TKTokenAuthOperationClass
GetTKTokenAuthOperationClass returns the class object for TKTokenAuthOperation.
func (TKTokenAuthOperationClass) Alloc ¶
func (tc TKTokenAuthOperationClass) Alloc() TKTokenAuthOperation
Alloc allocates memory for a new instance of the class.
func (TKTokenAuthOperationClass) Class ¶
func (tc TKTokenAuthOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKTokenClass ¶
type TKTokenClass struct {
// contains filtered or unexported fields
}
func GetTKTokenClass ¶
func GetTKTokenClass() TKTokenClass
GetTKTokenClass returns the class object for TKToken.
func (TKTokenClass) Alloc ¶
func (tc TKTokenClass) Alloc() TKToken
Alloc allocates memory for a new instance of the class.
func (TKTokenClass) Class ¶
func (tc TKTokenClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKTokenConfiguration ¶
type TKTokenConfiguration struct {
objectivec.Object
}
A token’s configuration.
Overview ¶
When you introduce a new TKTokenConfiguration into the system, it can inform the system about its identities, consisting of both private keys and certificates, which the TKTokenConfiguration.KeychainItems property provides. Use the TKTokenConfiguration.ConfigurationData property to set additional configuration data.
You configure always-available tokens on a per-user basis. Although the token driver and the app hosting the token extension are shared across the system, the configuration for a token is stored individually for each user.
Reporting Configuration Information ¶
- TKTokenConfiguration.InstanceID: The unique, persistent identifier of this token that the token implementation creates.
- TKTokenConfiguration.ConfigurationData: Additional configuration information for the token instance.
- TKTokenConfiguration.SetConfigurationData
Retrieving Keys and Certificates ¶
- TKTokenConfiguration.KeychainItems: The keychain items associated with this token.
- TKTokenConfiguration.SetKeychainItems
- TKTokenConfiguration.CertificateForObjectIDError: Returns a certificate from the keychain with the object identifier you specify.
- TKTokenConfiguration.KeyForObjectIDError: Returns a key from the keychain with the object identifier you specify.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKToken/Configuration-swift.class
func NewTKTokenConfiguration ¶
func NewTKTokenConfiguration() TKTokenConfiguration
NewTKTokenConfiguration creates a new TKTokenConfiguration instance.
func TKTokenConfigurationFromID ¶
func TKTokenConfigurationFromID(id objc.ID) TKTokenConfiguration
TKTokenConfigurationFromID constructs a TKTokenConfiguration from an objc.ID.
A token’s configuration.
func (TKTokenConfiguration) Autorelease ¶
func (t TKTokenConfiguration) Autorelease() TKTokenConfiguration
Autorelease adds the receiver to the current autorelease pool.
func (TKTokenConfiguration) CertificateForObjectIDError ¶
func (t TKTokenConfiguration) CertificateForObjectIDError(objectID TKTokenObjectID) (ITKTokenKeychainCertificate, error)
Returns a certificate from the keychain with the object identifier you specify.
objectID: The identifier for the certificate within the keychain.
Return Value ¶
The certificate that the keychain stores.
Discussion ¶
If the certificate the `objectID` specifies isn’t found, the system fills `error` with TKError.Code.objectNotFound.
func (TKTokenConfiguration) ConfigurationData ¶
func (t TKTokenConfiguration) ConfigurationData() foundation.NSData
Additional configuration information for the token instance.
Discussion ¶
TKTokenConfiguration.ConfigurationData can provide token-implementation-specific additional data, which the app that hosts the token driver extension and configures the token provides. The system doesn’t interpret this data in any way.
For example, the network-based hardware security module (HSM) can store encoded target network addresses, access credentials, or the list of identities the HSM contains.
func (TKTokenConfiguration) Init ¶
func (t TKTokenConfiguration) Init() TKTokenConfiguration
Init initializes the instance.
func (TKTokenConfiguration) InstanceID ¶
func (t TKTokenConfiguration) InstanceID() TKTokenInstanceID
The unique, persistent identifier of this token that the token implementation creates.
Discussion ¶
The instance identifier often represents some kind of serial number of the target hardware.
func (TKTokenConfiguration) KeyForObjectIDError ¶
func (t TKTokenConfiguration) KeyForObjectIDError(objectID TKTokenObjectID) (ITKTokenKeychainKey, error)
Returns a key from the keychain with the object identifier you specify.
objectID: The identifier for the key within the keychain.
Return Value ¶
The key that the keychain stores.
Discussion ¶
If the key the `objectID` specifies isn’t found, the system fills the `error` with TKError.Code.objectNotFound.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKToken/Configuration-swift.class/key(for:)
func (TKTokenConfiguration) KeychainItems ¶
func (t TKTokenConfiguration) KeychainItems() []TKTokenKeychainItem
The keychain items associated with this token.
func (TKTokenConfiguration) SetConfigurationData ¶
func (t TKTokenConfiguration) SetConfigurationData(value foundation.NSData)
func (TKTokenConfiguration) SetKeychainItems ¶
func (t TKTokenConfiguration) SetKeychainItems(value []TKTokenKeychainItem)
type TKTokenConfigurationClass ¶
type TKTokenConfigurationClass struct {
// contains filtered or unexported fields
}
func GetTKTokenConfigurationClass ¶
func GetTKTokenConfigurationClass() TKTokenConfigurationClass
GetTKTokenConfigurationClass returns the class object for TKTokenConfiguration.
func (TKTokenConfigurationClass) Alloc ¶
func (tc TKTokenConfigurationClass) Alloc() TKTokenConfiguration
Alloc allocates memory for a new instance of the class.
func (TKTokenConfigurationClass) Class ¶
func (tc TKTokenConfigurationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKTokenDelegate ¶
type TKTokenDelegate interface {
objectivec.IObject
// Tells the delegate to create a session for the specified token.
//
// See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenDelegate/createSession(_:)
TokenCreateSessionWithError(token ITKToken) (ITKTokenSession, error)
}
The interface that a token delegate implements to respond to session creation events.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenDelegate
type TKTokenDelegateConfig ¶
type TKTokenDelegateConfig struct {
// Delegate Methods
// TokenTerminateSession — Tells the delegate to terminate the specified token session.
TokenTerminateSession func(token TKToken, session TKTokenSession)
// Other Methods
// TokenCreateSessionWithError — Tells the delegate to create a session for the specified token.
TokenCreateSessionWithError func(token TKToken, error_ foundation.NSError) TKTokenSession
}
TKTokenDelegateConfig holds optional typed callbacks for TKTokenDelegate methods. Set non-nil fields to register the corresponding Objective-C delegate method. Methods with nil callbacks are not registered, so [NSObject.RespondsToSelector] returns false for them — matching the Objective-C delegate pattern exactly.
See Apple Documentation for protocol details.
type TKTokenDelegateObject ¶
type TKTokenDelegateObject struct {
objectivec.Object
}
TKTokenDelegateObject wraps an existing Objective-C object that conforms to the TKTokenDelegate protocol.
func NewTKTokenDelegate ¶
func NewTKTokenDelegate(config TKTokenDelegateConfig) TKTokenDelegateObject
NewTKTokenDelegate creates an Objective-C object implementing the TKTokenDelegate protocol.
Each call registers a unique Objective-C class containing only the methods set in config. This means [NSObject.RespondsToSelector] works correctly for optional delegate methods — only non-nil callbacks are registered.
The returned TKTokenDelegateObject satisfies the TKTokenDelegate interface and can be passed directly to SetDelegate and similar methods.
See Apple Documentation for protocol details.
func TKTokenDelegateObjectFromID ¶
func TKTokenDelegateObjectFromID(id objc.ID) TKTokenDelegateObject
TKTokenDelegateObjectFromID constructs a TKTokenDelegateObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (TKTokenDelegateObject) BaseObject ¶
func (o TKTokenDelegateObject) BaseObject() objectivec.Object
func (TKTokenDelegateObject) TokenCreateSessionWithError ¶
func (o TKTokenDelegateObject) TokenCreateSessionWithError(token ITKToken) (ITKTokenSession, error)
Tells the delegate to create a session for the specified token.
token: The token.
Return Value ¶
A new token session, or `nil` if an error occurred.
Discussion ¶
All operations for a token are performed within a session representing an authentication context. This delegate method is called whenever new authentication context is needed. For example, a client may want to perform a token operation using a keychain object that has an associated [LAContext].
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenDelegate/createSession(_:)
func (TKTokenDelegateObject) TokenTerminateSession ¶
func (o TKTokenDelegateObject) TokenTerminateSession(token ITKToken, session ITKTokenSession)
Tells the delegate to terminate the specified token session.
token: The token.
session: The token session to be terminated.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenDelegate/token(_:terminateSession:)
type TKTokenDriver ¶
type TKTokenDriver struct {
objectivec.Object
}
A base class for building token drivers.
Overview ¶
When using the TKTokenDriver class, implement the TKTokenDriverDelegate protocol with the [TokenDriverTokenForConfigurationError] method, which the system invokes when it requests the creation of a token instance. After you create the token driver, it can examine TKTokenConfiguration.KeychainItems and TKTokenConfiguration.ConfigurationData to implement your desired functionality.
An implementation can also access its associated token configuration using the TKTokenConfiguration property.
Responding to Token Creation ¶
- TKTokenDriver.Delegate: The token driver delegate.
- TKTokenDriver.SetDelegate
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenDriver
func NewTKTokenDriver ¶
func NewTKTokenDriver() TKTokenDriver
NewTKTokenDriver creates a new TKTokenDriver instance.
func TKTokenDriverFromID ¶
func TKTokenDriverFromID(id objc.ID) TKTokenDriver
TKTokenDriverFromID constructs a TKTokenDriver from an objc.ID.
A base class for building token drivers.
func (TKTokenDriver) Autorelease ¶
func (t TKTokenDriver) Autorelease() TKTokenDriver
Autorelease adds the receiver to the current autorelease pool.
func (TKTokenDriver) Delegate ¶
func (t TKTokenDriver) Delegate() TKTokenDriverDelegate
The token driver delegate.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenDriver/delegate
func (TKTokenDriver) Init ¶
func (t TKTokenDriver) Init() TKTokenDriver
Init initializes the instance.
func (TKTokenDriver) SetDelegate ¶
func (t TKTokenDriver) SetDelegate(value TKTokenDriverDelegate)
type TKTokenDriverClass ¶
type TKTokenDriverClass struct {
// contains filtered or unexported fields
}
func GetTKTokenDriverClass ¶
func GetTKTokenDriverClass() TKTokenDriverClass
GetTKTokenDriverClass returns the class object for TKTokenDriver.
func (TKTokenDriverClass) Alloc ¶
func (tc TKTokenDriverClass) Alloc() TKTokenDriver
Alloc allocates memory for a new instance of the class.
func (TKTokenDriverClass) Class ¶
func (tc TKTokenDriverClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKTokenDriverClassID ¶
type TKTokenDriverClassID = string
TKTokenDriverClassID is the type of the class identifier for the token driver.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenDriver/ClassID
type TKTokenDriverConfiguration ¶
type TKTokenDriverConfiguration struct {
objectivec.Object
}
A configuration for one class of token.
Reporting Configuration Information ¶
- TKTokenDriverConfiguration.ClassID: The class identifier of the token driver.
- TKTokenDriverConfiguration.TokenConfigurations: A dictionary of all currently configured tokens for this token class, which the token instance identifier keys.
Adding and Removing Configurations ¶
- TKTokenDriverConfiguration.AddTokenConfigurationForTokenInstanceID: Creates a configuration object for a token with the token instance identifier you specify.
- TKTokenDriverConfiguration.RemoveTokenConfigurationForTokenInstanceID: Removes a configuration for a token with the token instance identifier you specify.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenDriver/Configuration
func NewTKTokenDriverConfiguration ¶
func NewTKTokenDriverConfiguration() TKTokenDriverConfiguration
NewTKTokenDriverConfiguration creates a new TKTokenDriverConfiguration instance.
func TKTokenDriverConfigurationFromID ¶
func TKTokenDriverConfigurationFromID(id objc.ID) TKTokenDriverConfiguration
TKTokenDriverConfigurationFromID constructs a TKTokenDriverConfiguration from an objc.ID.
A configuration for one class of token.
func (TKTokenDriverConfiguration) AddTokenConfigurationForTokenInstanceID ¶
func (t TKTokenDriverConfiguration) AddTokenConfigurationForTokenInstanceID(instanceID TKTokenInstanceID) ITKTokenConfiguration
Creates a configuration object for a token with the token instance identifier you specify.
instanceID: The token’s instance identifier.
Return Value ¶
The configuration class for the token.
Discussion ¶
This method adds the created configuration into the TKTokenDriverConfiguration.TokenConfigurations dictionary. Adding a configuration with an `instanceID` that already exists replaces the existing configuration with a new empty configuration.
func (TKTokenDriverConfiguration) Autorelease ¶
func (t TKTokenDriverConfiguration) Autorelease() TKTokenDriverConfiguration
Autorelease adds the receiver to the current autorelease pool.
func (TKTokenDriverConfiguration) ClassID ¶
func (t TKTokenDriverConfiguration) ClassID() TKTokenDriverClassID
The class identifier of the token driver.
Discussion ¶
The identifier uses a reverse-DNS format, such as `com.ExampleXCUIElementTypeId()`.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenDriver/Configuration/classID
func (TKTokenDriverConfiguration) Init ¶
func (t TKTokenDriverConfiguration) Init() TKTokenDriverConfiguration
Init initializes the instance.
func (TKTokenDriverConfiguration) RemoveTokenConfigurationForTokenInstanceID ¶
func (t TKTokenDriverConfiguration) RemoveTokenConfigurationForTokenInstanceID(instanceID TKTokenInstanceID)
Removes a configuration for a token with the token instance identifier you specify.
instanceID: The token’s instance identifier.
Discussion ¶
The method does nothing if the token configuration you specify doesn’t exist.
func (TKTokenDriverConfiguration) TokenConfigurations ¶
func (t TKTokenDriverConfiguration) TokenConfigurations() foundation.INSDictionary
A dictionary of all currently configured tokens for this token class, which the token instance identifier keys.
type TKTokenDriverConfigurationClass ¶
type TKTokenDriverConfigurationClass struct {
// contains filtered or unexported fields
}
func GetTKTokenDriverConfigurationClass ¶
func GetTKTokenDriverConfigurationClass() TKTokenDriverConfigurationClass
GetTKTokenDriverConfigurationClass returns the class object for TKTokenDriverConfiguration.
func (TKTokenDriverConfigurationClass) Alloc ¶
func (tc TKTokenDriverConfigurationClass) Alloc() TKTokenDriverConfiguration
Alloc allocates memory for a new instance of the class.
func (TKTokenDriverConfigurationClass) Class ¶
func (tc TKTokenDriverConfigurationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (TKTokenDriverConfigurationClass) DriverConfigurations ¶
func (_TKTokenDriverConfigurationClass TKTokenDriverConfigurationClass) DriverConfigurations() foundation.INSDictionary
A dictionary of token class configurations which the class identifier of the token driver keys.
Discussion ¶
If the app hosting the token extension calls this method, it returns a list of configurations for hosted token extensions. Otherwise, this method returns an empty array.
type TKTokenDriverDelegate ¶
type TKTokenDriverDelegate interface {
objectivec.IObject
}
The interface that a token driver delegate implements to respond to token creation events.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenDriverDelegate
type TKTokenDriverDelegateConfig ¶
type TKTokenDriverDelegateConfig struct {
// Creating and Removing Tokens
// TokenDriverTerminateToken — Tells the delegate to terminate the token you specify.
TokenDriverTerminateToken func(driver TKTokenDriver, token TKToken)
// Other Methods
// TokenDriverTokenForConfigurationError — Creates a new token for the configuration you specify.
TokenDriverTokenForConfigurationError func(driver TKTokenDriver, configuration TKTokenConfiguration, error_ foundation.NSError) TKToken
}
TKTokenDriverDelegateConfig holds optional typed callbacks for TKTokenDriverDelegate methods. Set non-nil fields to register the corresponding Objective-C delegate method. Methods with nil callbacks are not registered, so [NSObject.RespondsToSelector] returns false for them — matching the Objective-C delegate pattern exactly.
See Apple Documentation for protocol details.
type TKTokenDriverDelegateObject ¶
type TKTokenDriverDelegateObject struct {
objectivec.Object
}
TKTokenDriverDelegateObject wraps an existing Objective-C object that conforms to the TKTokenDriverDelegate protocol.
func NewTKTokenDriverDelegate ¶
func NewTKTokenDriverDelegate(config TKTokenDriverDelegateConfig) TKTokenDriverDelegateObject
NewTKTokenDriverDelegate creates an Objective-C object implementing the TKTokenDriverDelegate protocol.
Each call registers a unique Objective-C class containing only the methods set in config. This means [NSObject.RespondsToSelector] works correctly for optional delegate methods — only non-nil callbacks are registered.
The returned TKTokenDriverDelegateObject satisfies the TKTokenDriverDelegate interface and can be passed directly to SetDelegate and similar methods.
See Apple Documentation for protocol details.
func TKTokenDriverDelegateObjectFromID ¶
func TKTokenDriverDelegateObjectFromID(id objc.ID) TKTokenDriverDelegateObject
TKTokenDriverDelegateObjectFromID constructs a TKTokenDriverDelegateObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (TKTokenDriverDelegateObject) BaseObject ¶
func (o TKTokenDriverDelegateObject) BaseObject() objectivec.Object
func (TKTokenDriverDelegateObject) TokenDriverTerminateToken ¶
func (o TKTokenDriverDelegateObject) TokenDriverTerminateToken(driver ITKTokenDriver, token ITKToken)
Tells the delegate to terminate the token you specify.
driver: The token driver.
token: The token to be terminated.
func (TKTokenDriverDelegateObject) TokenDriverTokenForConfigurationError ¶
func (o TKTokenDriverDelegateObject) TokenDriverTokenForConfigurationError(driver ITKTokenDriver, configuration ITKTokenConfiguration) (ITKToken, error)
Creates a new token for the configuration you specify.
driver: The token driver.
configuration: The configuration that identifies the token to create.
Return Value ¶
The created token.
Discussion ¶
The system invokes this method to request creation of a token instance, which the TKTokenConfiguration.InstanceID property of the configuration you specify identifies.
The created token has access to its current configuration using the TKTokenConfiguration.ConfigurationData property, which can provide token-implementation-specific additional data. The token can access keychain items this token exports with the methods TKTokenConfiguration.KeyForObjectIDError and TKTokenConfiguration.CertificateForObjectIDError that the configuration provides.
type TKTokenInstanceID ¶
type TKTokenInstanceID = string
TKTokenInstanceID is a type that represents the instance identifier of a token.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKToken/InstanceID
type TKTokenKeyAlgorithm ¶
type TKTokenKeyAlgorithm struct {
objectivec.Object
}
Cryptographic algorithms used by token keys.
Overview ¶
Typically, the supported algorithm for a token key can be represented by a value of the [SecKeyAlgorithm] enumeration. However, tokens such as Smart Cards require that input data for operations take the format of a more specific algorithm. For example, a token may accept raw data to generate a cryptographic signature, but require that raw data to be formatted according to PKCS1 padding rules. To express such a requirement, a TKTokenKeyAlgorithm object defines a target algorithm and a set of other algorithms that were used. In the previous example, the target algorithm is `kSecKeyAlgorithmRSASignatureRaw` and the `kSecKeyAlgorithmRSASignatureDigestPKCS1v15SHA1` algorithm is also reported as being used.
Determining Algorithm Usage ¶
- TKTokenKeyAlgorithm.IsAlgorithm: Returns whether the specified algorithm is the target operation algorithm.
- TKTokenKeyAlgorithm.SupportsAlgorithm: Whether the specified algorithm is the target operation algorithm, or one of the other algorithms used.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeyAlgorithm
func NewTKTokenKeyAlgorithm ¶
func NewTKTokenKeyAlgorithm() TKTokenKeyAlgorithm
NewTKTokenKeyAlgorithm creates a new TKTokenKeyAlgorithm instance.
func TKTokenKeyAlgorithmFromID ¶
func TKTokenKeyAlgorithmFromID(id objc.ID) TKTokenKeyAlgorithm
TKTokenKeyAlgorithmFromID constructs a TKTokenKeyAlgorithm from an objc.ID.
Cryptographic algorithms used by token keys.
func (TKTokenKeyAlgorithm) Autorelease ¶
func (t TKTokenKeyAlgorithm) Autorelease() TKTokenKeyAlgorithm
Autorelease adds the receiver to the current autorelease pool.
func (TKTokenKeyAlgorithm) Init ¶
func (t TKTokenKeyAlgorithm) Init() TKTokenKeyAlgorithm
Init initializes the instance.
func (TKTokenKeyAlgorithm) IsAlgorithm ¶
func (t TKTokenKeyAlgorithm) IsAlgorithm(algorithm corefoundation.CFStringRef) bool
Returns whether the specified algorithm is the target operation algorithm.
algorithm: The algorithm to be checked.
Return Value ¶
true if `algorithm` is the target operation algorithm; otherwise, false.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeyAlgorithm/isAlgorithm(_:)
func (TKTokenKeyAlgorithm) SupportsAlgorithm ¶
func (t TKTokenKeyAlgorithm) SupportsAlgorithm(algorithm corefoundation.CFStringRef) bool
Whether the specified algorithm is the target operation algorithm, or one of the other algorithms used.
algorithm: The algorithm to be checked.
Return Value ¶
true if `algorithm` is the target operation algorithm or one of the other algorithms used; otherwise, false.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeyAlgorithm/supportsAlgorithm(_:)
type TKTokenKeyAlgorithmClass ¶
type TKTokenKeyAlgorithmClass struct {
// contains filtered or unexported fields
}
func GetTKTokenKeyAlgorithmClass ¶
func GetTKTokenKeyAlgorithmClass() TKTokenKeyAlgorithmClass
GetTKTokenKeyAlgorithmClass returns the class object for TKTokenKeyAlgorithm.
func (TKTokenKeyAlgorithmClass) Alloc ¶
func (tc TKTokenKeyAlgorithmClass) Alloc() TKTokenKeyAlgorithm
Alloc allocates memory for a new instance of the class.
func (TKTokenKeyAlgorithmClass) Class ¶
func (tc TKTokenKeyAlgorithmClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKTokenKeyExchangeParameters ¶
type TKTokenKeyExchangeParameters struct {
objectivec.Object
}
Parameters used to perform specific key exchange operations.
Accessing Parameters ¶
- TKTokenKeyExchangeParameters.RequestedSize: Returns the requested output size, in bytes, of key exchange result.
- TKTokenKeyExchangeParameters.SharedInfo: Returns shared information typically used during the key derivation (KDF) step of a key exchange algorithm.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeyExchangeParameters
func NewTKTokenKeyExchangeParameters ¶
func NewTKTokenKeyExchangeParameters() TKTokenKeyExchangeParameters
NewTKTokenKeyExchangeParameters creates a new TKTokenKeyExchangeParameters instance.
func TKTokenKeyExchangeParametersFromID ¶
func TKTokenKeyExchangeParametersFromID(id objc.ID) TKTokenKeyExchangeParameters
TKTokenKeyExchangeParametersFromID constructs a TKTokenKeyExchangeParameters from an objc.ID.
Parameters used to perform specific key exchange operations.
func (TKTokenKeyExchangeParameters) Autorelease ¶
func (t TKTokenKeyExchangeParameters) Autorelease() TKTokenKeyExchangeParameters
Autorelease adds the receiver to the current autorelease pool.
func (TKTokenKeyExchangeParameters) Init ¶
func (t TKTokenKeyExchangeParameters) Init() TKTokenKeyExchangeParameters
Init initializes the instance.
func (TKTokenKeyExchangeParameters) RequestedSize ¶
func (t TKTokenKeyExchangeParameters) RequestedSize() int
Returns the requested output size, in bytes, of key exchange result.
Discussion ¶
This property should be ignored if the output size is not configurable for the specified key exchange algorithm.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeyExchangeParameters/requestedSize
func (TKTokenKeyExchangeParameters) SharedInfo ¶
func (t TKTokenKeyExchangeParameters) SharedInfo() foundation.NSData
Returns shared information typically used during the key derivation (KDF) step of a key exchange algorithm.
Discussion ¶
This property should be ignored if shared information isn’t used by the specified key exchange algorithm.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeyExchangeParameters/sharedInfo
type TKTokenKeyExchangeParametersClass ¶
type TKTokenKeyExchangeParametersClass struct {
// contains filtered or unexported fields
}
func GetTKTokenKeyExchangeParametersClass ¶
func GetTKTokenKeyExchangeParametersClass() TKTokenKeyExchangeParametersClass
GetTKTokenKeyExchangeParametersClass returns the class object for TKTokenKeyExchangeParameters.
func (TKTokenKeyExchangeParametersClass) Alloc ¶
func (tc TKTokenKeyExchangeParametersClass) Alloc() TKTokenKeyExchangeParameters
Alloc allocates memory for a new instance of the class.
func (TKTokenKeyExchangeParametersClass) Class ¶
func (tc TKTokenKeyExchangeParametersClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKTokenKeychainCertificate ¶
type TKTokenKeychainCertificate struct {
TKTokenKeychainItem
}
A token’s certificate as stored in the keychain.
Creating Token Keychain Certificates ¶
- TKTokenKeychainCertificate.InitWithCertificateObjectID: Initializes a token keychain certificate with data from the specified certificate reference and a given object ID.
Accessing Certificate Data ¶
- TKTokenKeychainCertificate.Data: Returns a DER-encoded representation of an X.509 certificate.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainCertificate
func NewTKTokenKeychainCertificate ¶
func NewTKTokenKeychainCertificate() TKTokenKeychainCertificate
NewTKTokenKeychainCertificate creates a new TKTokenKeychainCertificate instance.
func NewTKTokenKeychainCertificateWithCertificateObjectID ¶
func NewTKTokenKeychainCertificateWithCertificateObjectID(certificateRef security.SecCertificateRef, objectID TKTokenObjectID) TKTokenKeychainCertificate
Initializes a token keychain certificate with data from the specified certificate reference and a given object ID.
certificateRef: The certificate reference.
You can create a SecCertificate value from a data object using the SecCertificateCreateWithData(_:_:) function.
objectID: The object ID.
Return Value ¶
A new token keychain certificate.
Discussion ¶
This is the designated initializer.
func NewTKTokenKeychainCertificateWithObjectID ¶
func NewTKTokenKeychainCertificateWithObjectID(objectID TKTokenObjectID) TKTokenKeychainCertificate
Initializes a token keychain item with the specified object ID.
objectID: The object ID.
Return Value ¶
A new keychain item.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainItem/init(objectID:)
func TKTokenKeychainCertificateFromID ¶
func TKTokenKeychainCertificateFromID(id objc.ID) TKTokenKeychainCertificate
TKTokenKeychainCertificateFromID constructs a TKTokenKeychainCertificate from an objc.ID.
A token’s certificate as stored in the keychain.
func (TKTokenKeychainCertificate) Autorelease ¶
func (t TKTokenKeychainCertificate) Autorelease() TKTokenKeychainCertificate
Autorelease adds the receiver to the current autorelease pool.
func (TKTokenKeychainCertificate) Data ¶
func (t TKTokenKeychainCertificate) Data() foundation.NSData
Returns a DER-encoded representation of an X.509 certificate.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainCertificate/data
func (TKTokenKeychainCertificate) Init ¶
func (t TKTokenKeychainCertificate) Init() TKTokenKeychainCertificate
Init initializes the instance.
func (TKTokenKeychainCertificate) InitWithCertificateObjectID ¶
func (t TKTokenKeychainCertificate) InitWithCertificateObjectID(certificateRef security.SecCertificateRef, objectID TKTokenObjectID) TKTokenKeychainCertificate
Initializes a token keychain certificate with data from the specified certificate reference and a given object ID.
certificateRef: The certificate reference.
You can create a SecCertificate value from a data object using the SecCertificateCreateWithData(_:_:) function.
objectID: The object ID.
Return Value ¶
A new token keychain certificate.
Discussion ¶
This is the designated initializer.
type TKTokenKeychainCertificateClass ¶
type TKTokenKeychainCertificateClass struct {
// contains filtered or unexported fields
}
func GetTKTokenKeychainCertificateClass ¶
func GetTKTokenKeychainCertificateClass() TKTokenKeychainCertificateClass
GetTKTokenKeychainCertificateClass returns the class object for TKTokenKeychainCertificate.
func (TKTokenKeychainCertificateClass) Alloc ¶
func (tc TKTokenKeychainCertificateClass) Alloc() TKTokenKeychainCertificate
Alloc allocates memory for a new instance of the class.
func (TKTokenKeychainCertificateClass) Class ¶
func (tc TKTokenKeychainCertificateClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKTokenKeychainContents ¶
type TKTokenKeychainContents struct {
objectivec.Object
}
A representation of the state of the keychain for a particular token.
Adding Keychain Items ¶
- TKTokenKeychainContents.FillWithItems: Fills the keychain with the specified items.
Accessing Keychain Items ¶
- TKTokenKeychainContents.Items: Returns all items for token in the keychain.
- TKTokenKeychainContents.KeyForObjectIDError: Returns the key for a specified object identifier.
- TKTokenKeychainContents.CertificateForObjectIDError: Returns the key for a specified object identifier.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainContents
func NewTKTokenKeychainContents ¶
func NewTKTokenKeychainContents() TKTokenKeychainContents
NewTKTokenKeychainContents creates a new TKTokenKeychainContents instance.
func TKTokenKeychainContentsFromID ¶
func TKTokenKeychainContentsFromID(id objc.ID) TKTokenKeychainContents
TKTokenKeychainContentsFromID constructs a TKTokenKeychainContents from an objc.ID.
A representation of the state of the keychain for a particular token.
func (TKTokenKeychainContents) Autorelease ¶
func (t TKTokenKeychainContents) Autorelease() TKTokenKeychainContents
Autorelease adds the receiver to the current autorelease pool.
func (TKTokenKeychainContents) CertificateForObjectIDError ¶
func (t TKTokenKeychainContents) CertificateForObjectIDError(objectID TKTokenObjectID) (ITKTokenKeychainCertificate, error)
Returns the key for a specified object identifier.
objectID: The object identifier for the keychain item.
Return Value ¶
The certificate, or `nil` if no certificate exists.
func (TKTokenKeychainContents) FillWithItems ¶
func (t TKTokenKeychainContents) FillWithItems(items []TKTokenKeychainItem)
Fills the keychain with the specified items.
items: The items to be added to the keychain.
Discussion ¶
All existing items for the token are first removed from the keychain before filling the keychain with `items`.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainContents/fill(with:)
func (TKTokenKeychainContents) Init ¶
func (t TKTokenKeychainContents) Init() TKTokenKeychainContents
Init initializes the instance.
func (TKTokenKeychainContents) Items ¶
func (t TKTokenKeychainContents) Items() []TKTokenKeychainItem
Returns all items for token in the keychain.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainContents/items
func (TKTokenKeychainContents) KeyForObjectIDError ¶
func (t TKTokenKeychainContents) KeyForObjectIDError(objectID TKTokenObjectID) (ITKTokenKeychainKey, error)
Returns the key for a specified object identifier.
objectID: The object identifier for the keychain item.
Return Value ¶
The key, or `nil` if no key exists.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainContents/key(forObjectID:)
type TKTokenKeychainContentsClass ¶
type TKTokenKeychainContentsClass struct {
// contains filtered or unexported fields
}
func GetTKTokenKeychainContentsClass ¶
func GetTKTokenKeychainContentsClass() TKTokenKeychainContentsClass
GetTKTokenKeychainContentsClass returns the class object for TKTokenKeychainContents.
func (TKTokenKeychainContentsClass) Alloc ¶
func (tc TKTokenKeychainContentsClass) Alloc() TKTokenKeychainContents
Alloc allocates memory for a new instance of the class.
func (TKTokenKeychainContentsClass) Class ¶
func (tc TKTokenKeychainContentsClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKTokenKeychainItem ¶
type TKTokenKeychainItem struct {
objectivec.Object
}
An abstract base class for managing a token’s contents as keychain items.
Overview ¶
Don’t use this base class directly. Instead, use one of its subclasses, such as TKTokenKeychainCertificate for managing certificates or TKTokenKeychainKey for managing cryptographic keys.
Creating Token Keychain Items ¶
- TKTokenKeychainItem.InitWithObjectID: Initializes a token keychain item with the specified object ID.
Accessing Keychain Item Attributes ¶
- TKTokenKeychainItem.ObjectID: Returns the object ID used for keychain item identification.
- TKTokenKeychainItem.Label: The user-visible label for the keychain item.
- TKTokenKeychainItem.SetLabel
- TKTokenKeychainItem.Constraints: Access constraints for the keychain item, keyed by TKTokenOperation(<https://developer.apple.com/documentation/CryptoTokenKit/TKTokenOperation>) values wrapped in [NSNumber](<https://developer.apple.com/documentation/Foundation/NSNumber>) objects.
- TKTokenKeychainItem.SetConstraints
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainItem
func NewTKTokenKeychainItem ¶
func NewTKTokenKeychainItem() TKTokenKeychainItem
NewTKTokenKeychainItem creates a new TKTokenKeychainItem instance.
func NewTKTokenKeychainItemWithObjectID ¶
func NewTKTokenKeychainItemWithObjectID(objectID TKTokenObjectID) TKTokenKeychainItem
Initializes a token keychain item with the specified object ID.
objectID: The object ID.
Return Value ¶
A new keychain item.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainItem/init(objectID:)
func TKTokenKeychainItemFromID ¶
func TKTokenKeychainItemFromID(id objc.ID) TKTokenKeychainItem
TKTokenKeychainItemFromID constructs a TKTokenKeychainItem from an objc.ID.
An abstract base class for managing a token’s contents as keychain items.
func (TKTokenKeychainItem) Autorelease ¶
func (t TKTokenKeychainItem) Autorelease() TKTokenKeychainItem
Autorelease adds the receiver to the current autorelease pool.
func (TKTokenKeychainItem) Constraints ¶
func (t TKTokenKeychainItem) Constraints() foundation.INSDictionary
Access constraints for the keychain item, keyed by TKTokenOperation values wrapped in NSNumber objects.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainItem/constraints
func (TKTokenKeychainItem) Init ¶
func (t TKTokenKeychainItem) Init() TKTokenKeychainItem
Init initializes the instance.
func (TKTokenKeychainItem) InitWithObjectID ¶
func (t TKTokenKeychainItem) InitWithObjectID(objectID TKTokenObjectID) TKTokenKeychainItem
Initializes a token keychain item with the specified object ID.
objectID: The object ID.
Return Value ¶
A new keychain item.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainItem/init(objectID:)
func (TKTokenKeychainItem) Label ¶
func (t TKTokenKeychainItem) Label() string
The user-visible label for the keychain item.
Discussion ¶
This property is equivalent to the `kSecAttrLabel` attribute type.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainItem/label
func (TKTokenKeychainItem) ObjectID ¶
func (t TKTokenKeychainItem) ObjectID() TKTokenObjectID
Returns the object ID used for keychain item identification.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainItem/objectID
func (TKTokenKeychainItem) SetConstraints ¶
func (t TKTokenKeychainItem) SetConstraints(value foundation.INSDictionary)
func (TKTokenKeychainItem) SetLabel ¶
func (t TKTokenKeychainItem) SetLabel(value string)
type TKTokenKeychainItemClass ¶
type TKTokenKeychainItemClass struct {
// contains filtered or unexported fields
}
func GetTKTokenKeychainItemClass ¶
func GetTKTokenKeychainItemClass() TKTokenKeychainItemClass
GetTKTokenKeychainItemClass returns the class object for TKTokenKeychainItem.
func (TKTokenKeychainItemClass) Alloc ¶
func (tc TKTokenKeychainItemClass) Alloc() TKTokenKeychainItem
Alloc allocates memory for a new instance of the class.
func (TKTokenKeychainItemClass) Class ¶
func (tc TKTokenKeychainItemClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKTokenKeychainKey ¶
type TKTokenKeychainKey struct {
TKTokenKeychainItem
}
A token’s key as stored in the keychain.
Creating Token Keychain Keys ¶
- TKTokenKeychainKey.InitWithCertificateObjectID: Initializes a token keychain key with data from the specified certificate reference and a given object ID.
Accessing Key Attributes ¶
- TKTokenKeychainKey.KeyType: The type of the key. Currently, only [kSecAttrKeyTypeRSA](<https://developer.apple.com/documentation/Security/kSecAttrKeyTypeRSA>) and `kSecAttrKeyTypeECSECPrimeRandom` are supported values.
- TKTokenKeychainKey.SetKeyType
- TKTokenKeychainKey.KeySizeInBits
- TKTokenKeychainKey.SetKeySizeInBits
- TKTokenKeychainKey.ApplicationTag: The private tag data.
- TKTokenKeychainKey.SetApplicationTag
- TKTokenKeychainKey.PublicKeyData: The public key data.
- TKTokenKeychainKey.SetPublicKeyData
- TKTokenKeychainKey.PublicKeyHash: The SHA1 hash of the raw public key.
- TKTokenKeychainKey.SetPublicKeyHash
- TKTokenKeychainKey.CanDecrypt: Whether the key can be used to decrypt data.
- TKTokenKeychainKey.SetCanDecrypt
- TKTokenKeychainKey.CanSign: Whether the key can be used to sign data.
- TKTokenKeychainKey.SetCanSign
- TKTokenKeychainKey.CanPerformKeyExchange: Whether the key can be used to perform Diffie-Hellman style cryptographic key exchange.
- TKTokenKeychainKey.SetCanPerformKeyExchange
- TKTokenKeychainKey.IsSuitableForLogin: Whether the key can be used for system login.
- TKTokenKeychainKey.SetSuitableForLogin
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainKey
func NewTKTokenKeychainKey ¶
func NewTKTokenKeychainKey() TKTokenKeychainKey
NewTKTokenKeychainKey creates a new TKTokenKeychainKey instance.
func NewTKTokenKeychainKeyWithCertificateObjectID ¶
func NewTKTokenKeychainKeyWithCertificateObjectID(certificateRef security.SecCertificateRef, objectID TKTokenObjectID) TKTokenKeychainKey
Initializes a token keychain key with data from the specified certificate reference and a given object ID.
certificateRef: The certificate reference.
You can create a [SecCertificateRef] value from a data object using the [SecCertificateCreateWithData] function.
objectID: The object ID.
Return Value ¶
A new token keychain certificate.
Discussion ¶
This is the designated initializer.
func NewTKTokenKeychainKeyWithObjectID ¶
func NewTKTokenKeychainKeyWithObjectID(objectID TKTokenObjectID) TKTokenKeychainKey
Initializes a token keychain item with the specified object ID.
objectID: The object ID.
Return Value ¶
A new keychain item.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainItem/init(objectID:)
func TKTokenKeychainKeyFromID ¶
func TKTokenKeychainKeyFromID(id objc.ID) TKTokenKeychainKey
TKTokenKeychainKeyFromID constructs a TKTokenKeychainKey from an objc.ID.
A token’s key as stored in the keychain.
func (TKTokenKeychainKey) ApplicationTag ¶
func (t TKTokenKeychainKey) ApplicationTag() foundation.NSData
The private tag data.
Discussion ¶
This property is equivalent to the `kSecAttrApplicationTag` type attribute.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainKey/applicationTag
func (TKTokenKeychainKey) Autorelease ¶
func (t TKTokenKeychainKey) Autorelease() TKTokenKeychainKey
Autorelease adds the receiver to the current autorelease pool.
func (TKTokenKeychainKey) CanDecrypt ¶
func (t TKTokenKeychainKey) CanDecrypt() bool
Whether the key can be used to decrypt data.
Discussion ¶
This property is equivalent to the `kSecAttrCanDecrypt` type attribute.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainKey/canDecrypt
func (TKTokenKeychainKey) CanPerformKeyExchange ¶
func (t TKTokenKeychainKey) CanPerformKeyExchange() bool
Whether the key can be used to perform Diffie-Hellman style cryptographic key exchange.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainKey/canPerformKeyExchange
func (TKTokenKeychainKey) CanSign ¶
func (t TKTokenKeychainKey) CanSign() bool
Whether the key can be used to sign data.
Discussion ¶
This property is equivalent to the `kSecAttrCanSign` type attribute.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainKey/canSign
func (TKTokenKeychainKey) Init ¶
func (t TKTokenKeychainKey) Init() TKTokenKeychainKey
Init initializes the instance.
func (TKTokenKeychainKey) InitWithCertificateObjectID ¶
func (t TKTokenKeychainKey) InitWithCertificateObjectID(certificateRef security.SecCertificateRef, objectID TKTokenObjectID) TKTokenKeychainKey
Initializes a token keychain key with data from the specified certificate reference and a given object ID.
certificateRef: The certificate reference.
You can create a [SecCertificateRef] value from a data object using the [SecCertificateCreateWithData] function.
objectID: The object ID.
Return Value ¶
A new token keychain certificate.
Discussion ¶
This is the designated initializer.
func (TKTokenKeychainKey) IsSuitableForLogin ¶
func (t TKTokenKeychainKey) IsSuitableForLogin() bool
Whether the key can be used for system login.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainKey/isSuitableForLogin
func (TKTokenKeychainKey) KeySizeInBits ¶
func (t TKTokenKeychainKey) KeySizeInBits() int
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainKey/keySizeInBits
func (TKTokenKeychainKey) KeyType ¶
func (t TKTokenKeychainKey) KeyType() string
The type of the key. Currently, only kSecAttrKeyTypeRSA and `kSecAttrKeyTypeECSECPrimeRandom` are supported values.
Discussion ¶
This property is equivalent to the `kSecAttrKeyType` type attribute.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainKey/keyType
func (TKTokenKeychainKey) PublicKeyData ¶
func (t TKTokenKeychainKey) PublicKeyData() foundation.NSData
The public key data.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainKey/publicKeyData
func (TKTokenKeychainKey) PublicKeyHash ¶
func (t TKTokenKeychainKey) PublicKeyHash() foundation.NSData
The SHA1 hash of the raw public key.
Discussion ¶
This property is equivalent to the `kSecAttrApplicationLabel` type attribute.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenKeychainKey/publicKeyHash
func (TKTokenKeychainKey) SetApplicationTag ¶
func (t TKTokenKeychainKey) SetApplicationTag(value foundation.NSData)
func (TKTokenKeychainKey) SetCanDecrypt ¶
func (t TKTokenKeychainKey) SetCanDecrypt(value bool)
func (TKTokenKeychainKey) SetCanPerformKeyExchange ¶
func (t TKTokenKeychainKey) SetCanPerformKeyExchange(value bool)
func (TKTokenKeychainKey) SetCanSign ¶
func (t TKTokenKeychainKey) SetCanSign(value bool)
func (TKTokenKeychainKey) SetKeySizeInBits ¶
func (t TKTokenKeychainKey) SetKeySizeInBits(value int)
func (TKTokenKeychainKey) SetKeyType ¶
func (t TKTokenKeychainKey) SetKeyType(value string)
func (TKTokenKeychainKey) SetPublicKeyData ¶
func (t TKTokenKeychainKey) SetPublicKeyData(value foundation.NSData)
func (TKTokenKeychainKey) SetPublicKeyHash ¶
func (t TKTokenKeychainKey) SetPublicKeyHash(value foundation.NSData)
func (TKTokenKeychainKey) SetSuitableForLogin ¶
func (t TKTokenKeychainKey) SetSuitableForLogin(value bool)
type TKTokenKeychainKeyClass ¶
type TKTokenKeychainKeyClass struct {
// contains filtered or unexported fields
}
func GetTKTokenKeychainKeyClass ¶
func GetTKTokenKeychainKeyClass() TKTokenKeychainKeyClass
GetTKTokenKeychainKeyClass returns the class object for TKTokenKeychainKey.
func (TKTokenKeychainKeyClass) Alloc ¶
func (tc TKTokenKeychainKeyClass) Alloc() TKTokenKeychainKey
Alloc allocates memory for a new instance of the class.
func (TKTokenKeychainKeyClass) Class ¶
func (tc TKTokenKeychainKeyClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKTokenObjectID ¶
type TKTokenObjectID = objectivec.Object
TKTokenObjectID is a unique and persistent identifier of a particular token object.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKToken/ObjectID
type TKTokenOperation ¶
type TKTokenOperation int
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenOperation
const ( TKTokenOperationDecryptData TKTokenOperation = 3 TKTokenOperationNone TKTokenOperation = 0 TKTokenOperationPerformKeyExchange TKTokenOperation = 4 TKTokenOperationReadData TKTokenOperation = 1 TKTokenOperationSignData TKTokenOperation = 2 )
func (TKTokenOperation) String ¶
func (e TKTokenOperation) String() string
type TKTokenOperationConstraint ¶
type TKTokenOperationConstraint = objectivec.Object
TKTokenOperationConstraint is a token’s authentication constraint for a specific operation.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenOperationConstraint
type TKTokenPasswordAuthOperation ¶
type TKTokenPasswordAuthOperation struct {
TKTokenAuthOperation
}
A password-based authentication operation.
Managing the Password ¶
- TKTokenPasswordAuthOperation.Password: The password to be filled in when the “ is called.
- TKTokenPasswordAuthOperation.SetPassword
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenPasswordAuthOperation
func NewTKTokenPasswordAuthOperation ¶
func NewTKTokenPasswordAuthOperation() TKTokenPasswordAuthOperation
NewTKTokenPasswordAuthOperation creates a new TKTokenPasswordAuthOperation instance.
func TKTokenPasswordAuthOperationFromID ¶
func TKTokenPasswordAuthOperationFromID(id objc.ID) TKTokenPasswordAuthOperation
TKTokenPasswordAuthOperationFromID constructs a TKTokenPasswordAuthOperation from an objc.ID.
A password-based authentication operation.
func (TKTokenPasswordAuthOperation) Autorelease ¶
func (t TKTokenPasswordAuthOperation) Autorelease() TKTokenPasswordAuthOperation
Autorelease adds the receiver to the current autorelease pool.
func (TKTokenPasswordAuthOperation) Init ¶
func (t TKTokenPasswordAuthOperation) Init() TKTokenPasswordAuthOperation
Init initializes the instance.
func (TKTokenPasswordAuthOperation) Password ¶
func (t TKTokenPasswordAuthOperation) Password() string
The password to be filled in when the “ is called.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenPasswordAuthOperation/password
func (TKTokenPasswordAuthOperation) SetPassword ¶
func (t TKTokenPasswordAuthOperation) SetPassword(value string)
type TKTokenPasswordAuthOperationClass ¶
type TKTokenPasswordAuthOperationClass struct {
// contains filtered or unexported fields
}
func GetTKTokenPasswordAuthOperationClass ¶
func GetTKTokenPasswordAuthOperationClass() TKTokenPasswordAuthOperationClass
GetTKTokenPasswordAuthOperationClass returns the class object for TKTokenPasswordAuthOperation.
func (TKTokenPasswordAuthOperationClass) Alloc ¶
func (tc TKTokenPasswordAuthOperationClass) Alloc() TKTokenPasswordAuthOperation
Alloc allocates memory for a new instance of the class.
func (TKTokenPasswordAuthOperationClass) Class ¶
func (tc TKTokenPasswordAuthOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKTokenSession ¶
type TKTokenSession struct {
objectivec.Object
}
A token session that manages the authentication state of a token.
Overview ¶
A token session communicates with its delegate to perform operations with its token that are bound to the authentication state.
A session is always instantiated by a TKToken instance through the token’s delegate when the framework detects access to the token from a new authentication session.
Creating Token Sessions ¶
- TKTokenSession.InitWithToken: Initializes a token session with the specified token.
Responding to Authentication Events ¶
- TKTokenSession.Delegate: The token session delegate.
- TKTokenSession.SetDelegate
Accessing the Token ¶
- TKTokenSession.Token: The token to which the session is bound.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenSession
func NewTKTokenSession ¶
func NewTKTokenSession() TKTokenSession
NewTKTokenSession creates a new TKTokenSession instance.
func NewTKTokenSessionWithToken ¶
func NewTKTokenSessionWithToken(token ITKToken) TKTokenSession
Initializes a token session with the specified token.
token: The token to which the initialized session is bound.
Return Value ¶
A new token session created with the specified token.
Discussion ¶
This is the designated initializer.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenSession/init(token:)
func TKTokenSessionFromID ¶
func TKTokenSessionFromID(id objc.ID) TKTokenSession
TKTokenSessionFromID constructs a TKTokenSession from an objc.ID.
A token session that manages the authentication state of a token.
func (TKTokenSession) Autorelease ¶
func (t TKTokenSession) Autorelease() TKTokenSession
Autorelease adds the receiver to the current autorelease pool.
func (TKTokenSession) Delegate ¶
func (t TKTokenSession) Delegate() TKTokenSessionDelegate
The token session delegate.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenSession/delegate
func (TKTokenSession) Init ¶
func (t TKTokenSession) Init() TKTokenSession
Init initializes the instance.
func (TKTokenSession) InitWithToken ¶
func (t TKTokenSession) InitWithToken(token ITKToken) TKTokenSession
Initializes a token session with the specified token.
token: The token to which the initialized session is bound.
Return Value ¶
A new token session created with the specified token.
Discussion ¶
This is the designated initializer.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenSession/init(token:)
func (TKTokenSession) SetDelegate ¶
func (t TKTokenSession) SetDelegate(value TKTokenSessionDelegate)
func (TKTokenSession) Token ¶
func (t TKTokenSession) Token() ITKToken
The token to which the session is bound.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenSession/token
type TKTokenSessionClass ¶
type TKTokenSessionClass struct {
// contains filtered or unexported fields
}
func GetTKTokenSessionClass ¶
func GetTKTokenSessionClass() TKTokenSessionClass
GetTKTokenSessionClass returns the class object for TKTokenSession.
func (TKTokenSessionClass) Alloc ¶
func (tc TKTokenSessionClass) Alloc() TKTokenSession
Alloc allocates memory for a new instance of the class.
func (TKTokenSessionClass) Class ¶
func (tc TKTokenSessionClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKTokenSessionDelegate ¶
type TKTokenSessionDelegate interface {
objectivec.IObject
}
The interface that a session instance delegate implements to respond to token session authentication events.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenSessionDelegate
type TKTokenSessionDelegateConfig ¶
type TKTokenSessionDelegateConfig struct {
// Other Methods
// TokenSessionSupportsOperationUsingKeyAlgorithm — Asks the delegate whether the token session supports a given operation using the specified key and algorithm.
TokenSessionSupportsOperationUsingKeyAlgorithm func(session TKTokenSession, operation TKTokenOperation, keyObjectID TKTokenObjectID, algorithm TKTokenKeyAlgorithm) bool
// TokenSessionBeginAuthForOperationConstraintError — Tells the delegate that authentication has begun for the specified operation and constraint.
TokenSessionBeginAuthForOperationConstraintError func(session TKTokenSession, operation TKTokenOperation, constraint TKTokenOperationConstraint, error_ foundation.NSError) TKTokenAuthOperation
// TokenSessionSignDataUsingKeyAlgorithmError — Tells the delegate to sign a data object using the specified key and algorithm.
TokenSessionSignDataUsingKeyAlgorithmError func(session TKTokenSession, dataToSign foundation.NSData, keyObjectID TKTokenObjectID, algorithm TKTokenKeyAlgorithm, error_ foundation.NSError) foundation.NSData
// TokenSessionDecryptDataUsingKeyAlgorithmError — Tells the delegate to decrypt a data object using the specified key and algorithm.
TokenSessionDecryptDataUsingKeyAlgorithmError func(session TKTokenSession, ciphertext foundation.NSData, keyObjectID TKTokenObjectID, algorithm TKTokenKeyAlgorithm, error_ foundation.NSError) foundation.NSData
// TokenSessionPerformKeyExchangeWithPublicKeyUsingKeyAlgorithmParametersError — Tells the delegate to perform a key exchange using the specified key and algorithm.
TokenSessionPerformKeyExchangeWithPublicKeyUsingKeyAlgorithmParametersError func(session TKTokenSession, otherPartyPublicKeyData foundation.NSData, objectID TKTokenObjectID, algorithm TKTokenKeyAlgorithm, parameters TKTokenKeyExchangeParameters, error_ foundation.NSError) foundation.NSData
}
TKTokenSessionDelegateConfig holds optional typed callbacks for TKTokenSessionDelegate methods. Set non-nil fields to register the corresponding Objective-C delegate method. Methods with nil callbacks are not registered, so [NSObject.RespondsToSelector] returns false for them — matching the Objective-C delegate pattern exactly.
See Apple Documentation for protocol details.
type TKTokenSessionDelegateObject ¶
type TKTokenSessionDelegateObject struct {
objectivec.Object
}
TKTokenSessionDelegateObject wraps an existing Objective-C object that conforms to the TKTokenSessionDelegate protocol.
func NewTKTokenSessionDelegate ¶
func NewTKTokenSessionDelegate(config TKTokenSessionDelegateConfig) TKTokenSessionDelegateObject
NewTKTokenSessionDelegate creates an Objective-C object implementing the TKTokenSessionDelegate protocol.
Each call registers a unique Objective-C class containing only the methods set in config. This means [NSObject.RespondsToSelector] works correctly for optional delegate methods — only non-nil callbacks are registered.
The returned TKTokenSessionDelegateObject satisfies the TKTokenSessionDelegate interface and can be passed directly to SetDelegate and similar methods.
See Apple Documentation for protocol details.
func TKTokenSessionDelegateObjectFromID ¶
func TKTokenSessionDelegateObjectFromID(id objc.ID) TKTokenSessionDelegateObject
TKTokenSessionDelegateObjectFromID constructs a TKTokenSessionDelegateObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (TKTokenSessionDelegateObject) BaseObject ¶
func (o TKTokenSessionDelegateObject) BaseObject() objectivec.Object
func (TKTokenSessionDelegateObject) TokenSessionBeginAuthForOperationConstraintError ¶
func (o TKTokenSessionDelegateObject) TokenSessionBeginAuthForOperationConstraintError(session ITKTokenSession, operation TKTokenOperation, constraint TKTokenOperationConstraint) (ITKTokenAuthOperation, error)
Tells the delegate that authentication has begun for the specified operation and constraint.
session: The token session.
operation: The kind of operation.
constraint: The constraint to be satisfied.
Return Value ¶
The resulting context of the operation, or `nil` if an error occurred.
Discussion ¶
If you return an instance of a subclass of TKTokenAuthOperation that is provided by the CryptoTokenKit framework, the system will first fill in the context-specific properties, such as the password, before calling the “ method on the context.
func (TKTokenSessionDelegateObject) TokenSessionDecryptDataUsingKeyAlgorithmError ¶
func (o TKTokenSessionDelegateObject) TokenSessionDecryptDataUsingKeyAlgorithmError(session ITKTokenSession, ciphertext foundation.NSData, keyObjectID TKTokenObjectID, algorithm ITKTokenKeyAlgorithm) (foundation.NSData, error)
Tells the delegate to decrypt a data object using the specified key and algorithm.
session: The token session.
ciphertext: The data to decrypt.
keyObjectID: The identifier of the public key object.
algorithm: The algorithm to be used for decryption.
Return Value ¶
The decrypted data, or `nil` if an error occurred.
func (TKTokenSessionDelegateObject) TokenSessionPerformKeyExchangeWithPublicKeyUsingKeyAlgorithmParametersError ¶
func (o TKTokenSessionDelegateObject) TokenSessionPerformKeyExchangeWithPublicKeyUsingKeyAlgorithmParametersError(session ITKTokenSession, otherPartyPublicKeyData foundation.NSData, objectID TKTokenObjectID, algorithm ITKTokenKeyAlgorithm, parameters ITKTokenKeyExchangeParameters) (foundation.NSData, error)
Tells the delegate to perform a key exchange using the specified key and algorithm.
session: The token session.
otherPartyPublicKeyData: The public key of the other party.
objectID: The identifier of the private key object.
algorithm: The algorithm to be used for key exchange.
parameters: Additional parameters used by `algorithm` to perform the key exchange.
Return Value ¶
The result of the key exchange, or `nil` if an error occurred.
func (TKTokenSessionDelegateObject) TokenSessionSignDataUsingKeyAlgorithmError ¶
func (o TKTokenSessionDelegateObject) TokenSessionSignDataUsingKeyAlgorithmError(session ITKTokenSession, dataToSign foundation.NSData, keyObjectID TKTokenObjectID, algorithm ITKTokenKeyAlgorithm) (foundation.NSData, error)
Tells the delegate to sign a data object using the specified key and algorithm.
session: The token session.
dataToSign: The data to sign.
keyObjectID: The identifier of the private key object.
algorithm: The algorithm to be used for signing.
Return Value ¶
The signed data, or `nil` if an error occurred.
func (TKTokenSessionDelegateObject) TokenSessionSupportsOperationUsingKeyAlgorithm ¶
func (o TKTokenSessionDelegateObject) TokenSessionSupportsOperationUsingKeyAlgorithm(session ITKTokenSession, operation TKTokenOperation, keyObjectID TKTokenObjectID, algorithm ITKTokenKeyAlgorithm) bool
Asks the delegate whether the token session supports a given operation using the specified key and algorithm.
session: The token session.
operation: The operation to perform. For possible values, see TKTokenOperation.
keyObjectID: The identifier of the private key object.
algorithm: The algorithm to be used by the operation.
Return Value ¶
true if the operation is supported; otherwise, false.
type TKTokenSmartCardPINAuthOperation ¶
type TKTokenSmartCardPINAuthOperation struct {
TKTokenAuthOperation
}
A Smart Card PIN authentication operation.
Configuring the Operation ¶
- TKTokenSmartCardPINAuthOperation.PINFormat: The PIN format.
- TKTokenSmartCardPINAuthOperation.SetPINFormat
- TKTokenSmartCardPINAuthOperation.APDUTemplate: The template into which the PIN is filled in. `nil` by default.
- TKTokenSmartCardPINAuthOperation.SetAPDUTemplate
- TKTokenSmartCardPINAuthOperation.PINByteOffset: The offset, in bytes, within the APDU template to mark the location for filling in the PIN.
- TKTokenSmartCardPINAuthOperation.SetPINByteOffset
- TKTokenSmartCardPINAuthOperation.SmartCard: A Smart Card to which the formatted APDU is sent in order to authenticate.
- TKTokenSmartCardPINAuthOperation.SetSmartCard
Accessing the PIN ¶
- TKTokenSmartCardPINAuthOperation.PIN: The PIN value resulting from performing the operation.
- TKTokenSmartCardPINAuthOperation.SetPIN
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenSmartCardPINAuthOperation
func NewTKTokenSmartCardPINAuthOperation ¶
func NewTKTokenSmartCardPINAuthOperation() TKTokenSmartCardPINAuthOperation
NewTKTokenSmartCardPINAuthOperation creates a new TKTokenSmartCardPINAuthOperation instance.
func TKTokenSmartCardPINAuthOperationFromID ¶
func TKTokenSmartCardPINAuthOperationFromID(id objc.ID) TKTokenSmartCardPINAuthOperation
TKTokenSmartCardPINAuthOperationFromID constructs a TKTokenSmartCardPINAuthOperation from an objc.ID.
A Smart Card PIN authentication operation.
func (TKTokenSmartCardPINAuthOperation) APDUTemplate ¶
func (t TKTokenSmartCardPINAuthOperation) APDUTemplate() foundation.NSData
The template into which the PIN is filled in. `nil` by default.
Discussion ¶
If `nil`, the system will not attempt to authenticate by sending the formatted APDU to the Smart Card. Instead, the token itself is expected to perform the authentication. You are encouraged to provide an APDU template, if possible, as it allows the use of a hardware interface for secure PIN entry, provided one exists.
func (TKTokenSmartCardPINAuthOperation) Autorelease ¶
func (t TKTokenSmartCardPINAuthOperation) Autorelease() TKTokenSmartCardPINAuthOperation
Autorelease adds the receiver to the current autorelease pool.
func (TKTokenSmartCardPINAuthOperation) Init ¶
func (t TKTokenSmartCardPINAuthOperation) Init() TKTokenSmartCardPINAuthOperation
Init initializes the instance.
func (TKTokenSmartCardPINAuthOperation) PIN ¶
func (t TKTokenSmartCardPINAuthOperation) PIN() string
The PIN value resulting from performing the operation.
Discussion ¶
This property is set to the result of the operation after “ is called.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenSmartCardPINAuthOperation/pin
func (TKTokenSmartCardPINAuthOperation) PINByteOffset ¶
func (t TKTokenSmartCardPINAuthOperation) PINByteOffset() int
The offset, in bytes, within the APDU template to mark the location for filling in the PIN.
func (TKTokenSmartCardPINAuthOperation) PINFormat ¶
func (t TKTokenSmartCardPINAuthOperation) PINFormat() ITKSmartCardPINFormat
The PIN format.
Discussion ¶
By default, this property is set to a TKSmartCardPINFormat object initialized without any further configuration.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenSmartCardPINAuthOperation/pinFormat
func (TKTokenSmartCardPINAuthOperation) SetAPDUTemplate ¶
func (t TKTokenSmartCardPINAuthOperation) SetAPDUTemplate(value foundation.NSData)
func (TKTokenSmartCardPINAuthOperation) SetPIN ¶
func (t TKTokenSmartCardPINAuthOperation) SetPIN(value string)
func (TKTokenSmartCardPINAuthOperation) SetPINByteOffset ¶
func (t TKTokenSmartCardPINAuthOperation) SetPINByteOffset(value int)
func (TKTokenSmartCardPINAuthOperation) SetPINFormat ¶
func (t TKTokenSmartCardPINAuthOperation) SetPINFormat(value ITKSmartCardPINFormat)
func (TKTokenSmartCardPINAuthOperation) SetSmartCard ¶
func (t TKTokenSmartCardPINAuthOperation) SetSmartCard(value ITKSmartCard)
func (TKTokenSmartCardPINAuthOperation) SmartCard ¶
func (t TKTokenSmartCardPINAuthOperation) SmartCard() ITKSmartCard
A Smart Card to which the formatted APDU is sent in order to authenticate.
Discussion ¶
This property is only used if the TKTokenSmartCardPINAuthOperation.APDUTemplate property has a set value.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenSmartCardPINAuthOperation/smartCard
type TKTokenSmartCardPINAuthOperationClass ¶
type TKTokenSmartCardPINAuthOperationClass struct {
// contains filtered or unexported fields
}
func GetTKTokenSmartCardPINAuthOperationClass ¶
func GetTKTokenSmartCardPINAuthOperationClass() TKTokenSmartCardPINAuthOperationClass
GetTKTokenSmartCardPINAuthOperationClass returns the class object for TKTokenSmartCardPINAuthOperation.
func (TKTokenSmartCardPINAuthOperationClass) Alloc ¶
func (tc TKTokenSmartCardPINAuthOperationClass) Alloc() TKTokenSmartCardPINAuthOperation
Alloc allocates memory for a new instance of the class.
func (TKTokenSmartCardPINAuthOperationClass) Class ¶
func (tc TKTokenSmartCardPINAuthOperationClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKTokenWatcher ¶
type TKTokenWatcher struct {
objectivec.Object
}
An object that tracks the tokens available in the system.
Overview ¶
Create a token watcher and register an insertion handler to be notified when tokens are added to the system. You can also add removal handlers for specific tokens to be notified when those tokens are removed from the system.
Accessing Token Identifiers ¶
- TKTokenWatcher.TokenIDs: The token IDs currently available in the system.
Configuring Handlers ¶
- TKTokenWatcher.AddRemovalHandlerForTokenID: Adds a removal handler for the specified token ID.
- TKTokenWatcher.SetInsertionHandler: Sets an insertion handler closure to be called when a new token is inserted into the system.
Instance Methods ¶
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenWatcher
func NewTKTokenWatcher ¶
func NewTKTokenWatcher() TKTokenWatcher
NewTKTokenWatcher creates a new TKTokenWatcher instance.
func TKTokenWatcherFromID ¶
func TKTokenWatcherFromID(id objc.ID) TKTokenWatcher
TKTokenWatcherFromID constructs a TKTokenWatcher from an objc.ID.
An object that tracks the tokens available in the system.
func (TKTokenWatcher) AddRemovalHandlerForTokenID ¶
func (t TKTokenWatcher) AddRemovalHandlerForTokenID(removalHandler StringHandler, tokenID string)
Adds a removal handler for the specified token ID.
removalHandler: A block to be called when the specified token is removed. This block takes a single argument:
tokenID: The identifier of the removed token.
tokenID: The identifier of the token to watch for removal.
If TKTokenWatcher.TokenIDs doesn’t contain `tokenID`, `insertionHandler` is executed immediately.
Discussion ¶
You typically call this method in the `insertionHandler` passed to the token watcher initializer.
Adding a removal handler will remove any existing removal handlers for the specified token ID.
func (TKTokenWatcher) Autorelease ¶
func (t TKTokenWatcher) Autorelease() TKTokenWatcher
Autorelease adds the receiver to the current autorelease pool.
func (TKTokenWatcher) Init ¶
func (t TKTokenWatcher) Init() TKTokenWatcher
Init initializes the instance.
func (TKTokenWatcher) SetInsertionHandler ¶
func (t TKTokenWatcher) SetInsertionHandler(insertionHandler StringHandler)
Sets an insertion handler closure to be called when a new token is inserted into the system.
insertionHandler: A closure to be called whenever a token is added to the system. The closure takes a single argument, the tokenID, that identifies the added token.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenWatcher/setInsertionHandler(_:)
func (TKTokenWatcher) SetInsertionHandlerSync ¶
func (t TKTokenWatcher) SetInsertionHandlerSync(ctx context.Context) (*string, error)
SetInsertionHandlerSync is a synchronous wrapper around TKTokenWatcher.SetInsertionHandler. It blocks until the completion handler fires or the context is cancelled.
func (TKTokenWatcher) TokenIDs ¶
func (t TKTokenWatcher) TokenIDs() []string
The token IDs currently available in the system.
Discussion ¶
Each string in TKTokenWatcher.TokenIDs corresponds to the name of the token instance.
You can observe this property to be notified of additions and removals to system tokens. See Key-Value Observing Programming Guide for more information.
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenWatcher/tokenIDs
func (TKTokenWatcher) TokenInfoForTokenID ¶
func (t TKTokenWatcher) TokenInfoForTokenID(tokenID string) ITKTokenWatcherTokenInfo
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenWatcher/tokenInfo(forTokenID:)
type TKTokenWatcherClass ¶
type TKTokenWatcherClass struct {
// contains filtered or unexported fields
}
func GetTKTokenWatcherClass ¶
func GetTKTokenWatcherClass() TKTokenWatcherClass
GetTKTokenWatcherClass returns the class object for TKTokenWatcher.
func (TKTokenWatcherClass) Alloc ¶
func (tc TKTokenWatcherClass) Alloc() TKTokenWatcher
Alloc allocates memory for a new instance of the class.
func (TKTokenWatcherClass) Class ¶
func (tc TKTokenWatcherClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type TKTokenWatcherTokenInfo ¶
type TKTokenWatcherTokenInfo struct {
objectivec.Object
}
Instance Properties ¶
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenWatcher/TokenInfo
func NewTKTokenWatcherTokenInfo ¶
func NewTKTokenWatcherTokenInfo() TKTokenWatcherTokenInfo
NewTKTokenWatcherTokenInfo creates a new TKTokenWatcherTokenInfo instance.
func TKTokenWatcherTokenInfoFromID ¶
func TKTokenWatcherTokenInfoFromID(id objc.ID) TKTokenWatcherTokenInfo
TKTokenWatcherTokenInfoFromID constructs a TKTokenWatcherTokenInfo from an objc.ID.
func (TKTokenWatcherTokenInfo) Autorelease ¶
func (t TKTokenWatcherTokenInfo) Autorelease() TKTokenWatcherTokenInfo
Autorelease adds the receiver to the current autorelease pool.
func (TKTokenWatcherTokenInfo) DriverName ¶
func (t TKTokenWatcherTokenInfo) DriverName() string
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenWatcher/TokenInfo/driverName
func (TKTokenWatcherTokenInfo) Init ¶
func (t TKTokenWatcherTokenInfo) Init() TKTokenWatcherTokenInfo
Init initializes the instance.
func (TKTokenWatcherTokenInfo) SlotName ¶
func (t TKTokenWatcherTokenInfo) SlotName() string
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenWatcher/TokenInfo/slotName
func (TKTokenWatcherTokenInfo) TokenID ¶
func (t TKTokenWatcherTokenInfo) TokenID() string
See: https://developer.apple.com/documentation/CryptoTokenKit/TKTokenWatcher/TokenInfo/tokenID
type TKTokenWatcherTokenInfoClass ¶
type TKTokenWatcherTokenInfoClass struct {
// contains filtered or unexported fields
}
func GetTKTokenWatcherTokenInfoClass ¶
func GetTKTokenWatcherTokenInfoClass() TKTokenWatcherTokenInfoClass
GetTKTokenWatcherTokenInfoClass returns the class object for TKTokenWatcherTokenInfo.
func (TKTokenWatcherTokenInfoClass) Alloc ¶
func (tc TKTokenWatcherTokenInfoClass) Alloc() TKTokenWatcherTokenInfo
Alloc allocates memory for a new instance of the class.
func (TKTokenWatcherTokenInfoClass) Class ¶
func (tc TKTokenWatcherTokenInfoClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
Source Files
¶
- blocks.gen.go
- delegate_class_counter.gen.go
- doc.gen.go
- enums.gen.go
- functions.gen.go
- generate.go
- global_vars.gen.go
- tk_compact_tlv_record.gen.go
- tk_simple_tlv_record.gen.go
- tk_smart_card.gen.go
- tk_smart_card_atr.gen.go
- tk_smart_card_atr_interface_group.gen.go
- tk_smart_card_pin_format.gen.go
- tk_smart_card_slot.gen.go
- tk_smart_card_slot_manager.gen.go
- tk_smart_card_token.gen.go
- tk_smart_card_token_driver.gen.go
- tk_smart_card_token_driver_delegate_protocol.gen.go
- tk_smart_card_token_session.gen.go
- tk_smart_card_user_interaction.gen.go
- tk_smart_card_user_interaction_delegate_protocol.gen.go
- tk_smart_card_user_interaction_for_pin_operation.gen.go
- tk_smart_card_user_interaction_for_secure_pin_change.gen.go
- tk_smart_card_user_interaction_for_secure_pin_verification.gen.go
- tk_token.gen.go
- tk_token_auth_operation.gen.go
- tk_token_configuration.gen.go
- tk_token_delegate_protocol.gen.go
- tk_token_driver.gen.go
- tk_token_driver_configuration.gen.go
- tk_token_driver_delegate_protocol.gen.go
- tk_token_key_algorithm.gen.go
- tk_token_key_exchange_parameters.gen.go
- tk_token_keychain_certificate.gen.go
- tk_token_keychain_contents.gen.go
- tk_token_keychain_item.gen.go
- tk_token_keychain_key.gen.go
- tk_token_password_auth_operation.gen.go
- tk_token_session.gen.go
- tk_token_session_delegate_protocol.gen.go
- tk_token_smart_card_pin_auth_operation.gen.go
- tk_token_watcher.gen.go
- tk_token_watcher_token_info.gen.go
- tkbertlv_record.gen.go
- tktlv_record.gen.go
- typedefs.gen.go
- types.gen.go
- undefined_types.gen.go