Discuss this help topic in SecureBlackbox Forum

TElAuthenticodeSigner.AddSignature

TElAuthenticodeSigner     See also     


Filter: C#/Java  VB.NET  Pascal  C++  PHP  


Signs file digest.

Declaration

[C#/Java]
    int AddSignature(string Description, string URL, TSBAuthenticodeDigestAlgorithm Algorithm, TElX509Certificate Signer, bool AddSigner, bool AddTimestamp /* = false */);

[VB.NET]
    Function AddSignature(ByVal Description As String, ByVal URL As String, ByVal Algorithm As TSBAuthenticodeDigestAlgorithm, ByVal Signer As TElX509Certificate, ByVal AddSigner As Boolean, ByVal AddTimestamp As Boolean = False) As Integer

[Pascal]
    function AddSignature(Description : WideString; URL : string; Algorithm : TSBAuthenticodeDigestAlgorithm; Signer : TElX509Certificate; AddSigner : boolean; AddTimestamp : boolean = false) : integer;

[C++]
    int32_t AddSignature(const sb_u16string &Description, const std::string &URL, TSBAuthenticodeDigestAlgorithm Algorithm, TElX509Certificate &Signer, bool AddSigner, bool AddTimestamp, bool TrustedTimestamp);
    int32_t AddSignature(const sb_u16string &Description, const std::string &URL, TSBAuthenticodeDigestAlgorithm Algorithm, TElX509Certificate *Signer, bool AddSigner, bool AddTimestamp, bool TrustedTimestamp);
    int32_t AddSignature(const std::wstring &Description, const std::string &URL, TSBAuthenticodeDigestAlgorithm Algorithm, TElX509Certificate &Signer, bool AddSigner, bool AddTimestamp, bool TrustedTimestamp);
    int32_t AddSignature(const std::wstring &Description, const std::string &URL, TSBAuthenticodeDigestAlgorithm Algorithm, TElX509Certificate *Signer, bool AddSigner, bool AddTimestamp, bool TrustedTimestamp);

[PHP]
    integer AddSignature(string $Description, string $URL, integer $Algorithm, TElX509Certificate $Signer, bool $AddSigner, bool $AddTimestamp, bool $TrustedTimestamp)

Parameters

  • Description - string that describes signature (optional)
  • URL - optional parameter, allows to add URL.
  • Algorithm - algorithm to calculate digest from digest.
  • Signer - certificate used for file signing. Must contain private key.
  • AddSigner - if True signer's certificate (public key) will be added to the file.
  • AddTimestamp - specifies if current date/time should be added to the signature.
  • TrustedTimestamp - specifies if TSP timestamp will be used. See description for details.

Digest Algorithms:


Return value

    Error code

Description

    This method signs digest calculated by AddAuthenticode method with the certificate passed via Signer parameter.
    One file can be signed many times and all signatures are independent and don't affect each other.

When TrustedTimestamp parameter is true, the component expects that the OnTimestampNeeded will create a TSP (RFC 3161) signature, and places the timestamp accordingly. If TrustedTimestamp is false, old-style Authenticode timestamp is expected to be created and placed to signed attributes of the signature.

See also:     OnTimestampNeeded event     AddAuthenticode method     AddCertificate method     Clear method    

Discuss this help topic in SecureBlackbox Forum