Post

Replies

Boosts

Views

Activity

CryptoKit sign payload and header with private key
I am trying to create a jwt token signed with Elliptic Curve Digital Signature Algorithm (ECDSA) with the P-256 curve and the SHA-256 hash algorithm. The payload and the header are created properly, but I am having problems signing it. The P256.Signing.PrivateKey(rawRepresentation: keyData) always returns nil. Can anyone please help? let privateKey = """ -----BEGIN ENCRYPTED PRIVATE KEY----- code -----END ENCRYPTED PRIVATE KEY----- """ let keyData = Data(base64Encoded: privateKey.toBase64())!     let header = jwtHeader()     let payload = jwtPayload()     let signingInput = "\(header).\(payload)"     let privateKey = try! P256.Signing.PrivateKey(rawRepresentation: keyData)     let sig = try! privateKey.signature(for: Data(signingInput.utf8)).rawRepresentation     return "\(signingInput).\(sig.base64URLEncodedString)" extension String {     func toBase64() -> String {         return Data(self.utf8).base64EncodedString()     } }
3
0
1.9k
Sep ’22
Can't remove build from appstoreconnect
I prepared a build to submit to App Store, then I needed to replace it with a newer one, but I don't see any "-" icon to remove this build, Is this appstoreconnect bug or I'm doing something wrong? There is newer version than 10th uploaded to Update: I could fix it, found in Submit review screen that I can remove the build from there.
Replies
0
Boosts
0
Views
620
Activity
Nov ’23
Storage in WatchKit App
I want to save some settings in my watch kit app, and I know I can't use UserDefault, what other options are there to keep user's selected settings in the watch app?
Replies
1
Boosts
0
Views
493
Activity
Mar ’23
Private key for APNS Certificate
I created a APNS Certificate and downloaded them, but I can't find the private key for that certificates, how can I get it to share with the backend team?
Replies
0
Boosts
0
Views
719
Activity
Oct ’22
CryptoKit sign payload and header with private key
I am trying to create a jwt token signed with Elliptic Curve Digital Signature Algorithm (ECDSA) with the P-256 curve and the SHA-256 hash algorithm. The payload and the header are created properly, but I am having problems signing it. The P256.Signing.PrivateKey(rawRepresentation: keyData) always returns nil. Can anyone please help? let privateKey = """ -----BEGIN ENCRYPTED PRIVATE KEY----- code -----END ENCRYPTED PRIVATE KEY----- """ let keyData = Data(base64Encoded: privateKey.toBase64())!     let header = jwtHeader()     let payload = jwtPayload()     let signingInput = "\(header).\(payload)"     let privateKey = try! P256.Signing.PrivateKey(rawRepresentation: keyData)     let sig = try! privateKey.signature(for: Data(signingInput.utf8)).rawRepresentation     return "\(signingInput).\(sig.base64URLEncodedString)" extension String {     func toBase64() -> String {         return Data(self.utf8).base64EncodedString()     } }
Replies
3
Boosts
0
Views
1.9k
Activity
Sep ’22
After coming from background mode to the foreground mode, the requests get canceled.
The issue occurs more frequently if there are many pending requests, the status code of the cancelation is 103.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
0
Boosts
0
Views
539
Activity
Dec ’21