How to sign a JWT with Apple's CryptoKit

In the Sign in With Apple docs regarding signing a JWT

After creating the JWT, sign it using the Elliptic Curve Digital Signature Algorithm (ECDSA) with the P-256 curve and the SHA-256 hash algorithm. A decoded client_secret JWT token has the following format...

There aren't any steps to sign it. I found some references to P256 in the docs. Does anyone know how to use Apple's CryptoKit to sign a JWT?

How to sign a JWT with Apple's CryptoKit
 
 
Q