         
         return sig
     }
-    
-    // TODO jaanus: not sure if this is extra mad or clever...
-    // Do it using proper way in future |-(
+
+    // Inspired by https://github.com/ooper-shlab/CryptoCompatibility-Swift
     private func signature(of string: String) -> String {
+        if #available(OSX 10.12, *) {
+            return createSignature(of: string)
+        } else {
+            // Fallback on earlier versions
+        }
+
         let fileName = "signed.txt"
         do {
             try FileManager.default.removeItem(atPath: fileName)

        return last.dataFromHexadecimalString()!.base64EncodedString()
    }
    
    private func hash(of body: Data) -> String {
        let sha256Data = sha256(data: body)
        return sha256Data.base64EncodedString()

    
    private let apiKeyID: String
    private let pathToPEM: String
    private lazy var privateKey: SecKey = {
        var importedItems: CFArray?

        let pemData = try! Data(contentsOf: URL(fileURLWithPath: self.pathToPEM))
        let err = SecItemImport(
            pemData as CFData,
            "pem" as CFString,
            nil,
            nil,
            [],
            nil,
            nil,
            &importedItems
        )
        assert(err == errSecSuccess)
        
        let importedKeys = importedItems as! [SecKeychainItem]
        assert(importedKeys.count == 1)
        return (importedKeys[0] as AnyObject as! SecKey)
    }()
    
    public init(apiKeyID: String, pathToPEM: String) {
        self.apiKeyID = apiKeyID
