Platform MFi Authentication

Includes:
"Common.h"

Introduction

This header contains function prototypes called by Apple code that must be implemented by the platform. These functions are called when Apple code needs to interact with the Apple Authentication Coprocessor. Please refer to the relevant version of the "Auth IC" document to obtain more details on how to interact with the Authentication Coprocessor. This document can be found on the MFi Portal.



Functions

PlatformMFiAuthCopyCertificate

Copy the certificate from the Apple Authentication Coprocessor.

PlatformMFiAuthCreateSignature

Create an RSA signature from the specified SHA-1 digest using the Apple Authentication Coprocessor.

PlatformMFiAuthFinalize

Performs any platform-specific cleanup needed. Example: Bringing down the I2C interface for communication with the Apple Authentication Coprocessor.

PlatformMFiAuthInitialize

Performs any platform-specific initialization needed. Example: Bring up I2C interface for communication with the Apple Authentication Coprocessor.


PlatformMFiAuthCopyCertificate


Copy the certificate from the Apple Authentication Coprocessor.

OSStatus PlatformMFiAuthCopyCertificate(
    uint8_t **outCertificatePtr,
    size_t *outCertificateLen );  
Parameters
outCertificatePtr

Receives malloc()'d ptr to a DER-encoded PKCS#7 message containing the certificate. Caller must free() on success.

outCertificateLen

Number of bytes in the DER-encoded certificate.


PlatformMFiAuthCreateSignature


Create an RSA signature from the specified SHA-1 digest using the Apple Authentication Coprocessor.

OSStatus PlatformMFiAuthCreateSignature(
    const void *inDigestPtr, 
    size_t inDigestLen, 
    uint8_t **outSignaturePtr, 
    size_t *outSignatureLen );  
Parameters
inDigestPtr

Pointer to 20-byte SHA-1 digest.

inDigestLen

Number of bytes in the digest. Must be 20.

outSignaturePtr

Receives malloc()'d ptr to RSA signature. Caller must free() on success.

outSignatureLen

Receives number of bytes in RSA signature.


PlatformMFiAuthFinalize


Performs any platform-specific cleanup needed. Example: Bringing down the I2C interface for communication with the Apple Authentication Coprocessor.

void PlatformMFiAuthFinalize(
    void );  

PlatformMFiAuthInitialize


Performs any platform-specific initialization needed. Example: Bring up I2C interface for communication with the Apple Authentication Coprocessor.

OSStatus PlatformMFiAuthInitialize(
    void );