QuasarApp / Qt-Secret

Simple encryption library supporting RSA and AES algorithms.
https://quasarapp.ddns.net:3031/docs/QuasarApp/Qt-Secret/latest/index.html
GNU Lesser General Public License v3.0
243 stars 69 forks source link

Loading keys from file #63

Closed radimkohout closed 4 years ago

radimkohout commented 4 years ago

Hi, is there any way to use keys generated by Qt-Secret, that I have load from files? Thanks Radim Kohout

EndrII commented 4 years ago

hi, take a look a #55.This is request of support OpenSSL keys. But as I understand you want to encrypt and decrypt information with Qt-Secret only. If it is true then you can read/write keys into files with QFile.

EndrII commented 4 years ago

Later I will add save and write methods to Qt-Secret

radimkohout commented 4 years ago

But how to parse loaded keys from files into Qt-Secret(using RSA)?

EndrII commented 4 years ago

okey. I will add a way to get the key type from a byte array. With any luck today will be ready.

see PR #64

EndrII commented 4 years ago

To get a description of the key, use:

    /**
     * @brief getKeyRsaType - return the key RSA type.
     * @param key - public or private RSA key.
     * @return QRSAEncryption::Rsa
     */
    static QRSAEncryption::Rsa getKeyRsaType(const QByteArray& key);

Warning. At the moment, the key structure does not allow a full check. If the byte array will fully match the size of the RSA, then this function can return true. Use this function with extreme caution. In the future, I plan to change the structure of the key. To avoid such errors.

See #65