Discuss this help topic in SecureBlackbox Forum

Set and read attributes of signed messages

TElMessageSigner contains two sets of message attributes: authenticated (i.e., signed) and unauthenticated (i.e., unsigned).

Signed attributes are stored in AuthenticatedAttributes property. They may contain various data which will be signed by signer's certificates. These attributes are commonly used in S/MIME protocol. In this case, they contain the message digest for the mail message.

Unsigned attributes are stored in UnauthenticatedAttributes property. They may contain any auxiliary information about the signer or the data.

Both sets of attributes are represented as instances of TElPKCS7Attributes class. An instance of this class allows to store a list of buffers containing attribute values.

All attributes contained in AuthenticatedAttributes and UnauthenticatedAttributes are ASN.1 sequences. This means that to set the value for the attribute you need to take the actual value and convert it to a valid ASN.1 structure. This is done with FormatAttributeValue function.

Read the attributes using Attributes property of TElMessageVerifier class. This property references an instance of TElPKCS7Attributes class. Validity of the signed attributes is verified by TElMessageVerifier automatically during verification of the message itself.

When reading attributes, use UnformatAttributeValue function to extract the attribute value from an ASN.1 structure.

How To articles about PKCS7 signing and encryption

Discuss this help topic in SecureBlackbox Forum