|
282 | 282 |
|
283 | 283 | let skSignature = try secKeySign(messageToSign.bytes, variant: .rsaSignatureMessagePKCS1v15SHA256, withKey: rsaSecKey) |
284 | 284 |
|
285 | | - XCTAssertEqual(csSignature, skSignature.bytes, "Signatures don't match!") |
| 285 | + XCTAssertEqual(csSignature, skSignature.byteArray, "Signatures don't match!") |
286 | 286 |
|
287 | 287 | // Ensure we can verify each signature using the opposite library |
288 | | - XCTAssertTrue(try rsaCryptoSwift.verify(signature: skSignature.bytes, for: messageToSign.bytes, variant: .message_pkcs1v15_SHA256)) |
| 288 | + XCTAssertTrue(try rsaCryptoSwift.verify(signature: skSignature.byteArray, for: messageToSign.bytes, variant: .message_pkcs1v15_SHA256)) |
289 | 289 | XCTAssertTrue(try self.secKeyVerify(csSignature, forBytes: messageToSign.bytes, usingVariant: .rsaSignatureMessagePKCS1v15SHA256, withKey: rsaSecKey)) |
290 | 290 |
|
291 | 291 | // Encrypt with SecKey |
292 | 292 | let skEncryption = try secKeyEncrypt(messageToSign.bytes, usingVariant: .rsaEncryptionRaw, withKey: rsaSecKey) |
293 | 293 | // Decrypt with CryptoSwift Key |
294 | | - XCTAssertEqual(try rsaCryptoSwift.decrypt(skEncryption.bytes, variant: .raw), messageToSign.bytes, "CryptoSwift Decryption of SecKey Encryption Failed") |
| 294 | + XCTAssertEqual(try rsaCryptoSwift.decrypt(skEncryption.byteArray, variant: .raw), messageToSign.bytes, "CryptoSwift Decryption of SecKey Encryption Failed") |
295 | 295 |
|
296 | 296 | // Encrypt with CryptoSwift |
297 | 297 | let csEncryption = try rsaCryptoSwift.encrypt(messageToSign.bytes, variant: .raw) |
298 | 298 | // Decrypt with SecKey |
299 | | - XCTAssertEqual(try self.secKeyDecrypt(csEncryption, usingVariant: .rsaEncryptionRaw, withKey: rsaSecKey).bytes, messageToSign.bytes, "SecKey Decryption of CryptoSwift Encryption Failed") |
| 299 | + XCTAssertEqual(try self.secKeyDecrypt(csEncryption, usingVariant: .rsaEncryptionRaw, withKey: rsaSecKey).byteArray, messageToSign.bytes, "SecKey Decryption of CryptoSwift Encryption Failed") |
300 | 300 |
|
301 | | - XCTAssertEqual(csEncryption, skEncryption.bytes, "Encrypted Data Does Not Match") |
| 301 | + XCTAssertEqual(csEncryption, skEncryption.byteArray, "Encrypted Data Does Not Match") |
302 | 302 |
|
303 | 303 | // Encrypt with SecKey |
304 | 304 | let skEncryption2 = try secKeyEncrypt(messageToSign.bytes, usingVariant: .rsaEncryptionPKCS1, withKey: rsaSecKey) |
305 | 305 | // Decrypt with CryptoSwift Key |
306 | | - XCTAssertEqual(try rsaCryptoSwift.decrypt(skEncryption2.bytes, variant: .pksc1v15), messageToSign.bytes, "CryptoSwift Decryption of SecKey Encryption Failed") |
| 306 | + XCTAssertEqual(try rsaCryptoSwift.decrypt(skEncryption2.byteArray, variant: .pksc1v15), messageToSign.bytes, "CryptoSwift Decryption of SecKey Encryption Failed") |
307 | 307 |
|
308 | 308 | // Encrypt with CryptoSwift |
309 | 309 | let csEncryption2 = try rsaCryptoSwift.encrypt(messageToSign.bytes, variant: .pksc1v15) |
310 | 310 | // Decrypt with SecKey |
311 | | - XCTAssertEqual(try self.secKeyDecrypt(csEncryption2, usingVariant: .rsaEncryptionPKCS1, withKey: rsaSecKey).bytes, messageToSign.bytes, "SecKey Decryption of CryptoSwift Encryption Failed") |
| 311 | + XCTAssertEqual(try self.secKeyDecrypt(csEncryption2, usingVariant: .rsaEncryptionPKCS1, withKey: rsaSecKey).byteArray, messageToSign.bytes, "SecKey Decryption of CryptoSwift Encryption Failed") |
312 | 312 | } |
313 | 313 | } |
314 | 314 |
|
|
0 commit comments