TKTokenSessionDelegate

Trait TKTokenSessionDelegate 

Source
pub unsafe trait TKTokenSessionDelegate: NSObjectProtocol {
    // Provided methods
    unsafe fn tokenSession_beginAuthForOperation_constraint_error(
        &self,
        session: &TKTokenSession,
        operation: TKTokenOperation,
        constraint: &TKTokenOperationConstraint,
    ) -> Result<Retained<TKTokenAuthOperation>, Retained<NSError>>
       where Self: Sized + Message { ... }
    unsafe fn tokenSession_supportsOperation_usingKey_algorithm(
        &self,
        session: &TKTokenSession,
        operation: TKTokenOperation,
        key_object_id: &TKTokenObjectID,
        algorithm: &TKTokenKeyAlgorithm,
    ) -> bool
       where Self: Sized + Message { ... }
    unsafe fn tokenSession_signData_usingKey_algorithm_error(
        &self,
        session: &TKTokenSession,
        data_to_sign: &NSData,
        key_object_id: &TKTokenObjectID,
        algorithm: &TKTokenKeyAlgorithm,
    ) -> Result<Retained<NSData>, Retained<NSError>>
       where Self: Sized + Message { ... }
    unsafe fn tokenSession_decryptData_usingKey_algorithm_error(
        &self,
        session: &TKTokenSession,
        ciphertext: &NSData,
        key_object_id: &TKTokenObjectID,
        algorithm: &TKTokenKeyAlgorithm,
    ) -> Result<Retained<NSData>, Retained<NSError>>
       where Self: Sized + Message { ... }
    unsafe fn tokenSession_performKeyExchangeWithPublicKey_usingKey_algorithm_parameters_error(
        &self,
        session: &TKTokenSession,
        other_party_public_key_data: &NSData,
        object_id: &TKTokenObjectID,
        algorithm: &TKTokenKeyAlgorithm,
        parameters: &TKTokenKeyExchangeParameters,
    ) -> Result<Retained<NSData>, Retained<NSError>>
       where Self: Sized + Message { ... }
}
Available on crate feature TKToken only.
Expand description

TKTokenSessionDelegate contains operations with token objects provided by token implementors which should be performed in the context of authentication session.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn tokenSession_beginAuthForOperation_constraint_error( &self, session: &TKTokenSession, operation: TKTokenOperation, constraint: &TKTokenOperationConstraint, ) -> Result<Retained<TKTokenAuthOperation>, Retained<NSError>>
where Self: Sized + Message,

Establishes a context for the requested authentication operation.

Parameter session: Related TKTokenSession instance.

Parameter operation: Identifier of the operation.

Parameter constraint: Constraint to be satisfied by this authentication operation.

Parameter error: Error details (see TKError.h).

Returns: authOperation Resulting context of the operation, which will be eventually finalized by receiving ‘finishWithError:’. The resulting ‘authOperation’ can be of any type based on TKTokenAuthOperation. For known types (e.g. TKTokenPasswordAuthOperation) the system will first fill in the context-specific properties (e.g. ‘password’) before triggering ‘finishWithError:’. When no authentication is actually needed (typically because the session is already authenticated for requested constraint), return instance of TKTokenAuthOperation class instead of any specific subclass.

§Safety

constraint should be of the correct type.

Source

unsafe fn tokenSession_supportsOperation_usingKey_algorithm( &self, session: &TKTokenSession, operation: TKTokenOperation, key_object_id: &TKTokenObjectID, algorithm: &TKTokenKeyAlgorithm, ) -> bool
where Self: Sized + Message,

Checks whether specified operation and algorithm is supported on specified key.

Parameter session: Related TKTokenSession instance.

Parameter operation: Type of cryptographic operation for which the list of supported algorithms should be retrieved.

Parameter keyObjectID: Identifier of the private key object.

Parameter algorithm: Algorithm with which the oepration should be performed.

Returns: YES if the operation is supported, NO otherwise.

§Safety

key_object_id should be of the correct type.

Source

unsafe fn tokenSession_signData_usingKey_algorithm_error( &self, session: &TKTokenSession, data_to_sign: &NSData, key_object_id: &TKTokenObjectID, algorithm: &TKTokenKeyAlgorithm, ) -> Result<Retained<NSData>, Retained<NSError>>
where Self: Sized + Message,

Performs cryptographic signature operation.

Parameter session: Related TKTokenSession instance.

Parameter dataToSign: Input data for the signature operation.

Parameter keyObjectID: Identifier of the private key object.

Parameter algorithm: Requested signature algorithm to be used.

Parameter error: Error details (see TKError.h). If authentication is required (by invoking beginAuthForOperation:), TKErrorCodeAuthenticationNeededshould be used.

Returns: Resulting signature, or nil if an error happened.

§Safety

key_object_id should be of the correct type.

Source

unsafe fn tokenSession_decryptData_usingKey_algorithm_error( &self, session: &TKTokenSession, ciphertext: &NSData, key_object_id: &TKTokenObjectID, algorithm: &TKTokenKeyAlgorithm, ) -> Result<Retained<NSData>, Retained<NSError>>
where Self: Sized + Message,

Decrypts ciphertext using private key.

Parameter session: Related TKTokenSession instance.

Parameter ciphertext: Encrypted data to decrypt.

Parameter keyObjectID: Identifier of the private key object.

Parameter algorithm: Requested encryption/decryption algorithm to be used.

Parameter error: Error details (see TKError.h). If authentication is required (by invoking beginAuthForOperation:), TKErrorCodeAuthenticationNeededshould be used.

Returns: Resulting decrypted plaintext, or nil if an error happened.

§Safety

key_object_id should be of the correct type.

Source

unsafe fn tokenSession_performKeyExchangeWithPublicKey_usingKey_algorithm_parameters_error( &self, session: &TKTokenSession, other_party_public_key_data: &NSData, object_id: &TKTokenObjectID, algorithm: &TKTokenKeyAlgorithm, parameters: &TKTokenKeyExchangeParameters, ) -> Result<Retained<NSData>, Retained<NSError>>
where Self: Sized + Message,

Performs Diffie-Hellman style key exchange operation.

Parameter session: Related TKTokenSession instance.

Parameter otherPartyPublicKeyData: Raw public data of other party public key.

Parameter objectID: Identifier of the private key object.

Parameter algorithm: Requested key exchange algorithm to be used.

Parameter parameters: Additional parameters for key exchange operation. Chosen algorithm dictates meaning of parameters.

Parameter error: Error details (see TKError.h). If authentication is required (by invoking beginAuthForOperation:), TKErrorCodeAuthenticationNeededshould be used.

Returns: Result of key exchange operation, or nil if the operation failed.

§Safety

object_id should be of the correct type.

Trait Implementations§

Source§

impl ProtocolType for dyn TKTokenSessionDelegate

Source§

const NAME: &'static str = "TKTokenSessionDelegate"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn TKTokenSessionDelegate

Implementations on Foreign Types§

Source§

impl<T> TKTokenSessionDelegate for ProtocolObject<T>

Implementors§