/[resiprocate]/main/sip/resiprocate/SecurityAttributes.hxx
ViewVC logotype

Contents of /main/sip/resiprocate/SecurityAttributes.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4633 - (show annotations) (download)
Fri May 13 19:31:17 2005 UTC (14 years, 6 months ago) by greg
File size: 3977 byte(s)
Log the security attributes.

1 #ifndef RESIP_SecurityAttributes_hxx
2 #define RESIP_SecurityAttributes_hxx
3
4 #include <iostream>
5
6 #include "resiprocate/os/Data.hxx"
7
8 namespace resip
9 {
10
11 enum SignatureStatus
12 {
13 SignatureNone, // there is no signature
14 SignatureIsBad,
15 SignatureTrusted, // It is signed with trusted signature
16 SignatureCATrusted, // signature is new and is signed by a root we trust
17 SignatureNotTrusted // signature is new and is not signed by a CA we
18 };
19
20 class SecurityAttributes
21 {
22 public:
23 SecurityAttributes();
24 ~SecurityAttributes();
25
26 typedef enum {From, FailedIdentity, Identity} IdentityStrength;
27
28 SignatureStatus getSignatureStatus() const
29 {
30 return mSigStatus;
31 }
32
33 bool isEncrypted() const
34 {
35 return mIsEncrypted;
36 }
37 void setEncrypted()
38 {
39 mIsEncrypted = true;
40 }
41
42 void setSignatureStatus(SignatureStatus status)
43 {
44 mSigStatus = status;
45 }
46
47 void setIdentity(const Data& identity)
48 {
49 mIdentity = identity;
50 }
51
52 void setIdentityStrength(IdentityStrength strength)
53 {
54 mStrength = strength;
55 }
56
57 void setSigner(const Data& signer)
58 {
59 mSigner = signer;
60 }
61
62 friend std::ostream& operator<<(std::ostream& strm, const SecurityAttributes& sa);
63
64 private:
65 bool mIsEncrypted;
66 SignatureStatus mSigStatus;
67 Data mSigner;
68 Data mIdentity;
69 IdentityStrength mStrength;
70 };
71
72 std::ostream& operator<<(std::ostream& strm, const SecurityAttributes& sa);
73 }
74
75 #endif
76
77 /* ====================================================================
78 * The Vovida Software License, Version 1.0
79 *
80 * Copyright (c) 2000-2005 Vovida Networks, Inc. All rights reserved.
81 *
82 * Redistribution and use in source and binary forms, with or without
83 * modification, are permitted provided that the following conditions
84 * are met:
85 *
86 * 1. Redistributions of source code must retain the above copyright
87 * notice, this list of conditions and the following disclaimer.
88 *
89 * 2. Redistributions in binary form must reproduce the above copyright
90 * notice, this list of conditions and the following disclaimer in
91 * the documentation and/or other materials provided with the
92 * distribution.
93 *
94 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
95 * and "Vovida Open Communication Application Library (VOCAL)" must
96 * not be used to endorse or promote products derived from this
97 * software without prior written permission. For written
98 * permission, please contact vocal@vovida.org.
99 *
100 * 4. Products derived from this software may not be called "VOCAL", nor
101 * may "VOCAL" appear in their name, without prior written
102 * permission of Vovida Networks, Inc.
103 *
104 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
105 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
106 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
107 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
108 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
109 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
110 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
111 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
112 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
113 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
114 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
115 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
116 * DAMAGE.
117 *
118 * ====================================================================
119 *
120 * This software consists of voluntary contributions made by Vovida
121 * Networks, Inc. and many individuals on behalf of Vovida Networks,
122 * Inc. For more information on Vovida Networks, Inc., please see
123 * <http://www.vovida.org/>.
124 *
125 */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27