I'm looking for this, and i find in the IAIK API the following, that is part of PKCS7 standard:

1. Use the |EncryptedData(byte[] data)|
<http://sta31.cs.may.ie:8001/CSS/CSSdocs/assignments/Day1/IAIK_stuff/IAIK-JCE3.13eval/docs/iaik/pkcs/pkcs7/EncryptedData.html#EncryptedData%28byte%5B%5D%29>
   constructor for creating a new |EncryptedData| object and
   supplying the data to be encrypted from a byte array:

        //the data to be encrypted supplied from a byte array:
        byte[] data = ...;
        EncryptedData encrypted_data = new EncryptedData(data);
        2. Setup the cipher for encryption by calling method
   |setupCipher(AlgorithmID contentEA, char[] password)|
<http://sta31.cs.may.ie:8001/CSS/CSSdocs/assignments/Day1/IAIK_stuff/IAIK-JCE3.13eval/docs/iaik/pkcs/pkcs7/EncryptedData.html#setupCipher%28iaik.asn1.structures.AlgorithmID,%20char%5B%5D,%20int%29>
   thereby specifying the PBE-algorithm to be used and the password,
   e.g.:

AlgorithmID pbeAlgorithm = AlgorithmID.pbeWithSHAAnd3_KeyTripleDES_CBC;
        char[] password = ...;
        encrypted_data.setupCipher(pbeAlgorithm, password);
3. Prepare the EncryptedData object for transmission by transforming
   it into an ASN1Object or immediately DER encoding it. The former
   is done by calling the |toASN1Object|
<http://sta31.cs.may.ie:8001/CSS/CSSdocs/assignments/Day1/IAIK_stuff/IAIK-JCE3.13eval/docs/iaik/pkcs/pkcs7/EncryptedDataStream.html#toASN1Object%28%29>
   method, the latter by using the |getEncoded|
<http://sta31.cs.may.ie:8001/CSS/CSSdocs/assignments/Day1/IAIK_stuff/IAIK-JCE3.13eval/docs/iaik/pkcs/pkcs7/EncryptedData.html#getEncoded%28%29>
   method:

ASN1Object obj = encrypted_data.toASN1Object();



This mean that you can do a PKCS7 object with certificates, i think it.

Somebody knows what is the c functions that can do the same??

I need encrypt a buffer of bytes with a password and i have to generate a PCKS format.

Thank!

--
*******************************************************************
LIDIA FERNANDEZ CARPES
Departamento de Ingenieria de la Informacion y las Comunicaciones
Facultad de Informatica
Universidad de Murcia. Campus de Espinardo
30080 Murcia (SPAIN)
Tel.: +34 968 364644
Fax:  +34 968 364151
email: [EMAIL PROTECTED]
*******************************************************************

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to