Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
virtual P6R::P6ERR P6R::p6ISign::signDSARaw ( P6CRYPTODATASOURCE pInData,
P6UCHAR pR,
P6UINT32 pRLength,
P6UCHAR pS,
P6UINT32 pSLength 
)
pure virtual

Sign the data, using SH_SHA1, pointed to by pInData given the key and the key type set in setKey.

setKey() must be called at least once before this function is called. This method is defined to work with only a DSA cipher and a call to the setKey() method must be called before this function. Note that the sign() and verify() methods defined above can also be used for DSA signatures. However, this method provides the DSA signature result back in its 'raw' form as 2 160-bit integers.

A data source can be a buffer or a file. A data source can be text or binary data. The resulting signature is represented in DSA raw form of two 160-bit integers r and s returned in network byte order.

Parameters
pInData[ in ] Generate a signature for this input data.
pR[ out ] Binary value, 160-bit integer half of the DSA signature. If this paramter is set to NULL, then the required buffer sizes are placed in both pRLength and pSLength.
pRLength[INOUT] On input this parameter contains the size in bytes of the buffer pointed to by pR. On output this parameter contains the number of bytes that where written into pR. If eTooSmall error is returned then this parameter returnes the required size of the buffer pointed by pR.
pS[ out ] Binary value, 160-bit integer half of the DSA signature. If this paramter is set to NULL, then the required buffer sizes are placed in both pRLength and pSLength.
pSLength[INOUT] On input this parameter contains the size in bytes of the buffer pointed to by pS. On output this parameter contains the number of bytes that where written into pS. If eTooSmall error is returned then this parameter returnes the required size of the buffer pointed by pS.
Returns
SuccessP6R::eOk 
FailureeNotInitializedA successful call to initialize was not made before this call.
eFormatErrorA DSA private key has not been loaded via loadDSAKeyPair.
eInvalidArgOne of the parameters is NULL.
eNotFoundFile data source does not exist.
eIoErrorWrite to file data sink failed.
eTooSmallThe buffer data sink is too small to contain the generated value.
eTooBigInternal error
eMissingKeysetKey must be called before this function.
eWrongKeyClassPrivate or symetric keys only can sign data.
eFailAndExceptionThe signature calculation failed. Exception record provides detailed error info.