diff options
Diffstat (limited to 'src/vm/certificatecache.h')
-rw-r--r-- | src/vm/certificatecache.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/vm/certificatecache.h b/src/vm/certificatecache.h new file mode 100644 index 0000000000..bc6d92ba4c --- /dev/null +++ b/src/vm/certificatecache.h @@ -0,0 +1,40 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. +// + +// + + +#ifndef _CERTIFICATECACHE_H_ +#define _CERTIFICATECACHE_H_ + +#include "corpermp.h" +#include "crst.h" + +#define MAX_CACHED_CERTIFICATES 10 + +enum EnumCertificateAdditionFlags { + Success = 0, + CacheSaturated = 1, + AlreadyExists = 2 +}; + +class CertificateCache { +public: + EnumCertificateAdditionFlags AddEntry (COR_TRUST* pCertificate, DWORD* pIndex); + COR_TRUST* GetEntry (DWORD index); + BOOL Contains (COR_TRUST* pCertificate); + + CertificateCache (); + ~CertificateCache (); + +private: + DWORD m_dwNumEntries; + COR_TRUST* m_Entry [MAX_CACHED_CERTIFICATES]; + CrstStatic m_CertificateCacheCrst; + + DWORD FindEntry (COR_TRUST* pCertificate); +}; + +#endif //_CERTIFICATECACHE_H_ |