]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/security/CertError.h
ac096fa0cc8baa185a400d654f1134c445b948de
2 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef SQUID_SRC_SECURITY_CERTERROR_H
10 #define SQUID_SRC_SECURITY_CERTERROR_H
12 #include "security/forward.h"
17 /// An X.509 certificate-related error.
18 /// Pairs an error code with the certificate experiencing the error.
22 CertError(int anErr
, const Security::CertPointer
&aCert
, int aDepth
= -1) :
23 code(anErr
), cert(aCert
), depth(aDepth
)
26 bool operator == (const CertError
&ce
) const {
27 // We expect to be used in contexts where identical certificates have
28 // identical pointers.
29 return code
== ce
.code
&& depth
== ce
.depth
&& cert
== ce
.cert
;
32 bool operator != (const CertError
&ce
) const {
33 return !(*this == ce
);
37 Security::ErrorCode code
; ///< certificate error code
38 Security::CertPointer cert
; ///< certificate with the above error code
41 * Absolute cert position in the final certificate chain that may include
42 * intermediate certificates. Chain positions start with zero and increase
43 * towards the root certificate. Negative if unknown.
48 } // namespace Security
50 #endif /* SQUID_SRC_SECURITY_CERTERROR_H */