Post

Replies

Boosts

Views

Activity

Reply to How to create IEEE P1363 signature
Yes, Signature verified and return true  var error1: UnmanagedCFError?         guard let verified : Bool? = SecKeyVerifySignature(publicKey,                       SecKeyAlgorithm.ecdsaSignatureMessageX962SHA256,                       signatureString.data(using: .utf8)! as CFData,                       signedData as CFData,                         &error1) else {           let e = error1!.takeRetainedValue() as Error           print("Verify Error \(e.localizedDescription)")           return signedString         }
Topic: Programming Languages SubTopic: Swift Tags:
May ’21
Reply to How to create IEEE P1363 signature
yes, SecKey is valid. I have generate the KeyPair and then store it to Keychain. Here is my Key retrieval code  let tag = "com.example.keys.mykey".data(using: .utf8)!     let getquery: [String: Any] = [kSecClass as String: kSecClassKey,                     kSecAttrApplicationTag as String: tag,                     kSecAttrKeyType as String: kSecAttrKeyTypeEC,                     kSecReturnRef as String: true]     var item: CFTypeRef?     let status = SecItemCopyMatching(getquery as CFDictionary, &item)     guard status == errSecSuccess else { return nil }     if item == nil {       return nil     }     let key = item as! SecKey I have printed signature, and didn't get any error But my API provider guidelines is signature must be 80 length Signature must be generated in IEEE P1363 format. If you generate signatures in another format, such as the ASN.1 format, you must convert your signatures before sending
Topic: Programming Languages SubTopic: Swift Tags:
May ’21