apple / swift-certificates

An implementation of X.509 for Swift
https://swiftpackageindex.com/apple/swift-certificates/main/documentation/x509
Apache License 2.0
237 stars 61 forks source link

API Request: Encryption & Decryption for CMS #161

Open ylorn opened 9 months ago

ylorn commented 9 months ago

Hi, thanks for making handling certificates easy in Swift with this package!

I am just wondering if it is reasonable to extend the capability of CMS to enable the encryption and decryption capabilities to achieve the similar functionalities to their counterparts in OpenSSL:

CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in,
                             const EVP_CIPHER *cipher, unsigned int flags);

int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert,
                BIO *dcont, BIO *out, unsigned int flags);

Thanks again.

Lukasa commented 9 months ago

Hi @ylorn! Yes, I'd welcome a PR to add these capabilities. However, I don't think we have the bandwidth to tackle this ourselves at the moment, so we will need a contributor to step up.