Contents

PKIdentityAuthorizationController

An object that presents a sheet that prompts the user to allow a request for identity information.

Declaration

class PKIdentityAuthorizationController

Mentioned in

Overview

Use this class to request PKIdentityElement objects from a mobile driver’s license or state identification card. When you request identity information, the system prompts the user for approval.

// Create an authorization controller.
let controller = PKIdentityAuthorizationController()

// Describe the elements you request.
let descriptor = PKIdentityDriversLicenseDescriptor()
descriptor.addElements([.age(atLeast: 18)], 
                        intentToStore: .willNotStore)
descriptor.addElements([.givenName, .portrait], 
                        intentToStore: .mayStore(days: 30))

// Create the request.
let request = PKIdentityRequest()
request.descriptor = descriptor
request.merchantIdentifier = // A merchant identifier you configure in the developer portal.
request.nonce = // Generate a nonce to verify a request is only made once.

// Prompt the user for approval.
controller.requestDocument(request) { document, error in
    // Handle the document response or error, if necessary.
}

The system returns response data as an encoded concise binary object representation (CBOR) blob; CBOR is a binary format similar to JSON. You must decrypt the response on your server.

For design guidance, see Human Interface Guidelines > Technologies > Wallet.

Topics

Describing a document

Requesting a document

Cancelling a request

See Also

Identity sheet interactions and authorization