mirror of
https://github.com/QuasarApp/easyssl.git
synced 2025-04-29 14:34:33 +00:00
fix documentation
This commit is contained in:
parent
9f1245cbfa
commit
f31b11e03b
@ -1,17 +1,21 @@
|
|||||||
# Contributing in to EeasySSL
|
# Contributing in to EeasySSL
|
||||||
|
|
||||||
This is a wrap library for the Qt developers. So if you think that is a good library, and you use it in your projects - you can add new improvements and create a pull request with new features.
|
This is a wrap library for the Qt developers. So if you think that is a good library, and you use it in your projects - you can add new improvements and create a pull request with new features.
|
||||||
|
|
||||||
## What can you do for this Library ?
|
## What can you do for this Library ?
|
||||||
|
|
||||||
1. You can add a support of new encryption algorithms
|
1. You can add a support of new encryption algorithms
|
||||||
2. You can implement new certificate generator.
|
2. You can implement new certificate generator.
|
||||||
|
|
||||||
## Adding new implementation of crypto algorithms
|
## Adding new implementation of crypto algorithms
|
||||||
|
|
||||||
All Algorithms must be pass simple test. Encrypt, decrypt short and long data arrays. This simple test already implemented, and you just need to add it into main test file.
|
All Algorithms must be pass simple test. Encrypt, decrypt short and long data arrays. This simple test already implemented, and you just need to add it into main test file.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
Adding supporting RSA algorithm to this library.
|
Adding supporting RSA algorithm to this library.
|
||||||
|
|
||||||
1. Create implementation of the iCrypto interface.
|
1. Create implementation of the iCrypto interface.
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
|
|
||||||
#include "icrypto.h"
|
#include "icrypto.h"
|
||||||
@ -32,9 +36,11 @@ Adding supporting RSA algorithm to this library.
|
|||||||
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
Full implementation of the RSA you can see here.
|
|
||||||
|
Full implementation of the RSA you can see [here](https://github.com/QuasarApp/easyssl/blob/main/src/lib/src/public/easyssl/rsassl.h).
|
||||||
|
|
||||||
2. Add your class to the tests Using The Template class "[CryptoTest](https://github.com/QuasarApp/easyssl/blob/main/tests/units/cryptotest.h)". See The [tstMain.cpp](https://github.com/QuasarApp/easyssl/blob/main/tests/tstMain.cpp) file
|
2. Add your class to the tests Using The Template class "[CryptoTest](https://github.com/QuasarApp/easyssl/blob/main/tests/units/cryptotest.h)". See The [tstMain.cpp](https://github.com/QuasarApp/easyssl/blob/main/tests/tstMain.cpp) file
|
||||||
|
|
||||||
``` cpp
|
``` cpp
|
||||||
TestCase(cryptoTestRSA, CryptoTest<EasySSL::RSASSL>)
|
TestCase(cryptoTestRSA, CryptoTest<EasySSL::RSASSL>)
|
||||||
```
|
```
|
||||||
@ -57,9 +63,9 @@ Full implementation of the RSA you can see here.
|
|||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
Full implementation of x509 certificate format you can see here.
|
Full implementation of x509 certificate format you can see [here](https://github.com/QuasarApp/easyssl/blob/main/src/lib/src/public/easyssl/x509.h).
|
||||||
|
|
||||||
2. Add your class to the tests Using The Template class "[CrtTest]()". See The [tstMain.cpp](https://github.com/QuasarApp/easyssl/blob/main/tests/tstMain.cpp) file
|
2. Add your class to the tests Using The Template class "[CrtTest](https://github.com/QuasarApp/easyssl/blob/main/tests/units/crttest.h)". See The [tstMain.cpp](https://github.com/QuasarApp/easyssl/blob/main/tests/tstMain.cpp) file
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
#include "crttest.h"
|
#include "crttest.h"
|
||||||
@ -70,7 +76,8 @@ Full implementation of x509 certificate format you can see here.
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Extra rools
|
## Extra rools
|
||||||
1. All shared tools or useful functions located on the EasySSLUtils class.
|
|
||||||
|
1. All shared tools or useful functions located on the [EasySSLUtils](https://github.com/QuasarApp/easyssl/blob/main/src/lib/src/private/easysslutils.h) class.
|
||||||
2. All implementation must contains goxygen xml comments (documentation)
|
2. All implementation must contains goxygen xml comments (documentation)
|
||||||
|
|
||||||
|
|
||||||
|
42
README.md
42
README.md
@ -37,40 +37,21 @@ This library contains interfaces for the signing and encription data.
|
|||||||
### Encription
|
### Encription
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
#include <easyssl/authecdsa.h>
|
#include "easyssl/rsassl.h"
|
||||||
|
|
||||||
class ECDSA: public EasySSL::AuthECDSA {
|
// create a publick and private keys array.
|
||||||
|
int main() {
|
||||||
|
QByteArray pub, priv;
|
||||||
|
EasySSL::RSASSL crypto;
|
||||||
|
crypto.makeKeys(pub, priv)
|
||||||
|
|
||||||
public:
|
auto siganture = crypto.signMessage(message, priv);
|
||||||
|
crypto.checkSign(message, siganture, pub);
|
||||||
|
|
||||||
// AsyncKeysAuth interface
|
auto encriptedMsg = crypto.encrypt(message, pub);
|
||||||
void setPrivateKey(const QByteArray &newPriv) {
|
auto decryptedMsg = crypto.decrypt(encriptedMsg, priv);
|
||||||
_priv = newPriv;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray getPrivateKey() const {
|
|
||||||
return _priv;
|
|
||||||
};
|
|
||||||
|
|
||||||
private:
|
|
||||||
QByteArray _priv;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
ECDSA edsa;
|
|
||||||
QByteArray pub, priv;
|
|
||||||
QString userID;
|
|
||||||
|
|
||||||
// make public and private keys.
|
|
||||||
edsa.makeKeys(pub, priv);
|
|
||||||
edsa.setPrivateKey(priv);
|
|
||||||
edsa.setPublicKey(pub);
|
|
||||||
|
|
||||||
// prepare an authentication object.
|
|
||||||
edsa.prepare();
|
|
||||||
edsa.setPrivateKey({});
|
|
||||||
|
|
||||||
edsa.auth(1000, &userID)
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -115,4 +96,7 @@ edsa.auth(1000, &userID)
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Do not forget to help us make this library better...
|
||||||
|
See our main documentation about contributing to [EasySsl](https://github.com/QuasarApp/easyssl/blob/main/CONTRIBUTING.md)
|
||||||
|
|
||||||
Full documentation available [here](https://quasarapp.ddns.net:3031/docs/QuasarApp/easyssl/latest/index.html)
|
Full documentation available [here](https://quasarapp.ddns.net:3031/docs/QuasarApp/easyssl/latest/index.html)
|
||||||
|
@ -791,7 +791,8 @@ WARN_LOGFILE =
|
|||||||
# Note: If this tag is empty the current directory is searched.
|
# Note: If this tag is empty the current directory is searched.
|
||||||
|
|
||||||
INPUT = src \
|
INPUT = src \
|
||||||
README.md
|
README.md \
|
||||||
|
CONTRIBUTING.md
|
||||||
|
|
||||||
|
|
||||||
# This tag can be used to specify the character encoding of the source files
|
# This tag can be used to specify the character encoding of the source files
|
||||||
|
Loading…
x
Reference in New Issue
Block a user