Refactoring to eliminate duplicated code
This commit is contained in:
parent
8f5f7f1baa
commit
e6b4006c70
16 changed files with 298 additions and 550 deletions
|
@ -40,6 +40,13 @@
|
|||
|
||||
namespace ZeroTier {
|
||||
|
||||
class Capability;
|
||||
class Revocation;
|
||||
class Tag;
|
||||
class CertificateOfMembership;
|
||||
class CertificateOfOwnership;
|
||||
class RuntimeEnvironment;
|
||||
|
||||
/**
|
||||
* Base class for credentials
|
||||
*/
|
||||
|
@ -58,6 +65,22 @@ public:
|
|||
CREDENTIAL_TYPE_COO = 4, // CertificateOfOwnership
|
||||
CREDENTIAL_TYPE_REVOCATION = 6
|
||||
};
|
||||
|
||||
/**
|
||||
* Result of verify() operations
|
||||
*/
|
||||
enum VerifyResult
|
||||
{
|
||||
VERIFY_OK = 0,
|
||||
VERIFY_BAD_SIGNATURE = 1,
|
||||
VERIFY_NEED_IDENTITY = 2
|
||||
};
|
||||
|
||||
protected:
|
||||
VerifyResult _verify(const RuntimeEnvironment *const RR,void *tPtr,const CertificateOfMembership &credential) const;
|
||||
VerifyResult _verify(const RuntimeEnvironment *const RR,void *tPtr,const Revocation &credential) const;
|
||||
VerifyResult _verify(const RuntimeEnvironment *const RR,void *tPtr,const Tag &credential) const;
|
||||
VerifyResult _verify(const RuntimeEnvironment *const RR,void *tPtr,const CertificateOfOwnership &credential) const;
|
||||
};
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue