- {
- BIO *in = NULL, *out = NULL, *tbio = NULL;
- X509 *rcert = NULL;
- EVP_PKEY *rkey = NULL;
- PKCS7 *p7 = NULL;
- int ret = 1;
-
- OpenSSL_add_all_algorithms();
- ERR_load_crypto_strings();
-
- /* Read in recipient certificate and private key */
- tbio = BIO_new_file("signer.pem", "r");
-
- if (!tbio)
- goto err;
-
- rcert = PEM_read_bio_X509(tbio, NULL, 0, NULL);
-
- BIO_reset(tbio);
-
- rkey = PEM_read_bio_PrivateKey(tbio, NULL, 0, NULL);
-
- if (!rcert || !rkey)
- goto err;