Cryptographic Message Syntax (CMS/PKCS7)

The CMS is derived from PKCS #7 version 1.5, which is documented in RFC 2315 [PKCS#7]. PKCS #7 version 1.5 was developed outside of the IETF. Since that time, the IETF has taken responsibility for the development and maintenance of the CMS. Today, several important IETF standards-track protocols make use of the CMS.

Aloaha can create directly CMS messages. The only condition is that a supported smartcard is being used. In case software certificates are being used please use the old Aloaha p7m/ps7 functions explained here.

The function can be found in Aloaha Object "aloahacsp.PKCS7". To be able to use the functions of this object please make sure that you referenced it correctly. Obviously "late binding" can be used as well.


MakePKCS7fromData(InputData, Data_is_Hex,Data_is_Hash,  HashType, detached, FingerPrint)


This Variable contains either the path to the file to be signed, the data to be signed or a Hash.

Is of type bool and defines if the Data in Inputdata is a string or HEXString.

Is of type bool and defines if the Data in Inputdata is already the Hash.

Defines the Hashtype to be used. 3 for SHA1 and 5 for SHA256

If true a detached signature is being created.

Contains the fingerprint of the certificate to be used. Please note that softare certificates are not supported. The certificate has to be hosted on a supported smartcard. If the fingerprint is only one digit the qualified certificate of cardreader x is being used. 


Dim Result as string
Dim PKCS7 as object

set PKCS7=createobject("aloahacsp.PKCS7")

result = PKCS7.MakePKCS7fromData("C:\test.txt", False, False, 3, False, "19 bc 2d d8 43 2d f7 33 ff 38 17 22 bc d1 83 da 2e 1f ff 2c") 

result = PKCS7.MakePKCS7fromData("C:\test.txt", False, False, 5, False, "0") 

result = PKCS7.MakePKCS7fromData("0011223344556677889900112233445566778899", True, False, 3, False, "0")

set PKCS7=nothing
PDF SDKPDF Form Saver SDKSmart Card APIAloaha CSP APIAPIs and samplesPin Pad Notifier Pluginp7m / p7s CreationCDO to S/MimeCreate S/Mime PKCS7Create / Validate PKCS #7Create CMS (PKCS #7)Show Card CertificatesADPU TesterSmart Card TesterTimestamp PKCS7 SignatureDES EncryptionHash DataXML HelperEnumerate Card ReaderMifareAloaha Web ServicesAloaha Print MonitorAloaha Remote ConfigurationWebDAVLDAP ClientProgramming Office MacrosIIS Event Sinks