Thank you for the quick response, @garrett-davidson.
Below is a piece of code that we are trying to use, along with comments to clarify the situation. Your comments will be greatly appreciated.
// Example: We visit https://example.com and press the register button, which internally triggers `navigator.credentials.create()`.
override func prepareInterface(forPasskeyRegistration registrationRequest: ASCredentialRequest) {
self.request = registrationRequest as! ASPasskeyCredentialRequest
let response = ASPasskeyRegistrationCredential(
// What string should be used here? example.com or https://example.com?
// Is this the correct documentation? Refer to: https://www.w3.org/TR/webauthn-2/#relying-party-identifier
relyingParty: self.request.credentialIdentity.serviceIdentifier.identifier,
// Is this the correct documentation for `clientDataHash`? See: https://www.w3.org/TR/webauthn-2/#collectedclientdata-hash-of-the-serialized-client-data
clientDataHash: self.request.clientDataHash,
// Is this the correct documentation? Check: https://www.w3.org/TR/webauthn-2/#credential-id
credentialID: Data(UUID().uuidString.utf8),
// Is this the correct documentation? See: https://www.w3.org/TR/webauthn-2/#sctn-generating-an-attestation-object
// Should the attestationObject be a CBOR map in bytes?
attestationObject: Data()
)
self.extensionContext.completeRegistrationRequest(using: response)
}