This file contains hidden or 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
| import Foundation | |
| package extension AsyncSequence where Element: Sendable, Self: Sendable { | |
| func onSubscribed(perform: @Sendable @escaping () async throws -> Void) -> AsyncThrowingStream<Element, Error> { | |
| .init { continuation in | |
| let task = Task { | |
| do { | |
| // Use a task group to run both operations concurrently | |
| try await withThrowingTaskGroup(of: Void.self) { group in | |
| // Launch the iteration task |
This file contains hidden or 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
| import Foundation | |
| import OpenSSL | |
| static func pkcs12(fromPem pemCertificate: String, | |
| withPrivateKey pemPrivateKey: String, | |
| p12Password: String = "", | |
| certificateAuthorityFileURL: URL? = nil) throws -> NSData { | |
| // Create sec certificates from PEM string | |
| let modifiedCert = pemCertificate | |
| .replacingOccurrences(of: "-----BEGIN CERTIFICATE-----", with: "") |