|
Ring Daemon
|
#include <tlsvalidator.h>

Public Member Functions | |
| CheckResult | activated () |
| If the activation value is in the past. | |
| CheckResult | authorityMatch () |
| Check if the authority match the certificate. | |
| CheckResult | exist () |
| The file has been found. | |
| CheckResult | expectedOwner () |
| The CA and certificate provide conflicting ownership information. | |
| CheckResult | getActivationDate () |
| Get the activation date. | |
| std::shared_ptr< dht::crypto::Certificate > | getCertificate () const |
| CheckResult | getCN () |
| The 'CN' section of a DN (RFC4514) | |
| CheckResult | getExpirationDate () |
| Get the expiration date. | |
| CheckResult | getIssuer () |
| If the certificate is not self signed, return the issuer. | |
| CheckResult | getIssuerCN () |
| If the certificate is not self signed, return the issuer CN. | |
| CheckResult | getIssuerDN () |
| If the certificate is not self signed, return the issuer DN (RFC4514) | |
| CheckResult | getIssuerN () |
| If the certificate is not self signed, return the issuer N. | |
| CheckResult | getIssuerO () |
| If the certificate is not self signed, return the issuer O. | |
| CheckResult | getIssuerUID () |
| If the certificate is not self signed, return the issuer UID. | |
| CheckResult | getMd5Fingerprint () |
| Compute the key fingerprint. | |
| CheckResult | getN () |
| The 'N' section of a DN (RFC4514) | |
| CheckResult | getO () |
| The 'O' section of a DN (RFC4514) | |
| CheckResult | getPublicKeyId () |
| Return an hexadecimal identifier. | |
| CheckResult | getPublicSignature () |
| An hexadecimal representation of the signature. | |
| std::map< std::string, std::string > | getSerializedChecks () |
| Convert all checks results into a string map. | |
| std::map< std::string, std::string > | getSerializedDetails () |
| Get a map with all common certificate details. | |
| CheckResult | getSerialNumber () |
| Return the certificate serial number. | |
| CheckResult | getSha1Fingerprint () |
| Compute the key fingerprint. | |
| CheckResult | getSignatureAlgorithm () |
| Return the algorithm used to sign the Key. | |
| CheckResult | getSubjectKey () |
| The subject public key. | |
| CheckResult | getSubjectKeyAlgorithm () |
| The algorithm used to sign the certificate details (rather than the certificate itself) | |
| CheckResult | getUID () |
| The 'UID' section of a DN (RFC4514) | |
| CheckResult | getVersionNumber () |
| Return the certificate version. | |
| bool | hasCa () const |
| A certificate authority has been provided. | |
| CheckResult | hasPrivateKey () |
| Check if the Validator have access to a private key. | |
| CheckResult | isCA () |
| If the certificate is not self signed, return the issuer. | |
| bool | isValid (bool verbose=false) |
| Check if all boolean check passed return true if there was no FAILED checks. | |
| CheckResult | keyMatch () |
| The provided key can be used along with the certificate. | |
| CheckResult | knownAuthority () |
| When an account require an authority known by the system (like /usr/share/ssl/certs) then the whole chain of trust need be to checked. | |
| CheckResult | notExpired () |
| Check if the certificate is not expired. | |
| CheckResult | notRevoked () |
| Check if the certificate has been revoked. | |
| CheckResult | notSelfSigned () |
| The certificate is not self signed. | |
| CheckResult | outgoingServer () |
| The expected outgoing server domain. | |
| CheckResult | privateKeyDirectoryPermissions () |
| CheckResult | privateKeySelinuxAttributes () |
| SELinux provide additional key protection mechanism. | |
| CheckResult | privateKeyStorageLocation () |
| Certificate should be located in specific path on some operating systems. | |
| CheckResult | privateKeyStoragePermissions () |
| CheckResult | publicKeyDirectoryPermissions () |
| CheckResult | publicKeySelinuxAttributes () |
| SELinux provide additional key protection mechanism. | |
| CheckResult | publicKeyStorageLocation () |
| Certificate should be located in specific path on some operating systems. | |
| CheckResult | publicKeyStoragePermissions () |
| CheckResult | requirePrivateKeyPassword () |
| If the key need decryption. | |
| void | setCaTlsValidator (const TlsValidator &validator) |
| CheckResult | strongSigning () |
| If the algorithm used to sign the certificate is considered weak by modern standard. | |
| TlsValidator (const dhtnet::tls::CertificateStore &certStore, const std::shared_ptr< dht::crypto::Certificate > &) | |
| TlsValidator (const dhtnet::tls::CertificateStore &certStore, const std::string &certificate, const std::string &privatekey="", const std::string &privatekeyPasswd="", const std::string &caList="") | |
| Create a TlsValidator for a given certificate. | |
| TlsValidator (const dhtnet::tls::CertificateStore &certStore, const std::vector< std::vector< uint8_t > > &certificate_chain_raw) | |
| TlsValidator (const dhtnet::tls::CertificateStore &certStore, const std::vector< uint8_t > &certificate_raw) | |
| CheckResult | valid () |
| The certificate is invalid compared to the authority. | |
| CheckResult | validAuthority () |
| The provided authority is invalid. | |
| ~TlsValidator () | |
Definition at line 68 of file tlsvalidator.h.
| using jami::tls::TlsValidator::CheckResult = std::pair<CheckValues, std::string> |
Definition at line 176 of file tlsvalidator.h.
|
strong |
All validation fields.
Definition at line 75 of file tlsvalidator.h.
|
strong |
Informative fields about a certificate.
Definition at line 109 of file tlsvalidator.h.
|
strong |
Definition at line 159 of file tlsvalidator.h.
|
strong |
Categories of possible values for each CertificateCheck.
| Enumerator | |
|---|---|
| BOOLEAN | |
| ISO_DATE | |
| CUSTOM | |
| NUMBER | |
| COUNT__ | |
Definition at line 141 of file tlsvalidator.h.
| jami::tls::TlsValidator::TlsValidator | ( | const dhtnet::tls::CertificateStore & | certStore, |
| const std::string & | certificate, | ||
| const std::string & | privatekey = "", |
||
| const std::string & | privatekeyPasswd = "", |
||
| const std::string & | caList = "" |
||
| ) |
Create a TlsValidator for a given certificate.
| certificate | The certificate path |
| privatekey | An optional private key file path |
| privatekeyPasswd | An optional private key password |
| caList | An optional CA list to use for certificate validation |
Definition at line 236 of file tlsvalidator.cpp.
References jami::emitSignal(), JAMI_WARN, and jami::fileutils::loadFile().

| jami::tls::TlsValidator::TlsValidator | ( | const dhtnet::tls::CertificateStore & | certStore, |
| const std::vector< std::vector< uint8_t > > & | certificate_chain_raw | ||
| ) |
Definition at line 231 of file tlsvalidator.cpp.
| jami::tls::TlsValidator::TlsValidator | ( | const dhtnet::tls::CertificateStore & | certStore, |
| const std::vector< uint8_t > & | certificate_raw | ||
| ) |
Definition at line 280 of file tlsvalidator.cpp.
References jami::emitSignal().

| jami::tls::TlsValidator::TlsValidator | ( | const dhtnet::tls::CertificateStore & | certStore, |
| const std::shared_ptr< dht::crypto::Certificate > & | crt | ||
| ) |
Definition at line 292 of file tlsvalidator.cpp.
References jami::emitSignal().

| jami::tls::TlsValidator::~TlsValidator | ( | ) |
Definition at line 307 of file tlsvalidator.cpp.
| TlsValidator::CheckResult jami::tls::TlsValidator::activated | ( | ) |
If the activation value is in the past.
@fixme Handle both "with ca" and "without ca" case
Definition at line 785 of file tlsvalidator.cpp.
References jami::emitSignal(), exist(), FAILED, PASSED, and UNSUPPORTED.

| TlsValidator::CheckResult jami::tls::TlsValidator::authorityMatch | ( | ) |
Check if the authority match the certificate.
Definition at line 1040 of file tlsvalidator.cpp.
References jami::emitSignal(), FAILED, and PASSED.

| TlsValidator::CheckResult jami::tls::TlsValidator::exist | ( | ) |
The file has been found.
Definition at line 1006 of file tlsvalidator.cpp.
References jami::emitSignal(), FAILED, and PASSED.
Referenced by activated(), getSerializedChecks(), keyMatch(), notExpired(), and strongSigning().

| TlsValidator::CheckResult jami::tls::TlsValidator::expectedOwner | ( | ) |
The CA and certificate provide conflicting ownership information.
Definition at line 995 of file tlsvalidator.cpp.
References jami::emitSignal(), FAILED, and PASSED.

