<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create(recipients, data, cipher, flags=0):
 """ Creates and encrypts message @param recipients - list of X509 objects @param data - contents of the message @param cipher - CipherType object @param flags - flag """

        recp = StackOfX509(recipients)
        bio = Membio(data)
        cms_ptr = libcrypto.CMS_encrypt(recp.ptr, bio.bio, cipher.cipher,
                                        flags)
        if cms_ptr is None:
            raise CMSError("encrypt EnvelopedData")
        return EnvelopedData(cms_ptr)