Documentation
¶
Overview ¶
Package localauthentication provides purego-based Go bindings for the macOS LocalAuthentication framework.
Apple documentation: https://developer.apple.com/documentation/localauthentication
Index ¶
- func LAErrorDomain() uintptr
- func LATouchIDAuthenticationMaximumAllowableReuseDuration() float64
- type Acl_entry_id_t
- type Acl_flag_t
- type Acl_perm_t
- type Acl_tag_t
- type Acl_type_t
- type Clockid_t
- type Dispatch_autorelease_frequency_t
- type Dispatch_block_flags_t
- type Filesec_property_t
- type Idtype_t
- type Ipc_info_object_type_t
- type LAAccessControlOperation
- type LAAuthenticationRequirement
- func LAAuthenticationRequirementBiometryCurrentSetRequirement() *LAAuthenticationRequirement
- func LAAuthenticationRequirementBiometryRequirement() *LAAuthenticationRequirement
- func LAAuthenticationRequirementBiometryRequirementWithFallback(fallback *LABiometryFallbackRequirement) *LAAuthenticationRequirement
- func LAAuthenticationRequirementDefaultRequirement() *LAAuthenticationRequirement
- func LAAuthenticationRequirementFromID(id objc.ID) *LAAuthenticationRequirement
- type LABiometryFallbackRequirement
- type LABiometryType
- type LACompanionType
- type LAContext
- func (o *LAContext) BiometryType() LABiometryType
- func (o *LAContext) CanEvaluatePolicyError(policy LAPolicy) (bool, error)
- func (o *LAContext) DomainState() *LADomainState
- func (o *LAContext) EvaluateAccessControlOperationLocalizedReasonReply(accessControl unsafe.Pointer, operation LAAccessControlOperation, ...)
- func (o *LAContext) EvaluatePolicyLocalizedReasonReply(policy LAPolicy, localizedReason *foundation.NSString, ...)
- func (o *LAContext) EvaluatedPolicyDomainState() *foundation.NSData
- func (o *LAContext) InteractionNotAllowed() bool
- func (o *LAContext) Invalidate()
- func (o *LAContext) IsCredentialSet(type_ LACredentialType) bool
- func (o *LAContext) LocalizedCancelTitle() *foundation.NSString
- func (o *LAContext) LocalizedFallbackTitle() *foundation.NSString
- func (o *LAContext) LocalizedReason() *foundation.NSString
- func (o *LAContext) MaxBiometryFailures() *foundation.NSNumber
- func (o *LAContext) SetCredentialType(credential *foundation.NSData, type_ LACredentialType) bool
- func (o *LAContext) SetInteractionNotAllowed(interactionNotAllowed bool)
- func (o *LAContext) SetLocalizedCancelTitle(localizedCancelTitle *foundation.NSString)
- func (o *LAContext) SetLocalizedFallbackTitle(localizedFallbackTitle *foundation.NSString)
- func (o *LAContext) SetLocalizedReason(localizedReason *foundation.NSString)
- func (o *LAContext) SetMaxBiometryFailures(maxBiometryFailures *foundation.NSNumber)deprecated
- func (o *LAContext) SetTouchIDAuthenticationAllowableReuseDuration(touchIDAuthenticationAllowableReuseDuration float64)
- func (o *LAContext) TouchIDAuthenticationAllowableReuseDuration() float64
- type LACredentialType
- type LADomainState
- type LADomainStateBiometry
- type LADomainStateCompanion
- type LAEnvironment
- type LAEnvironmentMechanism
- type LAEnvironmentMechanismBiometry
- func (o *LAEnvironmentMechanismBiometry) BiometryType() LABiometryType
- func (o *LAEnvironmentMechanismBiometry) BuiltInSensorInaccessible() bool
- func (o *LAEnvironmentMechanismBiometry) IsEnrolled() bool
- func (o *LAEnvironmentMechanismBiometry) IsLockedOut() bool
- func (o *LAEnvironmentMechanismBiometry) StateHash() *foundation.NSData
- type LAEnvironmentMechanismCompanion
- type LAEnvironmentMechanismUserPassword
- type LAEnvironmentObserver
- type LAEnvironmentState
- func (o *LAEnvironmentState) AllMechanisms() *foundation.NSArray[*LAEnvironmentMechanism]
- func (o *LAEnvironmentState) Biometry() *LAEnvironmentMechanismBiometry
- func (o *LAEnvironmentState) Companions() *foundation.NSArray[*LAEnvironmentMechanismCompanion]
- func (o *LAEnvironmentState) UserPassword() *LAEnvironmentMechanismUserPassword
- type LAError
- type LAPersistedRight
- type LAPolicy
- type LAPrivateKey
- func (o *LAPrivateKey) CanDecryptUsingSecKeyAlgorithm(algorithm unsafe.Pointer) bool
- func (o *LAPrivateKey) CanExchangeKeysUsingSecKeyAlgorithm(algorithm unsafe.Pointer) bool
- func (o *LAPrivateKey) CanSignUsingSecKeyAlgorithm(algorithm unsafe.Pointer) bool
- func (o *LAPrivateKey) DecryptDataSecKeyAlgorithmCompletion(data *foundation.NSData, algorithm unsafe.Pointer, ...)
- func (o *LAPrivateKey) ExchangeKeysWithPublicKeySecKeyAlgorithmSecKeyParametersCompletion(publicKey *foundation.NSData, algorithm unsafe.Pointer, ...)
- func (o *LAPrivateKey) PublicKey() *LAPublicKey
- func (o *LAPrivateKey) SignDataSecKeyAlgorithmCompletion(data *foundation.NSData, algorithm unsafe.Pointer, ...)
- type LAPublicKey
- func (o *LAPublicKey) CanEncryptUsingSecKeyAlgorithm(algorithm unsafe.Pointer) bool
- func (o *LAPublicKey) CanVerifyUsingSecKeyAlgorithm(algorithm unsafe.Pointer) bool
- func (o *LAPublicKey) EncryptDataSecKeyAlgorithmCompletion(data *foundation.NSData, algorithm unsafe.Pointer, ...)
- func (o *LAPublicKey) ExportBytesWithCompletion(handler func(*foundation.NSData, unsafe.Pointer))
- func (o *LAPublicKey) VerifyDataSignatureSecKeyAlgorithmCompletion(signedData *foundation.NSData, signature *foundation.NSData, ...)
- type LARight
- func (o *LARight) AuthorizeWithLocalizedReasonCompletion(localizedReason *foundation.NSString, handler func(unsafe.Pointer))
- func (o *LARight) CheckCanAuthorizeWithCompletion(handler func(unsafe.Pointer))
- func (o *LARight) DeauthorizeWithCompletion(handler func())
- func (o *LARight) Init() *LARight
- func (o *LARight) InitWithRequirement(requirement *LAAuthenticationRequirement) *LARight
- func (o *LARight) SetTag(tag int)
- func (o *LARight) State() LARightState
- func (o *LARight) Tag() int
- type LARightState
- type LARightStore
- func (o *LARightStore) RemoveAllRightsWithCompletion(handler func(unsafe.Pointer))
- func (o *LARightStore) RemoveRightCompletion(right *LAPersistedRight, handler func(unsafe.Pointer))
- func (o *LARightStore) RemoveRightForIdentifierCompletion(identifier *foundation.NSString, handler func(unsafe.Pointer))
- func (o *LARightStore) RightForIdentifierCompletion(identifier *foundation.NSString, ...)
- func (o *LARightStore) SaveRightIdentifierCompletion(right *LARight, identifier *foundation.NSString, ...)
- func (o *LARightStore) SaveRightIdentifierSecretCompletion(right *LARight, identifier *foundation.NSString, secret *foundation.NSData, ...)
- type LASecret
- type Launch_data_type_t
- type MDLabelDomain
- type MDQueryOptionFlags
- type MDQuerySortOptionFlags
- type Mach_vm_range_flags_t
- type Mach_vm_range_flavor_t
- type Mach_vm_range_tag_t
- type Mpo_flags_t
- type Os_clockid_t
- type Ptrauth_key
- type Qos_class_t
- type Virtual_memory_guard_exception_code_t
- type Xpc_listener_create_flags_t
- type Xpc_session_create_flags_t
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LATouchIDAuthenticationMaximumAllowableReuseDuration ¶
func LATouchIDAuthenticationMaximumAllowableReuseDuration() float64
The maximum value for LAContext touchIDAuthenticationAllowableReuseDuration property.
Types ¶
type Acl_entry_id_t ¶
type Acl_entry_id_t int64
const ( ACL_FIRST_ENTRY Acl_entry_id_t = 0 ACL_NEXT_ENTRY Acl_entry_id_t = -1 ACL_LAST_ENTRY Acl_entry_id_t = -2 )
func (Acl_entry_id_t) String ¶
func (e Acl_entry_id_t) String() string
type Acl_flag_t ¶
type Acl_flag_t int64
const ( ACL_FLAG_DEFER_INHERIT Acl_flag_t = 1 ACL_FLAG_NO_INHERIT Acl_flag_t = 131072 ACL_ENTRY_INHERITED Acl_flag_t = 16 ACL_ENTRY_FILE_INHERIT Acl_flag_t = 32 ACL_ENTRY_DIRECTORY_INHERIT Acl_flag_t = 64 ACL_ENTRY_LIMIT_INHERIT Acl_flag_t = 128 ACL_ENTRY_ONLY_INHERIT Acl_flag_t = 256 )
func (Acl_flag_t) String ¶
func (e Acl_flag_t) String() string
type Acl_perm_t ¶
type Acl_perm_t int64
const ( ACL_READ_DATA Acl_perm_t = 2 ACL_LIST_DIRECTORY Acl_perm_t = 2 ACL_WRITE_DATA Acl_perm_t = 4 ACL_ADD_FILE Acl_perm_t = 4 ACL_EXECUTE Acl_perm_t = 8 ACL_SEARCH Acl_perm_t = 8 ACL_DELETE Acl_perm_t = 16 ACL_APPEND_DATA Acl_perm_t = 32 ACL_ADD_SUBDIRECTORY Acl_perm_t = 32 ACL_DELETE_CHILD Acl_perm_t = 64 ACL_READ_ATTRIBUTES Acl_perm_t = 128 ACL_WRITE_ATTRIBUTES Acl_perm_t = 256 ACL_READ_EXTATTRIBUTES Acl_perm_t = 512 ACL_WRITE_EXTATTRIBUTES Acl_perm_t = 1024 ACL_READ_SECURITY Acl_perm_t = 2048 ACL_WRITE_SECURITY Acl_perm_t = 4096 ACL_CHANGE_OWNER Acl_perm_t = 8192 ACL_SYNCHRONIZE Acl_perm_t = 1048576 )
func (Acl_perm_t) String ¶
func (e Acl_perm_t) String() string
type Acl_type_t ¶
type Acl_type_t int64
const ( ACL_TYPE_EXTENDED Acl_type_t = 256 ACL_TYPE_ACCESS Acl_type_t = 0 ACL_TYPE_DEFAULT Acl_type_t = 1 ACL_TYPE_AFS Acl_type_t = 2 ACL_TYPE_CODA Acl_type_t = 3 ACL_TYPE_NTFS Acl_type_t = 4 ACL_TYPE_NWFS Acl_type_t = 5 )
func (Acl_type_t) String ¶
func (e Acl_type_t) String() string
type Dispatch_autorelease_frequency_t ¶
type Dispatch_autorelease_frequency_t uint64
const ( DISPATCH_AUTORELEASE_FREQUENCY_INHERIT Dispatch_autorelease_frequency_t = 0 DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM Dispatch_autorelease_frequency_t = 1 DISPATCH_AUTORELEASE_FREQUENCY_NEVER Dispatch_autorelease_frequency_t = 2 )
func (Dispatch_autorelease_frequency_t) String ¶
func (e Dispatch_autorelease_frequency_t) String() string
type Dispatch_block_flags_t ¶
type Dispatch_block_flags_t uint64
const ( DISPATCH_BLOCK_BARRIER Dispatch_block_flags_t = 1 DISPATCH_BLOCK_DETACHED Dispatch_block_flags_t = 2 DISPATCH_BLOCK_ASSIGN_CURRENT Dispatch_block_flags_t = 4 DISPATCH_BLOCK_NO_QOS_CLASS Dispatch_block_flags_t = 8 DISPATCH_BLOCK_INHERIT_QOS_CLASS Dispatch_block_flags_t = 16 DISPATCH_BLOCK_ENFORCE_QOS_CLASS Dispatch_block_flags_t = 32 )
func (Dispatch_block_flags_t) String ¶
func (e Dispatch_block_flags_t) String() string
type Filesec_property_t ¶
type Filesec_property_t int64
const ( FILESEC_OWNER Filesec_property_t = 1 FILESEC_GROUP Filesec_property_t = 2 FILESEC_UUID Filesec_property_t = 3 FILESEC_MODE Filesec_property_t = 4 FILESEC_ACL Filesec_property_t = 5 FILESEC_GRPUUID Filesec_property_t = 6 FILESEC_ACL_RAW Filesec_property_t = 100 FILESEC_ACL_ALLOCSIZE Filesec_property_t = 101 )
func (Filesec_property_t) String ¶
func (e Filesec_property_t) String() string
type Ipc_info_object_type_t ¶
type Ipc_info_object_type_t int64
const ( IPC_OTYPE_NONE Ipc_info_object_type_t = 0 IPC_OTYPE_THREAD_CONTROL Ipc_info_object_type_t = 1 IPC_OTYPE_TASK_CONTROL Ipc_info_object_type_t = 2 IPC_OTYPE_HOST Ipc_info_object_type_t = 3 IPC_OTYPE_HOST_PRIV Ipc_info_object_type_t = 4 IPC_OTYPE_PROCESSOR Ipc_info_object_type_t = 5 IPC_OTYPE_PROCESSOR_SET Ipc_info_object_type_t = 6 IPC_OTYPE_PROCESSOR_SET_NAME Ipc_info_object_type_t = 7 IPC_OTYPE_TIMER Ipc_info_object_type_t = 8 IPC_OTYPE_PORT_SUBST_ONCE Ipc_info_object_type_t = 9 IPC_OTYPE_MIG Ipc_info_object_type_t = 10 IPC_OTYPE_MEMORY_OBJECT Ipc_info_object_type_t = 11 IPC_OTYPE_XMM_PAGER Ipc_info_object_type_t = 12 IPC_OTYPE_XMM_KERNEL Ipc_info_object_type_t = 13 IPC_OTYPE_XMM_REPLY Ipc_info_object_type_t = 14 IPC_OTYPE_UND_REPLY Ipc_info_object_type_t = 15 IPC_OTYPE_HOST_NOTIFY Ipc_info_object_type_t = 16 IPC_OTYPE_HOST_SECURITY Ipc_info_object_type_t = 17 IPC_OTYPE_LEDGER Ipc_info_object_type_t = 18 IPC_OTYPE_MAIN_DEVICE Ipc_info_object_type_t = 19 IPC_OTYPE_TASK_NAME Ipc_info_object_type_t = 20 IPC_OTYPE_SUBSYSTEM Ipc_info_object_type_t = 21 IPC_OTYPE_IO_DONE_QUEUE Ipc_info_object_type_t = 22 IPC_OTYPE_SEMAPHORE Ipc_info_object_type_t = 23 IPC_OTYPE_LOCK_SET Ipc_info_object_type_t = 24 IPC_OTYPE_CLOCK Ipc_info_object_type_t = 25 IPC_OTYPE_CLOCK_CTRL Ipc_info_object_type_t = 26 IPC_OTYPE_IOKIT_IDENT Ipc_info_object_type_t = 27 IPC_OTYPE_NAMED_ENTRY Ipc_info_object_type_t = 28 IPC_OTYPE_IOKIT_CONNECT Ipc_info_object_type_t = 29 IPC_OTYPE_IOKIT_OBJECT Ipc_info_object_type_t = 30 IPC_OTYPE_UPL Ipc_info_object_type_t = 31 IPC_OTYPE_MEM_OBJ_CONTROL Ipc_info_object_type_t = 32 IPC_OTYPE_AU_SESSIONPORT Ipc_info_object_type_t = 33 IPC_OTYPE_FILEPORT Ipc_info_object_type_t = 34 IPC_OTYPE_LABELH Ipc_info_object_type_t = 35 IPC_OTYPE_TASK_RESUME Ipc_info_object_type_t = 36 IPC_OTYPE_VOUCHER Ipc_info_object_type_t = 37 IPC_OTYPE_VOUCHER_ATTR_CONTROL Ipc_info_object_type_t = 38 IPC_OTYPE_WORK_INTERVAL Ipc_info_object_type_t = 39 IPC_OTYPE_UX_HANDLER Ipc_info_object_type_t = 40 IPC_OTYPE_UEXT_OBJECT Ipc_info_object_type_t = 41 IPC_OTYPE_ARCADE_REG Ipc_info_object_type_t = 42 IPC_OTYPE_EVENTLINK Ipc_info_object_type_t = 43 IPC_OTYPE_TASK_INSPECT Ipc_info_object_type_t = 44 IPC_OTYPE_TASK_READ Ipc_info_object_type_t = 45 IPC_OTYPE_THREAD_INSPECT Ipc_info_object_type_t = 46 IPC_OTYPE_THREAD_READ Ipc_info_object_type_t = 47 IPC_OTYPE_SUID_CRED Ipc_info_object_type_t = 48 IPC_OTYPE_HYPERVISOR Ipc_info_object_type_t = 49 IPC_OTYPE_TASK_ID_TOKEN Ipc_info_object_type_t = 50 IPC_OTYPE_TASK_FATAL Ipc_info_object_type_t = 51 IPC_OTYPE_KCDATA Ipc_info_object_type_t = 52 IPC_OTYPE_EXCLAVES_RESOURCE Ipc_info_object_type_t = 53 IPC_OTYPE_THREAD_RESUME Ipc_info_object_type_t = 54 IPC_OTYPE_UNKNOWN Ipc_info_object_type_t = 4294967295 )
func (Ipc_info_object_type_t) String ¶
func (e Ipc_info_object_type_t) String() string
type LAAccessControlOperation ¶
type LAAccessControlOperation int64
const ( // Access control will be used for item creation. LAAccessControlOperationCreateItem LAAccessControlOperation = 0 // Access control will be used for accessing existing item. LAAccessControlOperationUseItem LAAccessControlOperation = 1 // Access control will be used for key creation. LAAccessControlOperationCreateKey LAAccessControlOperation = 2 // Access control will be used for sign operation with existing key. LAAccessControlOperationUseKeySign LAAccessControlOperation = 3 // Access control will be used for data decryption using existing key. LAAccessControlOperationUseKeyDecrypt LAAccessControlOperation = 4 // Access control will be used for key exchange. LAAccessControlOperationUseKeyKeyExchange LAAccessControlOperation = 5 )
func (LAAccessControlOperation) String ¶
func (e LAAccessControlOperation) String() string
type LAAuthenticationRequirement ¶
type LAAuthenticationRequirement struct {
foundation.NSObject
}
@brief Builds requirements that can be used for protecting a @c LARight
Apple documentation: https://developer.apple.com/documentation/localauthentication/laauthenticationrequirement
func LAAuthenticationRequirementBiometryCurrentSetRequirement ¶
func LAAuthenticationRequirementBiometryCurrentSetRequirement() *LAAuthenticationRequirement
@brief Requires user authentication with the current biometric set @discussion The authorization will fail if: @li • Biometry is not available in the current device @li • There are no biometric enrollments @li • There is a change in the enrollment database -e.g a new TouchID finger is enrolled. @return @c LAAuthenticationRequirement instance
func LAAuthenticationRequirementBiometryRequirement ¶
func LAAuthenticationRequirementBiometryRequirement() *LAAuthenticationRequirement
@brief Requires biometric authentication @discussion The authorization will fail if: @li • Biometry is not available in the current device @li • There are no biometric enrollments @return @c LAAuthenticationRequirement instance
func LAAuthenticationRequirementBiometryRequirementWithFallback ¶
func LAAuthenticationRequirementBiometryRequirementWithFallback(fallback *LABiometryFallbackRequirement) *LAAuthenticationRequirement
@brief Requires biometric authentication or the given fallback method. @param fallback Fallback used in case biometry authentication fails, is not available or not preferred by the user. @return @c LAAuthenticationRequirement instance
func LAAuthenticationRequirementDefaultRequirement ¶
func LAAuthenticationRequirementDefaultRequirement() *LAAuthenticationRequirement
@brief Requires user authentication @return @c LAAuthenticationRequirement instance
func LAAuthenticationRequirementFromID ¶
func LAAuthenticationRequirementFromID(id objc.ID) *LAAuthenticationRequirement
type LABiometryFallbackRequirement ¶
type LABiometryFallbackRequirement struct {
foundation.NSObject
}
@brief Builds authentication requirements that can be used as fallbacks for biometric authentication
Apple documentation: https://developer.apple.com/documentation/localauthentication/labiometryfallbackrequirement
func LABiometryFallbackRequirementDefaultRequirement ¶
func LABiometryFallbackRequirementDefaultRequirement() *LABiometryFallbackRequirement
@brief Use default biometric fallback @return @c LABiometryFallbackRequirement instance
func LABiometryFallbackRequirementDevicePasscodeRequirement ¶
func LABiometryFallbackRequirementDevicePasscodeRequirement() *LABiometryFallbackRequirement
@brief Requires authorization using the device passcode @return @c LABiometryFallbackRequirement instance
func LABiometryFallbackRequirementFromID ¶
func LABiometryFallbackRequirementFromID(id objc.ID) *LABiometryFallbackRequirement
type LABiometryType ¶
type LABiometryType int64
const ( // The device does not support biometry. LABiometryTypeNone LABiometryType = 0 LABiometryNone LABiometryType = 0 // The device supports Touch ID. LABiometryTypeTouchID LABiometryType = 1 // The device supports Face ID. LABiometryTypeFaceID LABiometryType = 2 // The device supports Optic ID LABiometryTypeOpticID LABiometryType = 4 )
func (LABiometryType) String ¶
func (e LABiometryType) String() string
type LACompanionType ¶
type LACompanionType int64
const ( // Paired Apple Watch LACompanionTypeWatch LACompanionType = 1 )
func (LACompanionType) String ¶
func (e LACompanionType) String() string
type LAContext ¶
type LAContext struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/localauthentication/lacontext
func LAContextFromID ¶
func (*LAContext) BiometryType ¶
func (o *LAContext) BiometryType() LABiometryType
Indicates the type of the biometry supported by the device.
func (*LAContext) CanEvaluatePolicyError ¶
Determines if a particular policy can be evaluated. @discussion Policies can have certain requirements which, when not satisfied, would always cause the policy evaluation to fail - e.g. a passcode set, a fingerprint enrolled with Touch ID or a face set up with Face ID. This method allows easy checking for such conditions. Applications should consume the returned value immediately and avoid relying on it for an extensive period of time. At least, it is guaranteed to stay valid until the application enters background. @warning Do not call this method in the reply block of evaluatePolicy:reply: because it could lead to a deadlock. @param policy Policy for which the preflight check should be run. @param error Optional output parameter which is set to nil if the policy can be evaluated, or it contains error information if policy evaluation is not possible. @return YES if the policy can be evaluated, NO otherwise.
func (*LAContext) DomainState ¶
func (o *LAContext) DomainState() *LADomainState
Contains authentication domain state.
func (*LAContext) EvaluateAccessControlOperationLocalizedReasonReply ¶
func (o *LAContext) EvaluateAccessControlOperationLocalizedReasonReply(accessControl unsafe.Pointer, operation LAAccessControlOperation, localizedReason *foundation.NSString, reply func(bool, unsafe.Pointer))
Evaluates access control object for the specified operation. @discussion Access control evaluation may involve prompting user for various kinds of interaction or authentication. Actual behavior is dependent on evaluated access control, device type, and can be affected by installed configuration profiles. Be sure to keep a strong reference to the context while the evaluation is in progress. Otherwise, an evaluation would be canceled when the context is being deallocated. The method does not block. Instead, the caller must provide a reply block to be called asynchronously when evaluation finishes. The block is executed on a private queue internal to the framework in an unspecified threading context. Other than that, no guarantee is made about which queue, thread, or run-loop the block is executed on. After successful access control evaluation, the LAContext can be used with keychain operations, so that they do not require user to authenticate. Access control evaluation may fail for various reasons, including user cancel, system cancel and others, see LAError codes. @param accessControl Access control object that is typically created by SecAccessControlCreateWithFlags. @param operation Type of operation the access control will be used with. @param localizedReason Application reason for authentication. This string must be provided in correct localization and should be short and clear. It will be eventually displayed in the authentication dialog as a part of the following string: "<appname>" is trying to <localized reason>. For example, if the app name is "TestApp" and localizedReason is passed "access the hidden records", then the authentication prompt will read: "TestApp" is trying to access the hidden records. @param reply Reply block that is executed when access control evaluation finishes. success Reply parameter that is YES if the access control has been evaluated successfully or NO if the evaluation failed. error Reply parameter that is nil if the access control has been evaluated successfully, or it contains error information about the evaluation failure. @warning localizedReason parameter is mandatory and the call will throw NSInvalidArgumentException if nil or empty string is specified.
func (*LAContext) EvaluatePolicyLocalizedReasonReply ¶
func (o *LAContext) EvaluatePolicyLocalizedReasonReply(policy LAPolicy, localizedReason *foundation.NSString, reply func(bool, unsafe.Pointer))
Evaluates the specified policy. @discussion Policy evaluation may involve prompting user for various kinds of interaction or authentication. Actual behavior is dependent on evaluated policy, device type, and can be affected by installed configuration profiles. Be sure to keep a strong reference to the context while the evaluation is in progress. Otherwise, an evaluation would be canceled when the context is being deallocated. The method does not block. Instead, the caller must provide a reply block to be called asynchronously when evaluation finishes. The block is executed on a private queue internal to the framework in an unspecified threading context. Other than that, no guarantee is made about which queue, thread, or run-loop the block is executed on. Implications of successful policy evaluation are policy specific. In general, this operation is not idempotent. Policy evaluation may fail for various reasons, including user cancel, system cancel and others, see LAError codes. @param policy Policy to be evaluated. @param reply Reply block that is executed when policy evaluation finishes. success Reply parameter that is YES if the policy has been evaluated successfully or NO if the evaluation failed. error Reply parameter that is nil if the policy has been evaluated successfully, or it contains error information about the evaluation failure. @param localizedReason Application reason for authentication. This string must be provided in correct localization and should be short and clear. It will be eventually displayed in the authentication dialog as a part of the following string: "<appname>" is trying to <localized reason>. For example, if the app name is "TestApp" and localizedReason is passed "access the hidden records", then the authentication prompt will read: "TestApp" is trying to access the hidden records. @warning localizedReason parameter is mandatory and the call will throw NSInvalidArgumentException if nil or empty string is specified. @see LAError Typical error codes returned by this call are: @li LAErrorUserFallback if user tapped the fallback button @li LAErrorUserCancel if user has tapped the Cancel button @li LAErrorSystemCancel if some system event interrupted the evaluation (e.g. Home button pressed).
func (*LAContext) EvaluatedPolicyDomainState ¶
func (o *LAContext) EvaluatedPolicyDomainState() *foundation.NSData
Contains policy domain state. @discussion This property is set only when evaluatePolicy is called and succesful Touch ID or Face ID authentication was performed, or when canEvaluatePolicy succeeds for a biometric policy. It stays nil for all other cases. If biometric database was modified (fingers or faces were removed or added), evaluatedPolicyDomainState data will change. Nature of such database changes cannot be determined but comparing data of evaluatedPolicyDomainState after different evaluatePolicy will reveal the fact database was changed between calls. @warning Please note that the value returned by this property can change exceptionally between major OS versions even if the state of biometry has not changed. Deprecated: since macOS 15.0.
func (*LAContext) InteractionNotAllowed ¶
Allows running authentication in non-interactive mode. @discussion If the context is used in a keychain query by the means of kSecUseAuthenticationContext, then setting this property to YES has the same effect as passing kSecUseNoAuthenticationUI in the query, i.e. the keychain call will eventually fail with errSecInteractionNotAllowed instead of displaying the authentication UI. If this property is used with a LocalAuthentication evaluation, it will eventually fail with LAErrorNotInteractive instead of displaying the authentication UI.
func (*LAContext) Invalidate ¶
func (o *LAContext) Invalidate()
Invalidates the context. @discussion The context is invalidated automatically when it is (auto)released. This method allows invalidating it manually while it is still in scope. Invalidation terminates any existing policy evaluation and the respective call will fail with LAErrorAppCancel. After the context has been invalidated, it can not be used for policy evaluation and an attempt to do so will fail with LAErrorInvalidContext. Invalidating a context that has been already invalidated has no effect.
func (*LAContext) IsCredentialSet ¶
func (o *LAContext) IsCredentialSet(type_ LACredentialType) bool
Reveals if credential was set with this context. @param type Type of credential we are asking for. @return YES on success, NO otherwise.
func (*LAContext) LocalizedCancelTitle ¶
func (o *LAContext) LocalizedCancelTitle() *foundation.NSString
Cancel button title. @discussion Allows cancel button title customization. A default title "Cancel" is used when this property is left nil or is set to empty string.
func (*LAContext) LocalizedFallbackTitle ¶
func (o *LAContext) LocalizedFallbackTitle() *foundation.NSString
Fallback button title. @discussion Allows fallback button title customization. If set to empty string, the button will be hidden. A default title "Use Password…" is used when this property is left nil.
func (*LAContext) LocalizedReason ¶
func (o *LAContext) LocalizedReason() *foundation.NSString
Allows setting the default localized authentication reason on context. @discussion A localized string from this property is displayed in the authentication UI if the caller didn't specify its own authentication reason (e.g. a keychain operation with kSecUseAuthenticationContext). This property is ignored if the authentication reason was provided by caller.
func (*LAContext) MaxBiometryFailures ¶
func (o *LAContext) MaxBiometryFailures() *foundation.NSNumber
This property is deprecated and setting it has no effect. Deprecated: No longer supported
func (*LAContext) SetCredentialType ¶
func (o *LAContext) SetCredentialType(credential *foundation.NSData, type_ LACredentialType) bool
Sets a credential to this context. @discussion Some policies allow to bind application-provided credential with them. This method allows credential to be passed to the right context. @param credential Credential to be used with subsequent calls. Setting this parameter to nil will remove any existing credential of the specified type. @param type Type of the provided credential. @return YES if the credential was set successfully, NO otherwise.
func (*LAContext) SetInteractionNotAllowed ¶
func (*LAContext) SetLocalizedCancelTitle ¶
func (o *LAContext) SetLocalizedCancelTitle(localizedCancelTitle *foundation.NSString)
func (*LAContext) SetLocalizedFallbackTitle ¶
func (o *LAContext) SetLocalizedFallbackTitle(localizedFallbackTitle *foundation.NSString)
func (*LAContext) SetLocalizedReason ¶
func (o *LAContext) SetLocalizedReason(localizedReason *foundation.NSString)
func (*LAContext) SetMaxBiometryFailures
deprecated
func (o *LAContext) SetMaxBiometryFailures(maxBiometryFailures *foundation.NSNumber)
Deprecated: No longer supported
func (*LAContext) SetTouchIDAuthenticationAllowableReuseDuration ¶
func (*LAContext) TouchIDAuthenticationAllowableReuseDuration ¶
Time interval for accepting a successful Touch ID or Face ID device unlock (on the lock screen) from the past. @discussion This property can be set with a time interval in seconds. If the device was successfully unlocked by biometry within this time interval, then biometric authentication on this context will succeed automatically and the reply block will be called without prompting user for Touch ID or Face ID. The default value is 0, meaning that no previous biometric unlock can be reused. This property is meant only for reusing biometric matches from the device lock screen. It does not allow reusing previous biometric matches in application or between applications. The maximum supported interval is 5 minutes and setting the value beyond 5 minutes does not increase the accepted interval. @see LATouchIDAuthenticationMaximumAllowableReuseDuration
type LACredentialType ¶
type LACredentialType int64
const ( // Password provided by application @discussion If not set, LocalAuthentication will ask for the password when necessary. It will use its own user interface depending on the evaluated policy or ACL. Applications can provide the password using the setCredential method. In such case, LocalAuthentication will not show password entry user interface. When entered from the LocalAuthentication user interface, the password is stored as UTF-8 encoded string. LACredentialTypeApplicationPassword LACredentialType = 0 // Smart card PIN provided by application @discussion If not set, LocalAuthentication will ask users for the smart card PIN when necessary. Applications can provide the PIN using setCredential method. In such case, LocalAuthentication will not show the smart card PIN user interface. When entered from the LocalAuthentication user interface, the PIN is stored as UTF-8 encoded string. LACredentialTypeSmartCardPIN LACredentialType = -3 )
func (LACredentialType) String ¶
func (e LACredentialType) String() string
type LADomainState ¶
type LADomainState struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/localauthentication/ladomainstate
func LADomainStateFromID ¶
func LADomainStateFromID(id objc.ID) *LADomainState
func (*LADomainState) Biometry ¶
func (o *LADomainState) Biometry() *LADomainStateBiometry
Contains biometric domain state.
func (*LADomainState) Companion ¶
func (o *LADomainState) Companion() *LADomainStateCompanion
Contains companion domain state.
func (*LADomainState) StateHash ¶
func (o *LADomainState) StateHash() *foundation.NSData
Contains combined state hash data for biometry and companion state hashes. @warning Please note that the value returned by this property can change exceptionally between major OS versions even if the list of paired companions has not changed.
type LADomainStateBiometry ¶
type LADomainStateBiometry struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/localauthentication/ladomainstatebiometry
func LADomainStateBiometryFromID ¶
func LADomainStateBiometryFromID(id objc.ID) *LADomainStateBiometry
func (*LADomainStateBiometry) BiometryType ¶
func (o *LADomainStateBiometry) BiometryType() LABiometryType
Indicates biometry type available on the device.
func (*LADomainStateBiometry) StateHash ¶
func (o *LADomainStateBiometry) StateHash() *foundation.NSData
Contains state hash data for the available biometry type. Returns `nil` if no biometry entities are enrolled. @discussion If biometric database was modified (fingers, faces were removed or added), `stateHash` data will change. Nature of such database changes cannot be determined but comparing data of `stateHash` after different evaluatePolicy calls will reveal the fact database was changed between the calls. @warning Please note that the value returned by this property can change exceptionally between major OS versions even if the state of biometry has not changed.
type LADomainStateCompanion ¶
type LADomainStateCompanion struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/localauthentication/ladomainstatecompanion
func LADomainStateCompanionFromID ¶
func LADomainStateCompanionFromID(id objc.ID) *LADomainStateCompanion
func (*LADomainStateCompanion) AvailableCompanionTypes ¶
func (o *LADomainStateCompanion) AvailableCompanionTypes() *foundation.NSSet[*foundation.NSNumber]
Indicates types of companions paired with the device. The elements are NSNumber-wrapped instances of @c `LACompanionType`.
func (*LADomainStateCompanion) StateHash ¶
func (o *LADomainStateCompanion) StateHash() *foundation.NSData
Contains combined state hash data for all available companion types. . Returns `nil` if no companion devices are paired. @discussion As long as database of paired companion devices doesn't change, `stateHash` stays the same for the same set of `availableCompanions`. If database of paired companion devices was modified, `stateHash` data will change. Nature of such database changes cannot be determined but comparing data of `stateHash` after different policy evaluation will reveal the fact database was changed between calls. If you are interested in a state hash for a specific companion type you can use `stateHashForCompanionType` method. @warning Please note that the value returned by this property can change exceptionally between major OS versions even if the list of paired companions has not changed.
func (*LADomainStateCompanion) StateHashForCompanionType ¶
func (o *LADomainStateCompanion) StateHashForCompanionType(companionType LACompanionType) *foundation.NSData
Returns state hash data for the given companion type. @discussion If database of paired devices of the given type was modified state hash data will change. Nature of such database changes cannot be determined but comparing data of state hash after different policy evaluation will reveal the fact database was changed between calls. @param companionType The companion type for which state hash data should be returned.
type LAEnvironment ¶
type LAEnvironment struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/localauthentication/laenvironment
func LAEnvironmentCurrentUser ¶
func LAEnvironmentCurrentUser() *LAEnvironment
Environment of the current user.
func LAEnvironmentFromID ¶
func LAEnvironmentFromID(id objc.ID) *LAEnvironment
func (*LAEnvironment) AddObserver ¶
func (o *LAEnvironment) AddObserver(observer LAEnvironmentObserver)
@brief Adds observer to monitor changes of the environment. @discussion The observer will be held weakly so its instance should be kept alive by the caller.
func (*LAEnvironment) RemoveObserver ¶
func (o *LAEnvironment) RemoveObserver(observer LAEnvironmentObserver)
@brief Removes the previously registered observer. @discussion If the observer is deallocated, it will be removed automatically.
func (*LAEnvironment) State ¶
func (o *LAEnvironment) State() *LAEnvironmentState
The environment state information.
type LAEnvironmentMechanism ¶
type LAEnvironmentMechanism struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/localauthentication/laenvironmentmechanism
func LAEnvironmentMechanismFromID ¶
func LAEnvironmentMechanismFromID(id objc.ID) *LAEnvironmentMechanism
func (*LAEnvironmentMechanism) IconSystemName ¶
func (o *LAEnvironmentMechanism) IconSystemName() *foundation.NSString
Name of the SF Symbol representing this authentication mechanism.
func (*LAEnvironmentMechanism) IsUsable ¶
func (o *LAEnvironmentMechanism) IsUsable() bool
@brief Whether the mechanism is available for use, i.e. whether the relevant preflight call of @c canEvaluatePolicy would succeed. @warning If @c isUsable reads @c NO, do not assume that it's because of some particular reason. You should check properties of the subclass to determine why mechanism can't be used.
func (*LAEnvironmentMechanism) LocalizedName ¶
func (o *LAEnvironmentMechanism) LocalizedName() *foundation.NSString
The localized name of the authentication mechanism, e.g. "Touch ID", "Face ID" etc.
type LAEnvironmentMechanismBiometry ¶
type LAEnvironmentMechanismBiometry struct {
LAEnvironmentMechanism
}
Apple documentation: https://developer.apple.com/documentation/localauthentication/laenvironmentmechanismbiometry
func LAEnvironmentMechanismBiometryFromID ¶
func LAEnvironmentMechanismBiometryFromID(id objc.ID) *LAEnvironmentMechanismBiometry
func (*LAEnvironmentMechanismBiometry) BiometryType ¶
func (o *LAEnvironmentMechanismBiometry) BiometryType() LABiometryType
@brief Type of biometry supported by the device. @discussion This property does not indicate whether biometry is available or not. It always reads the type of biometry supported by device hardware. You should check @c isUsable property to see if it is available for use.
func (*LAEnvironmentMechanismBiometry) BuiltInSensorInaccessible ¶
func (o *LAEnvironmentMechanismBiometry) BuiltInSensorInaccessible() bool
@brief Whether the built in biometric sensor is inaccessible in the current configuration, preventing the use of biometry. @discussion Currently, the only example of this is a Clamshell Mode on macOS. The user will be not able to use Touch ID if the MacBook lid is closed while connected to external monitor and keyboard, unless the external keyboard has Touch ID.
func (*LAEnvironmentMechanismBiometry) IsEnrolled ¶
func (o *LAEnvironmentMechanismBiometry) IsEnrolled() bool
@brief Whether the user has enrolled this biometry. @discussion Even if biometry is enrolled, it does not necessarily mean that it can be used. You should check @c isUsable property to see if it is available for use.
func (*LAEnvironmentMechanismBiometry) IsLockedOut ¶
func (o *LAEnvironmentMechanismBiometry) IsLockedOut() bool
@brief Whether biometry is locked out. @discussion The system might lock the user out of biometry for various reasons. For example, with Face ID, the user is locked out after 5 failed match attempts in row. To recover from bio lockout, users need to enter their passcode (e.g. during device ulock).
func (*LAEnvironmentMechanismBiometry) StateHash ¶
func (o *LAEnvironmentMechanismBiometry) StateHash() *foundation.NSData
@brief The application specific state of the biometric enrollment as returned by @c LAContext.domainState.biometry.stateHash @discussion This value represents the state of the enrollment and changes whenever the biometric enrollment is changed. It does not directly map to the enrolled templates, e.g. if a finger is added to Touch ID enrollment and then removed, the final state would be different. It also returns different values to different apps to prevent tracking of user identity.
type LAEnvironmentMechanismCompanion ¶
type LAEnvironmentMechanismCompanion struct {
LAEnvironmentMechanism
}
Apple documentation: https://developer.apple.com/documentation/localauthentication/laenvironmentmechanismcompanion
func LAEnvironmentMechanismCompanionFromID ¶
func LAEnvironmentMechanismCompanionFromID(id objc.ID) *LAEnvironmentMechanismCompanion
func (*LAEnvironmentMechanismCompanion) StateHash ¶
func (o *LAEnvironmentMechanismCompanion) StateHash() *foundation.NSData
@brief Hash of the current companion pairing as returned by @c LAContext.domainState.companion.stateHash(for:) @discussion If no companion are paired for this companion type, @c stateHash property is @c nil. If at least one companion is paired for this companion type, @c stateHash is not @c nil and it changes whenever the set of paired companions of this type is changed.
func (*LAEnvironmentMechanismCompanion) Type ¶
func (o *LAEnvironmentMechanismCompanion) Type() LACompanionType
Type of the companion.
type LAEnvironmentMechanismUserPassword ¶
type LAEnvironmentMechanismUserPassword struct {
LAEnvironmentMechanism
}
Apple documentation: https://developer.apple.com/documentation/localauthentication/laenvironmentmechanismuserpassword
func LAEnvironmentMechanismUserPasswordFromID ¶
func LAEnvironmentMechanismUserPasswordFromID(id objc.ID) *LAEnvironmentMechanismUserPassword
func (*LAEnvironmentMechanismUserPassword) IsSet ¶
func (o *LAEnvironmentMechanismUserPassword) IsSet() bool
type LAEnvironmentObserver ¶
type LAEnvironmentObserver interface {
}
LAEnvironmentObserver wraps the ObjC protocol LAEnvironmentObserver.
type LAEnvironmentState ¶
type LAEnvironmentState struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/localauthentication/laenvironmentstate
func LAEnvironmentStateFromID ¶
func LAEnvironmentStateFromID(id objc.ID) *LAEnvironmentState
func (*LAEnvironmentState) AllMechanisms ¶
func (o *LAEnvironmentState) AllMechanisms() *foundation.NSArray[*LAEnvironmentMechanism]
@brief Information about all authentication mechanisms. @discussion This property aggregates @c biometry, @c userPassword, @c companions and any future authentication mechanisms.
func (*LAEnvironmentState) Biometry ¶
func (o *LAEnvironmentState) Biometry() *LAEnvironmentMechanismBiometry
@brief Information about biometric authentication (Touch ID, Face ID or Optic ID). @discussion @c nil if biometry is not supported by this device.
func (*LAEnvironmentState) Companions ¶
func (o *LAEnvironmentState) Companions() *foundation.NSArray[*LAEnvironmentMechanismCompanion]
@brief Companion authentication mechanisms. @discussion Companion mechanisms such as Apple Watch can appear and disappear as they get in and out of reach, but this property enumerates paired companions, even if they are not reachable at the moment. Check @c isUsable property to determine if a particular companion type is available for use. Note that items in this array represent paired companion types, not individual devices. Therefore, even if the user has paired multiple Apple Watch devices for companion authentication, the array will contain only one @c LAEnvironmentMechanimsCompanion instance of type @c LACompanionTypeWatch.
func (*LAEnvironmentState) UserPassword ¶
func (o *LAEnvironmentState) UserPassword() *LAEnvironmentMechanismUserPassword
@brief Information about local user password (on macOS) or passcode (on embedded platforms). @discussion @c nil if user password or passcode is not supported by this device.
type LAError ¶
type LAError int64
const ( // Authentication was not successful because user failed to provide valid credentials. LAErrorAuthenticationFailed LAError = -1 // Authentication was canceled by user (e.g. tapped Cancel button). LAErrorUserCancel LAError = -2 // Authentication was canceled because the user tapped the fallback button (Enter Password). LAErrorUserFallback LAError = -3 // Authentication was canceled by system (e.g. another application went to foreground). LAErrorSystemCancel LAError = -4 // Authentication could not start because passcode is not set on the device. LAErrorPasscodeNotSet LAError = -5 // Authentication could not start because Touch ID is not available on the device. LAErrorTouchIDNotAvailable LAError = -6 // Authentication could not start because Touch ID has no enrolled fingers. LAErrorTouchIDNotEnrolled LAError = -7 // Authentication was not successful because there were too many failed Touch ID attempts and Touch ID is now locked. Passcode is required to unlock Touch ID, e.g. evaluating LAPolicyDeviceOwnerAuthenticationWithBiometrics will ask for passcode as a prerequisite. LAErrorTouchIDLockout LAError = -8 // Authentication was canceled by application (e.g. invalidate was called while authentication was in progress). LAErrorAppCancel LAError = -9 // LAContext passed to this call has been previously invalidated. LAErrorInvalidContext LAError = -10 // Authentication could not start because biometry is not available on the device. LAErrorBiometryNotAvailable LAError = -6 // Authentication could not start because biometry has no enrolled identities. LAErrorBiometryNotEnrolled LAError = -7 // Authentication was not successful because there were too many failed biometry attempts and biometry is now locked. Passcode is required to unlock biometry, e.g. evaluating LAPolicyDeviceOwnerAuthenticationWithBiometrics will ask for passcode as a prerequisite. LAErrorBiometryLockout LAError = -8 // Authentication failed because it would require showing UI which has been forbidden by using interactionNotAllowed property. LAErrorNotInteractive LAError = -1004 // Authentication could not start because there was no paired watch device nearby. LAErrorWatchNotAvailable LAError = -11 // Authentication could not start because there was no paired companion device nearby. LAErrorCompanionNotAvailable LAError = -11 // Authentication could not start because this device supports biometry only via removable accessories and no accessory has been paired. LAErrorBiometryNotPaired LAError = -12 // Authentication could not start because this device supports biometry only via removable accessories and the paired accessory is not connected. LAErrorBiometryDisconnected LAError = -13 // Authentication could not start because dimensions of embedded UI are invalid. LAErrorInvalidDimensions LAError = -14 )
type LAPersistedRight ¶
type LAPersistedRight struct {
LARight
}
Apple documentation: https://developer.apple.com/documentation/localauthentication/lapersistedright
func LAPersistedRightFromID ¶
func LAPersistedRightFromID(id objc.ID) *LAPersistedRight
func (*LAPersistedRight) Key ¶
func (o *LAPersistedRight) Key() *LAPrivateKey
@brief Managed private key
func (*LAPersistedRight) Secret ¶
func (o *LAPersistedRight) Secret() *LASecret
@brief Generic secret @discussion This is the generic secret that would have been stored along with the right
type LAPolicy ¶
type LAPolicy int64
const ( // Device owner will be authenticated using a biometric method (Touch ID). @discussion Biometric authentication is required. If Touch ID is not available, not enrolled or locked out, then the evaluation of this policy will fail with LAErrorBiometryNotAvailable, LAErrorBiometryNotEnrolled or LAErrorBiometryLockout. Touch ID authentication dialog contains a cancel button with default title "Cancel" which can be customized using localizedCancelTitle property, and a fallback button with default title "Use Password…" which can be customized using localizedFallbackTitle property. Clicking either button causes evaluatePolicy call to fail, returning a distinct error code: LAErrorUserCancel or LAErrorUserFallback. Biometric authentication will get locked after 5 unsuccessful attempts. After that, users have to unlock it by entering their account password. The password can be entered either at login window or in the preference sheets or even in application by the means of LAPolicyDeviceOwnerAuthentication. The system unlock is preferred user experience because we generaly don't want users to enter their account password at application's request. LAPolicyDeviceOwnerAuthenticationWithBiometrics LAPolicy = 1 // Device owner will be authenticated by biometry or user password. @discussion Touch ID or user password authentication is required. If Touch ID is not available, not enrolled or locked out, then the user is asked for password right away. Touch ID authentication dialog behaves similarly as the one used by LAPolicyDeviceOwnerAuthenticationWithBiometrics. However, the "Use Password.." button does not end the authentication. Instead, it switches the authentication mechanism to user password. LAPolicyDeviceOwnerAuthentication LAPolicy = 2 // Device owner will be authenticated by a companion device e.g. Watch, Mac, etc. @discussion Companion authentication is required. If no nearby paired companion device can be found, LAErrorCompanionNotAvailable is returned. Users should follow instructions on the companion device to authenticate. LAPolicyDeviceOwnerAuthenticationWithCompanion LAPolicy = 3 // Device owner will be authenticated by biometry or a companion device e.g. Watch, Mac, etc. @discussion Companion or biometric authentication is required. If no nearby paired companion device can be found, it behaves as LAPolicyDeviceOwnerAuthenticationWithBiometrics. Similarly, if biometry is unavailable it behaves as LAPolicyDeviceOwnerAuthenticationWithCompanion. Depending on the companion type and biometry and companion availability, either a user is asked to authenticate with biometry and on a companion device in parallel or the companion authentication takes precedence and a user is asked to authenticate exclusively on the companion device if available. Users should follow instructions on the companion device to authenticate. LAPolicyDeviceOwnerAuthenticationWithBiometricsOrCompanion LAPolicy = 4 // Device owner will be authenticated by Watch. @discussion Watch authentication is required. If no nearby paired watch device can be found, LAErrorWatchNotAvailable is returned. Watch authentication dialog looks and behaves similarly to the biometric variant. Users can confirm authentication by double-clicking the side button on their watch. LAPolicyDeviceOwnerAuthenticationWithWatch LAPolicy = 3 // Device owner will be authenticated by biometry or Watch. @discussion Watch or biometric authentication is required. If no nearby paired watch device can be found, it behaves as LAPolicyDeviceOwnerAuthenticationWithBiometrics. Similarly, if biometry is unavailable it behaves as LAPolicyDeviceOwnerAuthenticationWithWatch. Watch authentication dialog looks and behaves similarly to biometric variant. When both mechanisms are available, user is asked to use biometry and watch authentication will run in parallel. LAPolicyDeviceOwnerAuthenticationWithBiometricsOrWatch LAPolicy = 4 )
type LAPrivateKey ¶
type LAPrivateKey struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/localauthentication/laprivatekey
func LAPrivateKeyFromID ¶
func LAPrivateKeyFromID(id objc.ID) *LAPrivateKey
func (*LAPrivateKey) CanDecryptUsingSecKeyAlgorithm ¶
func (o *LAPrivateKey) CanDecryptUsingSecKeyAlgorithm(algorithm unsafe.Pointer) bool
@brief Checks if the the provided algorithm can be used for decryption @param algorithm Cryptographic algorithm @return @c YES in case the key supports the provided algorithm with the specified operation.
func (*LAPrivateKey) CanExchangeKeysUsingSecKeyAlgorithm ¶
func (o *LAPrivateKey) CanExchangeKeysUsingSecKeyAlgorithm(algorithm unsafe.Pointer) bool
@brief Checks if the the provided algorithm can be used for performing key exchanges @param algorithm Cryptographic algorithm @return @c YES in case the key supports the provided algorithm with the specified operation.
func (*LAPrivateKey) CanSignUsingSecKeyAlgorithm ¶
func (o *LAPrivateKey) CanSignUsingSecKeyAlgorithm(algorithm unsafe.Pointer) bool
@brief Checks if the the provided algorithm can be used for signing data @param algorithm Cryptographic algorithm @return @c YES in case the key supports the provided algorithm with the specified operation.
func (*LAPrivateKey) DecryptDataSecKeyAlgorithmCompletion ¶
func (o *LAPrivateKey) DecryptDataSecKeyAlgorithmCompletion(data *foundation.NSData, algorithm unsafe.Pointer, handler func(*foundation.NSData, unsafe.Pointer))
@brief Decrypts the given ciphertext @param data The data to decrypt. The length and format of the data must conform to chosen algorithm, typically be less or equal to the value returned by SecKeyGetBlockSize(). @param algorithm A @c SecKeyAlgorithm suitable for decrypting data with this key –e.g: @c kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA256AESGCM @param handler Completion handler with plaintext or an error on failure.
func (*LAPrivateKey) ExchangeKeysWithPublicKeySecKeyAlgorithmSecKeyParametersCompletion ¶
func (o *LAPrivateKey) ExchangeKeysWithPublicKeySecKeyAlgorithmSecKeyParametersCompletion(publicKey *foundation.NSData, algorithm unsafe.Pointer, parameters *foundation.NSDictionary[objc.ID, objc.ID], handler func(*foundation.NSData, unsafe.Pointer))
@brief Performs a Diffie-Hellman style key exchange operation @param publicKey Remote party's public key. @param algorithm A @c SecKeyAlgorithm suitable for performing a key exchange with this key –e.g: @c kSecKeyAlgorithmECDHKeyExchangeCofactorX963SHA256 @param parameters Dictionary with parameters, see @c SecKeyKeyExchangeParameter constants. Used algorithm determines the set of required and optional parameters to be used. @param handler Completion handler with the result of the key exchange or an error on failure.
func (*LAPrivateKey) PublicKey ¶
func (o *LAPrivateKey) PublicKey() *LAPublicKey
@brief Offers the public key counterpart of a @c LAPrivateKey instance
func (*LAPrivateKey) SignDataSecKeyAlgorithmCompletion ¶
func (o *LAPrivateKey) SignDataSecKeyAlgorithmCompletion(data *foundation.NSData, algorithm unsafe.Pointer, handler func(*foundation.NSData, unsafe.Pointer))
@brief Generates a digital signature for the given data. @param data The data to be signed, typically the digest of the actual data. @param algorithm A @c SecKeyAlgorithm suitable for generating signatures with this key – e.g: @c kSecKeyAlgorithmECDSASignatureMessageX962SHA256 @param handler Completion handler with the signature of given data or an error on failure.
type LAPublicKey ¶
type LAPublicKey struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/localauthentication/lapublickey
func LAPublicKeyFromID ¶
func LAPublicKeyFromID(id objc.ID) *LAPublicKey
func (*LAPublicKey) CanEncryptUsingSecKeyAlgorithm ¶
func (o *LAPublicKey) CanEncryptUsingSecKeyAlgorithm(algorithm unsafe.Pointer) bool
@brief Checks if the the provided algorithm can be used for encryption with the key. @param algorithm Cryptographic algorithm @return @c YES in case the key supports the provided algorithm with the specified operation.
func (*LAPublicKey) CanVerifyUsingSecKeyAlgorithm ¶
func (o *LAPublicKey) CanVerifyUsingSecKeyAlgorithm(algorithm unsafe.Pointer) bool
@brief Checks if the the provided algorithm can be used for verifying signatures with the key. @param algorithm Cryptographic algorithm @return @c YES in case the key supports the provided algorithm with the specified operation.
func (*LAPublicKey) EncryptDataSecKeyAlgorithmCompletion ¶
func (o *LAPublicKey) EncryptDataSecKeyAlgorithmCompletion(data *foundation.NSData, algorithm unsafe.Pointer, handler func(*foundation.NSData, unsafe.Pointer))
@brief Encrypts the given data @param data The data to encrypt. @param algorithm A @c SecKeyAlgorithm suitable for encrypting with this key –e.g: @c kSecKeyAlgorithmECIESEncryptionStandardVariableIVX963SHA256AESGCM . @param handler Completion handler with the cipher text or an error on failure.
func (*LAPublicKey) ExportBytesWithCompletion ¶
func (o *LAPublicKey) ExportBytesWithCompletion(handler func(*foundation.NSData, unsafe.Pointer))
@brief Exports public key bytes. @param handler Completion handler with the raw bytes of the public key or an error on failure
func (*LAPublicKey) VerifyDataSignatureSecKeyAlgorithmCompletion ¶
func (o *LAPublicKey) VerifyDataSignatureSecKeyAlgorithmCompletion(signedData *foundation.NSData, signature *foundation.NSData, algorithm unsafe.Pointer, handler func(unsafe.Pointer))
@brief Verifies a digital signature for the given data. @param signedData The signed data. @param signature The signature of the given data. @param algorithm One of @c SecKeyAlgorithm suitable for verifying signatures with this key –e.g: @c kSecKeyAlgorithmECDSASignatureMessageX962SHA256 @param handler Completion handler with the signature of given data or an error on failure.
type LARight ¶
type LARight struct {
foundation.NSObject
}
@brief Groups a set of requirements that need to be satisfied in order to grant access to certain resource or operation
Apple documentation: https://developer.apple.com/documentation/localauthentication/laright
func LARightFromID ¶
func (*LARight) AuthorizeWithLocalizedReasonCompletion ¶
func (o *LARight) AuthorizeWithLocalizedReasonCompletion(localizedReason *foundation.NSString, handler func(unsafe.Pointer))
@brief Tries to authorize the right. @param localizedReason Localized explanation for the authorization. Appears in the UI presented to the user. @param handler Completion handler called after the authorization finishes. Returns an error when the authorization fails.
func (*LARight) CheckCanAuthorizeWithCompletion ¶
@brief Checks whether the client can eventually be granted the right. @param handler Completion handler. Returns @c nil if the right can be authorized or an error otherwise.
func (*LARight) DeauthorizeWithCompletion ¶
func (o *LARight) DeauthorizeWithCompletion(handler func())
@brief Invalidates a previously authorized right. @param handler Completion handler called after the right is deauthorized.
func (*LARight) Init ¶
@brief Constructs a right using default authorization requirements @discussion For authorizing a right with default requirements a user will be asked to authenticate using biometry or the device passcode. @return @c LARight instance
func (*LARight) InitWithRequirement ¶
func (o *LARight) InitWithRequirement(requirement *LAAuthenticationRequirement) *LARight
@brief Constructs a right that will be granted only when the given @c LAAuthenticationRequirement is satisfied. @param requirement Requirement that needs to be satisfied to authorize the right @return @c LARight instance
func (*LARight) State ¶
func (o *LARight) State() LARightState
@brief Provides the current authorization state of the @c LARight instance
type LARightState ¶
type LARightState int64
const ( // @brief Right has not been evaluated yet. @discussion This is the initial state of @c LARight and changes when @c authorize method is called. LARightStateUnknown LARightState = 0 // @brief Requirements are currently being evaluated. @discussion This happens after calling @c authorize method but before the user has granted the right. LARightStateAuthorizing LARightState = 1 // @brief Authorization was granted @discussion This can be achieved by successful authorization. LARightStateAuthorized LARightState = 2 // @brief Authorization was rejected. @discussion This can be caused by several reasons. For example requirements were not satisfied or user rejects to authorize. LARightStateNotAuthorized LARightState = 3 )
func (LARightState) String ¶
func (e LARightState) String() string
type LARightStore ¶
type LARightStore struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/localauthentication/larightstore
func LARightStoreFromID ¶
func LARightStoreFromID(id objc.ID) *LARightStore
func LARightStoreSharedStore ¶
func LARightStoreSharedStore() *LARightStore
@brief Shared instance of @c LARightStore.
func (*LARightStore) RemoveAllRightsWithCompletion ¶
func (o *LARightStore) RemoveAllRightsWithCompletion(handler func(unsafe.Pointer))
@brief Removes all rights stored by the client @param handler Completion handler with an error on failure.
func (*LARightStore) RemoveRightCompletion ¶
func (o *LARightStore) RemoveRightCompletion(right *LAPersistedRight, handler func(unsafe.Pointer))
@brief Removes a right from the persistent storage along with its associated resources. @param right @c LAPersistedRight instance to remove. @param handler Completion handler with an error on failure.
func (*LARightStore) RemoveRightForIdentifierCompletion ¶
func (o *LARightStore) RemoveRightForIdentifierCompletion(identifier *foundation.NSString, handler func(unsafe.Pointer))
@brief Removes right with provided identifier from persistent storage. @param identifier Identifier of @c LAPersistedRight instance to remove. @param handler Completion handler with an error on failure.
func (*LARightStore) RightForIdentifierCompletion ¶
func (o *LARightStore) RightForIdentifierCompletion(identifier *foundation.NSString, handler func(*LAPersistedRight, unsafe.Pointer))
@brief Fetches a right stored under the given identifier. @param identifier Identifier associated with a previously stored right. @param handler Completion handler with the fetched right or an error on failure.
func (*LARightStore) SaveRightIdentifierCompletion ¶
func (o *LARightStore) SaveRightIdentifierCompletion(right *LARight, identifier *foundation.NSString, handler func(*LAPersistedRight, unsafe.Pointer))
@brief Persists a right for later usage. @param right @c LARight instance to store. @param identifier Identifier to be associated with the right. Useful for later retrieval. @param handler Completion handler with the persisted right or an error on failure.
func (*LARightStore) SaveRightIdentifierSecretCompletion ¶
func (o *LARightStore) SaveRightIdentifierSecretCompletion(right *LARight, identifier *foundation.NSString, secret *foundation.NSData, handler func(*LAPersistedRight, unsafe.Pointer))
@brief Persists a right for later usage. @param right @c LARight instance to store. @param identifier Identifier to be associated with the right. Useful for later retrieval. @param secret Secret data to be associated with the provided right. @param handler Completion handler with the persisted right or an error on failure.
type LASecret ¶
type LASecret struct {
foundation.NSObject
}
Apple documentation: https://developer.apple.com/documentation/localauthentication/lasecret
func LASecretFromID ¶
func (*LASecret) LoadDataWithCompletion ¶
func (o *LASecret) LoadDataWithCompletion(handler func(*foundation.NSData, unsafe.Pointer))
@brief Fetch stored data if any @param handler Completion handler invoked with a generic secret stored along with the right or an error if no secret is found or the fetch operation fails.
type Launch_data_type_t ¶
type Launch_data_type_t int64
const ( LAUNCH_DATA_DICTIONARY Launch_data_type_t = 1 LAUNCH_DATA_ARRAY Launch_data_type_t = 2 LAUNCH_DATA_FD Launch_data_type_t = 3 LAUNCH_DATA_INTEGER Launch_data_type_t = 4 LAUNCH_DATA_REAL Launch_data_type_t = 5 LAUNCH_DATA_BOOL Launch_data_type_t = 6 LAUNCH_DATA_STRING Launch_data_type_t = 7 LAUNCH_DATA_OPAQUE Launch_data_type_t = 8 LAUNCH_DATA_ERRNO Launch_data_type_t = 9 LAUNCH_DATA_MACHPORT Launch_data_type_t = 10 )
func (Launch_data_type_t) String ¶
func (e Launch_data_type_t) String() string
type MDLabelDomain ¶
type MDLabelDomain int64
@typedef MDLabelDomain @abstract These constants are used to specify a domain to MDLabelCreate().
const ( KMDLabelUserDomain MDLabelDomain = 0 KMDLabelLocalDomain MDLabelDomain = 1 )
func (MDLabelDomain) String ¶
func (e MDLabelDomain) String() string
type MDQueryOptionFlags ¶
type MDQueryOptionFlags int64
const ( KMDQuerySynchronous MDQueryOptionFlags = 1 KMDQueryWantsUpdates MDQueryOptionFlags = 4 KMDQueryAllowFSTranslation MDQueryOptionFlags = 8 )
func (MDQueryOptionFlags) String ¶
func (e MDQueryOptionFlags) String() string
type MDQuerySortOptionFlags ¶
type MDQuerySortOptionFlags int64
@enum MDQuerySortOptionFlags @constant kMDQueryReverseSortOrderFlag Sort the attribute in reverse order.
const (
KMDQueryReverseSortOrderFlag MDQuerySortOptionFlags = 1
)
func (MDQuerySortOptionFlags) String ¶
func (e MDQuerySortOptionFlags) String() string
type Mach_vm_range_flags_t ¶
type Mach_vm_range_flags_t int64
const (
MACH_VM_RANGE_NONE Mach_vm_range_flags_t = 0
)
func (Mach_vm_range_flags_t) String ¶
func (e Mach_vm_range_flags_t) String() string
type Mach_vm_range_flavor_t ¶
type Mach_vm_range_flavor_t int64
const ( MACH_VM_RANGE_FLAVOR_INVALID Mach_vm_range_flavor_t = 0 MACH_VM_RANGE_FLAVOR_V1 Mach_vm_range_flavor_t = 1 )
func (Mach_vm_range_flavor_t) String ¶
func (e Mach_vm_range_flavor_t) String() string
type Mach_vm_range_tag_t ¶
type Mach_vm_range_tag_t int64
const ( MACH_VM_RANGE_DEFAULT Mach_vm_range_tag_t = 0 MACH_VM_RANGE_DATA Mach_vm_range_tag_t = 1 MACH_VM_RANGE_FIXED Mach_vm_range_tag_t = 2 )
func (Mach_vm_range_tag_t) String ¶
func (e Mach_vm_range_tag_t) String() string
type Mpo_flags_t ¶
type Mpo_flags_t int64
const ( MPO_PORT Mpo_flags_t = 0 MPO_SERVICE_PORT Mpo_flags_t = 1024 MPO_CONNECTION_PORT Mpo_flags_t = 2048 MPO_REPLY_PORT Mpo_flags_t = 4096 MPO_WEAK_REPLY_PORT Mpo_flags_t = 16384 MPO_NOTIFICATION_PORT Mpo_flags_t = 17408 MPO_EXCEPTION_PORT Mpo_flags_t = 32768 MPO_CONNECTION_PORT_WITH_PORT_ARRAY Mpo_flags_t = 65536 )
func (Mpo_flags_t) String ¶
func (e Mpo_flags_t) String() string
type Os_clockid_t ¶
type Os_clockid_t int64
const (
OS_CLOCK_MACH_ABSOLUTE_TIME Os_clockid_t = 32
)
func (Os_clockid_t) String ¶
func (e Os_clockid_t) String() string
type Ptrauth_key ¶
type Ptrauth_key int64
const ( Ptrauth_key_none Ptrauth_key = -1 Ptrauth_key_asia Ptrauth_key = 0 Ptrauth_key_asib Ptrauth_key = 1 Ptrauth_key_asda Ptrauth_key = 2 Ptrauth_key_asdb Ptrauth_key = 3 Ptrauth_key_process_independent_code Ptrauth_key = 0 Ptrauth_key_process_dependent_code Ptrauth_key = 1 Ptrauth_key_process_independent_data Ptrauth_key = 2 Ptrauth_key_process_dependent_data Ptrauth_key = 3 Ptrauth_key_return_address Ptrauth_key = 1 Ptrauth_key_frame_pointer Ptrauth_key = 3 Ptrauth_key_function_pointer Ptrauth_key = 0 Ptrauth_key_block_function Ptrauth_key = 0 Ptrauth_key_cxx_vtable_pointer Ptrauth_key = 2 Ptrauth_key_method_list_pointer Ptrauth_key = 2 Ptrauth_key_objc_isa_pointer Ptrauth_key = 2 Ptrauth_key_objc_super_pointer Ptrauth_key = 2 Ptrauth_key_objc_sel_pointer Ptrauth_key = 3 Ptrauth_key_objc_class_ro_pointer Ptrauth_key = 2 Ptrauth_key_block_descriptor_pointer Ptrauth_key = 2 Ptrauth_key_init_fini_pointer Ptrauth_key = 0 )
func (Ptrauth_key) String ¶
func (e Ptrauth_key) String() string
type Qos_class_t ¶
type Qos_class_t uint32
const ( QOS_CLASS_USER_INTERACTIVE Qos_class_t = 33 QOS_CLASS_USER_INITIATED Qos_class_t = 25 QOS_CLASS_DEFAULT Qos_class_t = 21 QOS_CLASS_UTILITY Qos_class_t = 17 QOS_CLASS_BACKGROUND Qos_class_t = 9 QOS_CLASS_UNSPECIFIED Qos_class_t = 0 )
func (Qos_class_t) String ¶
func (e Qos_class_t) String() string
type Virtual_memory_guard_exception_code_t ¶
type Virtual_memory_guard_exception_code_t int64
const ( KGUARD_EXC_DEALLOC_GAP Virtual_memory_guard_exception_code_t = 1 KGUARD_EXC_RECLAIM_COPYIO_FAILURE Virtual_memory_guard_exception_code_t = 2 KGUARD_EXC_RECLAIM_INDEX_FAILURE Virtual_memory_guard_exception_code_t = 4 KGUARD_EXC_RECLAIM_DEALLOCATE_FAILURE Virtual_memory_guard_exception_code_t = 8 KGUARD_EXC_RECLAIM_ACCOUNTING_FAILURE Virtual_memory_guard_exception_code_t = 9 KGUARD_EXC_SEC_IOPL_ON_EXEC_PAGE Virtual_memory_guard_exception_code_t = 10 KGUARD_EXC_SEC_EXEC_ON_IOPL_PAGE Virtual_memory_guard_exception_code_t = 11 KGUARD_EXC_SEC_UPL_WRITE_ON_EXEC_REGION Virtual_memory_guard_exception_code_t = 12 KGUARD_EXC_LARGE_ALLOCATION_TELEMETRY Virtual_memory_guard_exception_code_t = 13 KGUARD_EXC_SEC_ACCESS_FAULT Virtual_memory_guard_exception_code_t = 98 KGUARD_EXC_SEC_ASYNC_ACCESS_FAULT Virtual_memory_guard_exception_code_t = 99 KGUARD_EXC_SEC_COPY_DENIED Virtual_memory_guard_exception_code_t = 100 KGUARD_EXC_SEC_SHARING_DENIED Virtual_memory_guard_exception_code_t = 101 KGUARD_EXC_MTE_SYNC_FAULT Virtual_memory_guard_exception_code_t = 200 KGUARD_EXC_MTE_ASYNC_USER_FAULT Virtual_memory_guard_exception_code_t = 201 KGUARD_EXC_MTE_ASYNC_KERN_FAULT Virtual_memory_guard_exception_code_t = 202 KGUARD_EXC_GUARD_OBJECT_ASYNC_USER_FAULT Virtual_memory_guard_exception_code_t = 203 KGUARD_EXC_GUARD_OBJECT_ASYNC_KERN_FAULT Virtual_memory_guard_exception_code_t = 204 )
func (Virtual_memory_guard_exception_code_t) String ¶
func (e Virtual_memory_guard_exception_code_t) String() string
type Xpc_listener_create_flags_t ¶
type Xpc_listener_create_flags_t int64
const ( XPC_LISTENER_CREATE_NONE Xpc_listener_create_flags_t = 0 XPC_LISTENER_CREATE_INACTIVE Xpc_listener_create_flags_t = 1 XPC_LISTENER_CREATE_FORCE_MACH Xpc_listener_create_flags_t = 2 XPC_LISTENER_CREATE_FORCE_XPCSERVICE Xpc_listener_create_flags_t = 4 )
func (Xpc_listener_create_flags_t) String ¶
func (e Xpc_listener_create_flags_t) String() string
type Xpc_session_create_flags_t ¶
type Xpc_session_create_flags_t int64
const ( XPC_SESSION_CREATE_NONE Xpc_session_create_flags_t = 0 XPC_SESSION_CREATE_INACTIVE Xpc_session_create_flags_t = 1 XPC_SESSION_CREATE_MACH_PRIVILEGED Xpc_session_create_flags_t = 2 )
func (Xpc_session_create_flags_t) String ¶
func (e Xpc_session_create_flags_t) String() string
Source Files
¶
- LAAuthenticationRequirement.go
- LABiometryFallbackRequirement.go
- LAContext.go
- LADomainState.go
- LADomainStateBiometry.go
- LADomainStateCompanion.go
- LAEnvironment.go
- LAEnvironmentMechanism.go
- LAEnvironmentMechanismBiometry.go
- LAEnvironmentMechanismCompanion.go
- LAEnvironmentMechanismUserPassword.go
- LAEnvironmentState.go
- LAPersistedRight.go
- LAPrivateKey.go
- LAPublicKey.go
- LARight.go
- LARightStore.go
- LASecret.go
- doc.go
- localauthentication_enums.go
- localauthentication_externs.go
- localauthentication_protocols.go
- localauthentication_runtime.go