| TlsValidator::CheckResult jami::tls::TlsValidator::getActivationDate | ( | ) |
Get the activation date.
Definition at line 1386 of file tlsvalidator.cpp.
References jami::emitSignal(), jami::tls::formatDate(), and UNSUPPORTED.

|
inline |
Definition at line 259 of file tlsvalidator.h.
Referenced by libjami::getCertificateDetails(), and libjami::validateCertificate().
| TlsValidator::CheckResult jami::tls::TlsValidator::getCN | ( | ) |
The 'CN' section of a DN (RFC4514)
Definition at line 1191 of file tlsvalidator.cpp.
References jami::tls::checkError(), and jami::emitSignal().

| TlsValidator::CheckResult jami::tls::TlsValidator::getExpirationDate | ( | ) |
Get the expiration date.
Definition at line 1370 of file tlsvalidator.cpp.
References jami::emitSignal(), jami::tls::formatDate(), and UNSUPPORTED.

| TlsValidator::CheckResult jami::tls::TlsValidator::getIssuer | ( | ) |
If the certificate is not self signed, return the issuer.
Definition at line 1138 of file tlsvalidator.cpp.
References CUSTOM, jami::emitSignal(), and UNSUPPORTED.

| TlsValidator::CheckResult jami::tls::TlsValidator::getIssuerCN | ( | ) |
If the certificate is not self signed, return the issuer CN.
Definition at line 1314 of file tlsvalidator.cpp.
References jami::tls::checkError(), and jami::emitSignal().

| TlsValidator::CheckResult jami::tls::TlsValidator::getIssuerDN | ( | ) |
If the certificate is not self signed, return the issuer DN (RFC4514)
Definition at line 1303 of file tlsvalidator.cpp.
References jami::tls::checkError(), and jami::emitSignal().

| TlsValidator::CheckResult jami::tls::TlsValidator::getIssuerN | ( | ) |
If the certificate is not self signed, return the issuer N.
Definition at line 1341 of file tlsvalidator.cpp.
References jami::tls::checkError(), and jami::emitSignal().

| TlsValidator::CheckResult jami::tls::TlsValidator::getIssuerO | ( | ) |
If the certificate is not self signed, return the issuer O.
Definition at line 1352 of file tlsvalidator.cpp.
References jami::tls::checkError(), and jami::emitSignal().

| TlsValidator::CheckResult jami::tls::TlsValidator::getIssuerUID | ( | ) |
If the certificate is not self signed, return the issuer UID.
Definition at line 1330 of file tlsvalidator.cpp.
References jami::tls::checkError(), and jami::emitSignal().

| TlsValidator::CheckResult jami::tls::TlsValidator::getMd5Fingerprint | ( | ) |
Compute the key fingerprint.
This need to be used along with getSha1Fingerprint() to avoid collisions
Definition at line 1262 of file tlsvalidator.cpp.
References jami::tls::checkBinaryError(), and jami::emitSignal().

| TlsValidator::CheckResult jami::tls::TlsValidator::getN | ( | ) |
The 'N' section of a DN (RFC4514)
Definition at line 1214 of file tlsvalidator.cpp.
References jami::tls::checkError(), and jami::emitSignal().

| TlsValidator::CheckResult jami::tls::TlsValidator::getO | ( | ) |
The 'O' section of a DN (RFC4514)
Definition at line 1226 of file tlsvalidator.cpp.
References jami::tls::checkError(), and jami::emitSignal().

| TlsValidator::CheckResult jami::tls::TlsValidator::getPublicKeyId | ( | ) |
Return an hexadecimal identifier.
Definition at line 1286 of file tlsvalidator.cpp.
References jami::tls::checkBinaryError(), and jami::emitSignal().

| TlsValidator::CheckResult jami::tls::TlsValidator::getPublicSignature | ( | ) |
An hexadecimal representation of the signature.
Definition at line 1098 of file tlsvalidator.cpp.
References jami::tls::checkBinaryError(), and jami::emitSignal().

| std::map< std::string, std::string > jami::tls::TlsValidator::getSerializedChecks | ( | ) |
Convert all checks results into a string map.
Definition at line 364 of file tlsvalidator.cpp.
References jami::emitSignal(), EXIST, and exist().
Referenced by libjami::validateCertificatePath().

