Swift API to decrypt local Microsoft Excel and OpenOffice Calc spreadsheet with password
Swift library to decrypt local Microsoft Excel and OpenOffice Calc spreadsheet with password
Decrypt local Microsoft Excel and OpenOffice Calc spreadsheet with password - Swift REST API
API Request:
POST
https://api.aspose.cloud/v3.0/cells/unlock
Decrypting a local spreadsheet with a password is a complex task. Decrypting a local spreadsheet with password transitions is performed by our Swift SDK while maintaining the source spreadsheet's main structural and logical content. Our Swift library is a professional solution to decrypt local spreadsheets with a password online. This Cloud SDK gives Swift developers powerful functionality and perfect API.
Swift code for decrypting local spreadsheets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let expectation1 = self.expectation(description: "checkAuth") | |
AsposeCellsCloudAPI.clientId = "xxx-xxx-xxx-xxx-xxxxx" | |
AsposeCellsCloudAPI.clientSecret = "xxxxxx" | |
AuthAspose.checkAuth() | |
{ | |
(authError) in | |
guard authError == nil else { | |
//XCTFail("error checkAuth") | |
return | |
} | |
expectation1.fulfill() | |
} | |
self.waitForExpectations(timeout: testTimeout, handler: nil) | |
//PostUnlock | |
let expectation = self.expectation(description: "testpostUnlock") | |
var files = Dictionary<String, URL>() | |
files[NEEDUNLOCK] = getURL(NEEDUNLOCK) | |
let password:String = "123456" | |
LiteCellsAPI.postUnlock(files: files, password: password) | |
{ | |
(response, error) in | |
guard error == nil else { | |
XCTFail("error testpostUnlock") | |
return | |
} | |
if let response = response { | |
XCTAssertTrue(response is FilesResult) | |
expectation.fulfill() | |
} | |
} | |
self.waitForExpectations(timeout: testTimeout, handler: nil) | |
How to use Swift API to decrypt
- Create an account at Dashboard to get free API quota & authorization details
- Initialize CellsApi with Client Id, Client Secret, Base URL & API version
- Call postUnlock method to get the resultant stream
System Requirements
- macOS Monterey 12.4
- Swift 4.2