Biometric Signatures on iOS
A digital signature’s biometric properties are stored via PDFSignatureBiometricProperties
. This information includes things like whether or not the signature was created with a stylus, the size of the signee’s finger, and the timing and pressure information that was collected while writing the signature. Ultimately, this data can be used to create solutions that provide a higher grade of security than traditional digital signatures do. A digital signature can only contain biometric data if an ink signature was used to create it.
The following biometric properties and data points can be captured and stored in a digital signature from the signing user interface (UI):
-
Set to the first, the middle, and the last floating-point intensity values of the created ink signature.
-
If
inputMethod
is set to.finger
, it’s calculated based on the velocity of the drawing. -
If
inputMethod
is set to.applePencil
, it’s calculated based on the Apple Pencil’s azimuth and altitude toward the display. -
If
inputMethod
is set to.thirdPartyStylus
, it’s calculated using the corresponding stylus driver.
-
-
Set to an array of the first, the middle, and the last timestamps during the creation of the ink signature. The timestamps correspond to the values in
pressureList
and were taken at the same point in time. They are saved as boxedTimeInterval
values and set toDate.timeIntervalSince1970
at the time of the drawing. -
-
If
inputMethod
is set to.finger
or.thirdPartyStylus
, the touch radius is set to the average radius of all touches of the created ink signature. -
If
inputMethod
is set to.applePencil
, the altitude angle of the Apple Pencil is used instead.
-
-
Set to the most recently used input method of the created ink signature.
You can provide biometric data using a custom PDFSignatureBiometricProperties
object in the SigningConfiguration
instance. This biometric data is then saved alongside the digital signature:
// Generate the biometric data. let biometricData = PDFSignatureBiometricProperties(pressureList: pressureList, timePointsList: timepoints, touchRadius: radius, inputMethod: .applePencil) let signingConfiguration = SigningConfiguration(dataSigner: privateKey, certificates: certificates, biometricData: biometricData)
Collecting biometric data
You can access biometric properties from a SignatureFormElement
object after the signing process is complete by using SignatureFormElement.signatureBiometricProperties(_:)
, like so:
let signedSignatureFormElement: SignatureFormElement = ... var privateKey: PrivateKey = ... let pkcs12: PKCS12 = ... let (privateKey, _) = try await pkcs12.unlockCertificateChain(withPassword: password) let biometricProperties = signedSignatureFormElement.signatureBiometricProperties(privateKey)
PSPDFSignatureFormElement *signedSignatureFormElement = ... PSPDFPrivateKey *privateKey = ... PSPDFPKCS12 *pkcs12 = ... [pkcs12 unlockWithPassword:password done:^(PSPDFX509 *x509, PSPDFPrivateKey *pkey, NSError *err) { privateKey = pkey; }]; PSPDFSignatureBiometricProperties *biometricProperties = [signedSignatureFormElement signatureBiometricProperties:privateKey];