00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef DCUSERID_H
00031 #define DCUSERID_H
00032
00033 #include "dcmtk/config/osconfig.h"
00034 #include "dcmtk/ofstd/ofcond.h"
00035
00037 #define DUL_TYPENEGOTIATIONOFUSERIDENTITY (unsigned char)0x58
00038
00040 enum T_ASC_UserIdentityNegotiationMode
00041 {
00042 ASC_USER_IDENTITY_NONE = 0,
00043 ASC_USER_IDENTITY_USER = 1,
00044 ASC_USER_IDENTITY_USER_PASSWORD = 2,
00045 ASC_USER_IDENTITY_KERBEROS = 3,
00046 ASC_USER_IDENTITY_SAML = 4,
00047 ASC_USER_IDENTITY_UNKNOWN
00048 };
00049
00050
00053 class UserIdentityNegotiationSubItem {
00054
00055 public:
00056
00059 UserIdentityNegotiationSubItem();
00060
00065 virtual unsigned char pduType() const =0;
00066
00070 virtual unsigned char getItemType() const {return m_itemType;}
00071
00076 virtual unsigned char getReserved() const {return m_reserved;}
00077
00082 virtual OFCondition streamedLength(unsigned long& length) const = 0;
00083
00092 virtual OFCondition parseFromBuffer(unsigned char *readBuffer,
00093 unsigned long& bytesRead,
00094 unsigned long availData) =0;
00095
00101 virtual OFCondition stream(unsigned char *targetBuffer,
00102 unsigned long& lengthWritten) const =0;
00103
00107 virtual void clear() =0;
00108
00113 virtual void dump(STD_NAMESPACE ostream& outstream) const =0;
00114
00117 virtual ~UserIdentityNegotiationSubItem() {}
00118
00119 private:
00120
00123 const unsigned char m_itemType;
00124
00126 const unsigned char m_reserved;
00127
00128 };
00129
00130
00133 class UserIdentityNegotiationSubItemRQ : public UserIdentityNegotiationSubItem {
00134
00135 public:
00136
00139 UserIdentityNegotiationSubItemRQ();
00140
00144 unsigned char pduType() const;
00145
00149 virtual void clear();
00150
00156 void setIdentityType(const T_ASC_UserIdentityNegotiationMode& mode);
00157
00162 T_ASC_UserIdentityNegotiationMode getIdentityType();
00163
00169 void setPrimField(const char *buffer,
00170 const Uint16& length);
00171
00177 void setSecField(const char *buffer,
00178 const Uint16& length);
00179
00187 Uint16 getPrimField(char*& resultBuf,
00188 Uint16& resultLen) const;
00189
00197 Uint16 getSecField(char*& resultBuf,
00198 Uint16& resultLen) const;
00199
00204 void setReqPosResponse(const OFBool& reqPosRsp);
00205
00206
00210 OFBool isPosResponseRequested()
00211 {
00212 return (m_posRspRequested != 0) ? OFTrue: OFFalse;
00213 }
00214
00221 OFCondition stream(unsigned char *targetBuffer,
00222 unsigned long& lengthWritten) const;
00223
00228 OFCondition streamedLength(unsigned long& length) const;
00229
00238 OFCondition parseFromBuffer(unsigned char *readBuffer,
00239 unsigned long &bytesRead,
00240 unsigned long availData);
00241
00246 void dump(STD_NAMESPACE ostream& outstream) const;
00247
00252 UserIdentityNegotiationSubItemRQ& operator= (const UserIdentityNegotiationSubItemRQ& rhs);
00253
00258 UserIdentityNegotiationSubItemRQ(const UserIdentityNegotiationSubItemRQ& rhs);
00259
00262 ~UserIdentityNegotiationSubItemRQ();
00263
00264 private:
00265
00267 T_ASC_UserIdentityNegotiationMode m_userIdentityType;
00269 unsigned char m_posRspRequested;
00271 char* m_primField;
00273 Uint16 m_primFieldLength;
00275 char* m_secField;
00277 Uint16 m_secFieldLength;
00278 };
00279
00280
00281 class UserIdentityNegotiationSubItemAC : public UserIdentityNegotiationSubItem {
00282
00283 public:
00284
00287 UserIdentityNegotiationSubItemAC();
00288
00292 unsigned char pduType() const;
00293
00297 virtual void clear();
00298
00304 void setServerResponse(const char* rsp,
00305 const Uint16& rspLen);
00306
00314 Uint16 getServerResponse(char*& targetBuffer,
00315 Uint16& resultLen) const;
00316
00321 OFCondition streamedLength(unsigned long& length) const;
00322
00328 OFCondition stream(unsigned char *targetBuffer,
00329 unsigned long& lengthWritten) const;
00330
00339 OFCondition parseFromBuffer(unsigned char *readBuffer,
00340 unsigned long &bytesRead,
00341 unsigned long availData);
00342
00347 void dump(STD_NAMESPACE ostream& outstream) const;
00348
00353 UserIdentityNegotiationSubItemAC& operator= (const UserIdentityNegotiationSubItemAC& rhs);
00354
00359 UserIdentityNegotiationSubItemAC(const UserIdentityNegotiationSubItemAC& rhs);
00360
00363 ~UserIdentityNegotiationSubItemAC();
00364
00365 private:
00366
00368 char* m_serverRsp;
00370 Uint16 m_rspLength;
00371
00372 };
00373
00374 #endif // DCUSERID_H
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401