| std::map< std::string, std::string > jami::tls::TlsValidator::getSerializedDetails | ( | ) |
Get a map with all common certificate details.
Definition at line 383 of file tlsvalidator.cpp.
References CUSTOM, jami::emitSignal(), FAILED, ISO_DATE, NUMBER, PASSED, and UNSUPPORTED.
Referenced by libjami::getCertificateDetailsPath().

| TlsValidator::CheckResult jami::tls::TlsValidator::getSerialNumber | ( | ) |
Return the certificate serial number.
Definition at line 1125 of file tlsvalidator.cpp.
References jami::tls::checkBinaryError(), and jami::emitSignal().

| TlsValidator::CheckResult jami::tls::TlsValidator::getSha1Fingerprint | ( | ) |
Compute the key fingerprint.
This need to be used along with getMd5Fingerprint() to avoid collisions
Definition at line 1275 of file tlsvalidator.cpp.
References jami::tls::checkBinaryError(), and jami::emitSignal().

| TlsValidator::CheckResult jami::tls::TlsValidator::getSignatureAlgorithm | ( | ) |
Return the algorithm used to sign the Key.
For example: RSA
Definition at line 1245 of file tlsvalidator.cpp.
References CUSTOM, jami::emitSignal(), and UNSUPPORTED.

| TlsValidator::CheckResult jami::tls::TlsValidator::getSubjectKey | ( | ) |
The subject public key.
Definition at line 1176 of file tlsvalidator.cpp.
References CUSTOM, jami::emitSignal(), and UNSUPPORTED.

| TlsValidator::CheckResult jami::tls::TlsValidator::getSubjectKeyAlgorithm | ( | ) |
The algorithm used to sign the certificate details (rather than the certificate itself)
Definition at line 1153 of file tlsvalidator.cpp.
References CUSTOM, jami::emitSignal(), and UNSUPPORTED.

| TlsValidator::CheckResult jami::tls::TlsValidator::getUID | ( | ) |
The 'UID' section of a DN (RFC4514)
Definition at line 1203 of file tlsvalidator.cpp.
References jami::tls::checkError(), and jami::emitSignal().

| TlsValidator::CheckResult jami::tls::TlsValidator::getVersionNumber | ( | ) |
Return the certificate version.
Definition at line 1109 of file tlsvalidator.cpp.
References jami::emitSignal(), NUMBER, UNSUPPORTED, and jami::swarm_protocol::version.

| bool jami::tls::TlsValidator::hasCa | ( | ) | const |
A certificate authority has been provided.
Definition at line 1082 of file tlsvalidator.cpp.
References jami::emitSignal().

| TlsValidator::CheckResult jami::tls::TlsValidator::hasPrivateKey | ( | ) |
Check if the Validator have access to a private key.
Definition at line 745 of file tlsvalidator.cpp.
References jami::emitSignal(), FAILED, JAMI_DBG, and PASSED.

| TlsValidator::CheckResult jami::tls::TlsValidator::isCA | ( | ) |
If the certificate is not self signed, return the issuer.
Definition at line 1413 of file tlsvalidator.cpp.
References CUSTOM, jami::FALSE_STR, and jami::TRUE_STR.
Check if all boolean check passed return true if there was no FAILED checks.
Checks functions are not "const", so this function isn't
Definition at line 346 of file tlsvalidator.cpp.
References BOOLEAN, jami::emitSignal(), FAILED, and JAMI_WARNING.

| TlsValidator::CheckResult jami::tls::TlsValidator::keyMatch | ( | ) |
The provided key can be used along with the certificate.
Definition at line 827 of file tlsvalidator.cpp.
References jami::emitSignal(), exist(), FAILED, PASSED, and UNSUPPORTED.

| TlsValidator::CheckResult jami::tls::TlsValidator::knownAuthority | ( | ) |
When an account require an authority known by the system (like /usr/share/ssl/certs) then the whole chain of trust need be to checked.
@fixme port crypto_cert_load_trusted @fixme add account settings
Definition at line 1056 of file tlsvalidator.cpp.
References jami::emitSignal(), FAILED, and PASSED.

| TlsValidator::CheckResult jami::tls::TlsValidator::notExpired | ( | ) |
Check if the certificate is not expired.
The double negative is used because all boolean checks need to have a consistent return value semantic
@fixme Handle both "with ca" and "without ca" case
Definition at line 769 of file tlsvalidator.cpp.
References jami::emitSignal(), exist(), FAILED, PASSED, and UNSUPPORTED.

