EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Cryptographic Message Syntax Standar ---PKCS7

Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.
Posted: 05/16/2008 02:07:35
by  xu cong
How is it Certificate Change into Cryptographic Message Syntax Standard(Base64 form )?
Posted: 05/16/2008 02:21:54
by Ken Ivanov (EldoS Corp.)

Sorry, I do not understand your question. If I am guessing it right, the certificate can be saved to alternative formats using various SaveToStreamXXX methods (where XXX is PEM, PFX and SPC).
Posted: 05/16/2008 05:37:40
by  xu cong
I am sorry, have not clearly expressed the question.
I'm using SaveToBufferSPC methods.But return result is binary format.
I want return Base64 format.
Posted: 05/16/2008 09:24:42
by Ken Ivanov (EldoS Corp.)

Please use SBPEM.Encode() method to encode binary PKCS7 to Base64-encoded PKCS7.
Posted: 05/21/2008 02:46:27
by  xu cong
This is my using SaveToBufferSPC methods. But the result does not have Root_CA.cer information.Is my operation method wrong?
            TElX509Certificate TELX509 = new TElX509Certificate();
            TElCustomCertStorage Cert = null;
            byte[] pkcs7;

            FileStream CAstream = File.OpenRead(Server.MapPath("CA/Root_CA.cer"));
            FileStream readStream = File.OpenRead(Server.MapPath("certificate/certificate.cer"));

            TELX509.LoadFromStreamPEM(readStream, "", 0);
            TELX509.SaveToBufferSPC(out pkcs7);
Posted: 05/21/2008 02:57:31
by Ken Ivanov (EldoS Corp.)

Please use TElMemoryCertStorage.SaveToBufferPKCS7() method to save more than one certificate to the same PKCS7 file. I.e., the code should look like the following:

// loading certificates
TElMemoryCertStorage storage = new TElMemoryCertStorage();
TELX509.LoadFromStream­PEM(readStream, "", 0);
// saving storage to buffer
byte[] pkcs7 = null;
int size = 0;
storage.SaveToBufferPKCS7(ref pkcs7, ref size);
pkcs7 = new byte[size];
storage.SaveToBufferPKCS7(ref pkcs7, ref size);
pkcs7 = SBUtils.Unit.CloneBuffer(pkcs7, 0, size);
Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.



Topic viewed 2077 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!