Logo Search packages:      
Sourcecode: afflib version File versions  Download package

signtest.cpp

/*
 * signtest.cpp:
 *
 * Digitally sign something.
 * See /usr/src/crypto/openssl/apps/pkcs7.c for information on this.
 */

#include <time.h>
#include <stdio.h>

#include <openssl/pkcs7.h>
#include <openssl/pem.h>


int main(int argc,char **argv)
{
    //BIO *out = BIO_new(BIO_s_file());

    BIO *key_bio  = BIO_new(BIO_s_file());
    const char *keyfile = "my_key.key";
    if(BIO_read_filename(key_bio,keyfile)!=1){ // returns 1 for success
      perror(keyfile);
    }

    PKCS7 *p7 = NULL;
    p7 = PEM_read_bio_PKCS7(key_bio,NULL,NULL,NULL);
    printf("p7=%p\n",p7);
}

Generated by  Doxygen 1.6.0   Back to index