function Sign(const Data: TBytes; IncludeContent: boolean = False; Encoding: TScCMSEncoding = ceDER): TBytes; overload;
procedure Sign(InStream, OutStream: TStream; IncludeContent: boolean = False; Encoding: TScCMSEncoding = ceDER); overload;
procedure Sign(const InFileName, OutFileName: string; IncludeContent: boolean = False; Encoding: TScCMSEncoding = ceDER); overload;
Description
The Sign method creates a signature of the input data by using the certificate specified in the Certificate property, and encodes the result information into a signed CMS/PKCS #7 message.
This method can return an array of byte values that represents the encoded message or can write this result to the OutStream stream or to the OutFileName file.
Data is an array of byte values that represents the input data to be signed.
InStream is a TStream object that contains the input data to be signed.
InFileName is a name of the file that contains the input data to be signed.
OutStream is a TStream object that will contain the signed CMS/PKCS #7 message.
OutFileName is a name of the file that will contain the signed CMS/PKCS #7 message.
Encoding specifies the output encoded format.
IncludeContent is a boolean value that specifies whether the signed content is included in the CMS/PKCS #7 message. If IncludeContent is True, the signed content is included in the CMS/PKCS #7 message along with the signature information. If the IncludeContent state is False (by default), the message does not contain the signed content, and a client can see the content of the message only if it is sent separately.
The hash algorithm can be specified by the DigestAlgorithm property.
Sign resets all properties of the SignedData object that stores the information about the processed CMS/PKCS #7 message.
See Also