mirror of
https://github.com/apple/swift-nio-ssl
synced 2026-11-24 04:38:08 +00:00
## Motivation It would be handy to provide an API to create PKCS#12 files from a list of `NIOSSLCertificates` and a `NIOSSLPrivateKey`. This would be particularly useful when dealing with Network.framework/NIOTransportServices/Security.framework, which use `SecIdentity`s for SSL. Two particular use cases are https://github.com/apple/swift-nio-ssl/issues/484#issuecomment-2410375188 and `grpc-swift-nio-transport`, which would use this API for testing the NIOTS transport implementation. ## Modifications This PR adds a static method to `NIOSSLPKCS12Bundle` that creates a PKCS#12 file from the given array of certificates + private key, and returns it as an array of bytes. ## Result PKCS#12 files can be created using NIOSSL.