cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Encryption using a public key with function SSF_KRN_ENVELOPE

Jose_Pablo
Newcomer
0 Kudos
441

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         strleniv_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.

 

 

 

 

 

 

 

 

 

 

 

Accepted Solutions (0)

Answers (0)