Discuss this help topic in SecureBlackbox Forum

TElMessageSigner.Sign

TElMessageSigner     See also     


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


Signs the block of data.

Declaration

[C#]
    int Sign(byte[] InBuffer, ref byte[] OutBuffer, ref int OutSize, bool Detached);
    int Sign(byte[] InBuffer, int InStartIndex, int InSize, byte[] OutBuffer, int OutStartIndex, ref int OutSize, bool Detached);
    int Sign(System.IO.Stream InStream, System.IO.Stream OutStream, bool Detached, long InCount);

[VB.NET]
    Function Sign(ByVal InBuffer As Byte(), ByRef OutBuffer As Byte(), ByRef OutSize As Integer, ByVal Detached As Boolean) As Integer
    Function Sign(ByVal InBuffer As Byte(), ByVal InStartIndex As Integer, ByVal InSize As Integer, ByVal OutBuffer As Byte(), ByVal OutStartIndex As Integer, ByRef OutSize As Integer, ByVal Detached As Boolean) As Integer
    Function Sign(ByVal InStream As System.IO.Stream, ByVal OutStream As System.IO.Stream, ByVal Detached As Boolean, ByVal InCount As Long) As Integer

[Pascal]
    function Sign(InBuffer : pointer; InSize : integer; OutBuffer : pointer; var OutSize : integer; Detached : boolean = false) : integer;
    function Sign(InStream, OutStream : TStream; Detached : boolean = false; InCount : Int64 = 0) : integer;

[C++]
    int32_t Sign(void * InBuffer, int32_t InSize, void * OutBuffer, int32_t &OutSize, bool Detached);
    int32_t Sign(TStream &InStream, TStream &OutStream, bool Detached, int64_t InCount);
    int32_t Sign(TStream *InStream, TStream *OutStream, bool Detached, int64_t InCount);

[PHP]
    integer Sign(TSBPointer|array of byte|string|NULL $InBuffer, integer $InSize, TSBPointer|array of byte|string|NULL $OutBuffer, integer &$OutSize, bool $Detached)
    integer Sign(TStream $InStream, TStream $OutStream, bool $Detached, integer $InCount)

[Java]
    int sign(byte[] InBuffer, int InStartIndex, int InSize, byte[] OutBuffer, int OutStartIndex, TSBInteger OutSize, boolean Detached);
    int sign(TElStream InStream, TElStream OutStream, boolean Detached, long InCount);
    int sign(byte[] InBuffer, byte[] OutBuffer, TSBInteger OutSize, boolean Detached);

Parameters

  • InBuffer - Pointer to the data to be signed
  • InStartIndex - Starting index of the data to be signed in the InBuffer.
  • InSize - Size of input data in bytes
  • OutBuffer - Pointer to the buffer where signed data should be written
  • OutStartIndex - Starting index of the signed data in the OutBuffer.
  • OutSize - Size of OutBuffer in bytes
  • Detached - Specifies whether the detached signature should be created instead of «normal» one
  • InStream - Stream to be signed.
  • OutStream - Resulting signed stream.
  • InCount - Number of bytes to be read from InStream. If this parameter is 0 the data is read till the end of the stream.
    Default value is 0.

Return value

    0 if the signing process was completed successfully, and an error code otherwise.

Possible values:

Description

    Use this method to sign blocks of data. Block of data is signed using each certificate from CertStorage, which has the corresponding private key. When Detached parameter is false, the signature is merged with data and the resulting block is returned. If Detached is true, only the signature is returned. Unless IncludeCertificates property is set to false, all certificates from storage are included into the signature. If IncludeCertificates is false, then the signature contains only certificate IDs.

     Note,  that some certificates from storage may not have the corresponding private keys. These certificates are included in signed message too. This is done to create certificate chains and make validation of signing certificate easier.

See also:     CertStorage     HashAlgorithm     IncludeCertificates     Countersign     ErrorInfo    

Discuss this help topic in SecureBlackbox Forum