| TlsValidator::CheckResult jami::tls::TlsValidator::notRevoked | ( | ) |
Check if the certificate has been revoked.
Definition at line 1069 of file tlsvalidator.cpp.
References jami::emitSignal(), FAILED, and PASSED.

| TlsValidator::CheckResult jami::tls::TlsValidator::notSelfSigned | ( | ) |
The certificate is not self signed.
Definition at line 818 of file tlsvalidator.cpp.
References UNSUPPORTED.
| TlsValidator::CheckResult jami::tls::TlsValidator::outgoingServer | ( | ) |
The expected outgoing server domain.
Move to "certificateDetails()" method once completed
extract information for the certificate
Definition at line 1403 of file tlsvalidator.cpp.
References CUSTOM.
| TlsValidator::CheckResult jami::tls::TlsValidator::privateKeyDirectoryPermissions | ( | ) |
Definition at line 876 of file tlsvalidator.cpp.
References jami::emitSignal(), FAILED, PASSED, and UNSUPPORTED.

| TlsValidator::CheckResult jami::tls::TlsValidator::privateKeySelinuxAttributes | ( | ) |
SELinux provide additional key protection mechanism.
Definition at line 965 of file tlsvalidator.cpp.
References UNSUPPORTED.
| TlsValidator::CheckResult jami::tls::TlsValidator::privateKeyStorageLocation | ( | ) |
Certificate should be located in specific path on some operating systems.
Definition at line 945 of file tlsvalidator.cpp.
References UNSUPPORTED.
| TlsValidator::CheckResult jami::tls::TlsValidator::privateKeyStoragePermissions | ( | ) |
Definition at line 838 of file tlsvalidator.cpp.
References jami::emitSignal(), FAILED, PASSED, S_IFREG, S_IRGRP, S_IROTH, S_IRUSR, S_IWGRP, S_IWOTH, S_IXGRP, S_IXOTH, S_IXUSR, and UNSUPPORTED.

| TlsValidator::CheckResult jami::tls::TlsValidator::publicKeyDirectoryPermissions | ( | ) |
Definition at line 909 of file tlsvalidator.cpp.
References jami::emitSignal(), FAILED, PASSED, and UNSUPPORTED.

| TlsValidator::CheckResult jami::tls::TlsValidator::publicKeySelinuxAttributes | ( | ) |
SELinux provide additional key protection mechanism.
Definition at line 975 of file tlsvalidator.cpp.
References UNSUPPORTED.
| TlsValidator::CheckResult jami::tls::TlsValidator::publicKeyStorageLocation | ( | ) |
Certificate should be located in specific path on some operating systems.
Definition at line 955 of file tlsvalidator.cpp.
References UNSUPPORTED.
| TlsValidator::CheckResult jami::tls::TlsValidator::publicKeyStoragePermissions | ( | ) |
Definition at line 857 of file tlsvalidator.cpp.
References jami::emitSignal(), FAILED, PASSED, S_IFREG, S_IRUSR, S_IWGRP, S_IWOTH, S_IXGRP, S_IXOTH, S_IXUSR, and UNSUPPORTED.

| TlsValidator::CheckResult jami::tls::TlsValidator::requirePrivateKeyPassword | ( | ) |
If the key need decryption.
Double factor authentication is recommended
Definition at line 987 of file tlsvalidator.cpp.
| void jami::tls::TlsValidator::setCaTlsValidator | ( | const TlsValidator & | validator | ) |
| TlsValidator::CheckResult jami::tls::TlsValidator::strongSigning | ( | ) |
If the algorithm used to sign the certificate is considered weak by modern standard.
Definition at line 801 of file tlsvalidator.cpp.
References jami::emitSignal(), exist(), FAILED, PASSED, and UNSUPPORTED.

| TlsValidator::CheckResult jami::tls::TlsValidator::valid | ( | ) |
The certificate is invalid compared to the authority.
Definition at line 1019 of file tlsvalidator.cpp.
| TlsValidator::CheckResult jami::tls::TlsValidator::validAuthority | ( | ) |
The provided authority is invalid.
Definition at line 1028 of file tlsvalidator.cpp.
References jami::emitSignal(), FAILED, and PASSED.
