on 2024 Nov 18 11:43 AM
Hi,
We need to encrypt a KEY, like
<KEY>290B0B57A7C7AD3D9DF170511C1C9D209DAB1C7F7675D370</KEY>
For this we need to use a public key using algorithm PKCS v1.2., to get a key of 512 hexadecimal characters.
We are trying the following:
* We have defined a new SSF application.
* We have used transaction STRUST to upload the certificate that contains the public key to be used for the encryption.
* We have configured the SSF parameters for this new application:
HASHALG ==> SHA512
ENCRALG ==> TRIPLE-DES
* We use functions:
==> SSF_GET_PARAMETER(Read certificates included in SSFA)
==> SSFC_GET_CERTIFICATELIS (to get the information of each certificate)
==> SSFC_PARSE_CERTIFICATE
==> SSF_KRN_ENVELOPE (to encrypt), here we complete:
ostr_input_data with the string we want to encrypt:<KEY>290B0B57A7C7AD3D9DF170511C1C9D209DAB1C7F7675D370</KEY>
we are not sure wich value we need to populte field ostr_input_data_l .Based on method EXTERNAL_ENCYPTING of class CL_PCA_SECURITY, we are applying the same logic:
* preparations
lv_length = strlen( iv_card_number ).
* Unicode or Non-unicode systems
lv_length = lv_length * lv_bytes.
So in our case we are getting: ostr_input_data_l = 118
The function SSF_KRN_ENVELOPE returns ostr_enveloped_data, we have try to apply different conversions to this encrypted data but we get 510 characters instead of 512, so we not sure if we are missing something.
Request clarification before answering.
User | Count |
---|---|
41 | |
15 | |
10 | |
9 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.