Session_RSA_Sign
This API signs message text using RSA private key.
URL
./Session_RSA_Sign
Input Parameters
Parameters | Description |
---|---|
keyname | Name of RSA key pair containing private key. |
messagetext | Message to sign. |
transformation | Transformations to be used. Possible options are: — RSA — SHA1withRSA — SHA256withRSA — SHA384withRSA — SHA512withRSA — SHA1withRSAPSSPadding — SHA256withRSAPSSPadding — SHA384withRSAPSSPadding — SHA512withRSAPSSPadding. For complete list of supported transformations, refer to the Supported Algorithm section of the CADP for Java User Guide. |
saltlength | Optional, length of salt to be used for sign operation. |
format | Signing format to be used. This is an optional parameter. Supported signing CMS formats are: — cms/detached/der/enveloped — cms/detached/der — cms/detached/smime/enveloped — cms/detached/smime. |
messageformat | Message format to be used. This is an optional parameter. Supported message formats are: — HEX — STR (default) |
Note
The saltlength parameter is supported only with the following transformations:
— SHA1withRSAPSSPadding
— SHA256withRSAPSSPadding
— SHA384withRSAPSSPadding
— SHA512withRSAPSSPaddingThe saltlength and format parameters cannot be used simultaneously.
The messagetext must be in the same format as specified in the messageformat parameter.
CMS formats are not supported with the following transformations:
—SHA1withRSAPSSPadding
—SHA256withRSAPSSPadding
— SHA384withRSAPSSPadding
— SHA512withRSAPSSPadding
— RSA
—RSAPSSPaddingSHA1
— RSAPSSPaddingSHA256
— RSAPSSPaddingSHA384
—RSAPSSPaddingSHA512For KeySecure 8.12.5 onward, following transformations are added to sign the data based on pre-calculated hash: RSA, RSAPSSPaddingSHA1, RSAPSSPaddingSHA256, RSAPSSPaddingSHA384, and RSAPSSPaddingSHA512. These transformations support saltlength parameter.
Session_RSA_Sign Sample with saltlength
<prot:Session_RSA_Sign>
<keyname>certpkcs12</keyname>
<messagetext>eqwewewqeqqeqeqwe</messagetext>
<transformation>SHA1withRSAPSSPadding</transformation>
<!--Optional:-->
<saltlength>40</saltlength>
<!--Optional:-->
<messageformat>STR</messageformat>
</prot:Session_RSA_Sign>
Output
Signature in Hex.
<ns2:Session_RSA_SignResponse xmlns:ns2="http://dsws.org/protectappws/">3082087B06092A864886F70D010703A082086C30820868020100318201C0308201BC0201003081A330819B310B3009060355040613025553310B3009060355040813024341311530130603550407130C526564776F6F64204369747931143012060355040A130B536166656E657420496E6331143012060355040B130B456E67696E656572696E67311230100603550403140973616D706C655F63613128302606092A864886F70D010901161973616D706C655F636140736166656E65742D696E632E636F6D020300A6E9300D06092A864886F70D010101050004820100096B5A17F59CA76C8DB69E280F5A6EC599651385C36A35175A2ED5B8018A2C63EF6EE3FE93C614D6848EAD8AC6AF42F68A921199621A7CDCAB9B886385F476DD9F76DD57F9[… sample truncated for brevity … ] E8BD38E8FD7E9057F49F82E5610C32A29A512977F4E191480C639E9333D57F50A042C5D6665423AC42BC12C587C27620D4838045D590309B95318A9395948B38ED1CE76753058E8A17</ns2:Session_RSA_SignResponse>
Session_RSA_Sign Sample with format
<prot:Session_RSA_Sign>
<keyname>certpkcs12</keyname>
<messagetext>eqwewewqeqqeqeqwe</messagetext>
<transformation>SHA1withRSA</transformation>
<!--Optional:-->
<format>cms/detached/der/enveloped</format>
<!--Optional:-->
<messageformat>STR</messageformat>
</prot:Session_RSA_Sign>
Output
Signature in Hex.
<ns2:Session_RSA_SignResponse xmlns:ns2="http://dsws.org/protectappws/">3082087B06092A864886F70D010703A082086C30820868020100318201C0308201BC0201003081A874519B310B3009060355040613025553310B3009060355040813024341311530130603550407130C526564776F6F64204369747931143012060355040A130B536166656E657420496E6331143012060355040B130B456E67696E656572696E67311230100603550403140973616D706C655F63613128302606092A864886F70D010901161973616D706C655F636140736166656E65742D696E632E636F6D020300A6E9300D06092A864886F70D010101050004820100096B5A17F59CA76C8DB69E280F5A6EC599651385C36A35175A2ED5B8018A2C63EF6EE3FE93C614D6848EAD8AC6AF42F68A921199621A7CDCAB9B886385F476DD9F76DD57F9[… sample truncated for brevity … ] E8BD38E8FD7E9057F49F82E5610C32A29A512977F4E191480C639E9333D57F50A042C5D6665423AC42BC12C587C27620D4838045D590309B95318A9395948B38ED1CE76753058E8A17</ns2:Session_RSA_SignResponse>