00001
00002
00003
00004
00005
00006
00007 #ifdef P_USE_PRAGMA
00008 #pragma implementation "h235.h"
00009 #endif
00010
00011 #include <ptlib.h>
00012 #include "h235.h"
00013
00014 #define new PNEW
00015
00016
00017 #if ! H323_DISABLE_H235
00018
00019 #include "h235_t.cxx"
00020
00021
00022
00023
00024
00025 H235_ChallengeString::H235_ChallengeString(unsigned tag, PASN_Object::TagClass tagClass)
00026 : PASN_OctetString(tag, tagClass)
00027 {
00028 SetConstraints(PASN_Object::FixedConstraint, 8, 128);
00029 }
00030
00031
00032 H235_ChallengeString::H235_ChallengeString(const char * v)
00033 {
00034 SetValue(v);
00035 }
00036
00037
00038 H235_ChallengeString::H235_ChallengeString(const PString & v)
00039 {
00040 SetValue(v);
00041 }
00042
00043
00044 H235_ChallengeString::H235_ChallengeString(const PBYTEArray & v)
00045 {
00046 SetValue(v);
00047 }
00048
00049
00050 H235_ChallengeString & H235_ChallengeString::operator=(const char * v)
00051 {
00052 SetValue(v);
00053 return *this;
00054 }
00055
00056
00057 H235_ChallengeString & H235_ChallengeString::operator=(const PString & v)
00058 {
00059 SetValue(v);
00060 return *this;
00061 }
00062
00063
00064 H235_ChallengeString & H235_ChallengeString::operator=(const PBYTEArray & v)
00065 {
00066 SetValue(v);
00067 return *this;
00068 }
00069
00070
00071 PObject * H235_ChallengeString::Clone() const
00072 {
00073 #ifndef PASN_LEANANDMEAN
00074 PAssert(IsClass(H235_ChallengeString::Class()), PInvalidCast);
00075 #endif
00076 return new H235_ChallengeString(*this);
00077 }
00078
00079
00080
00081
00082
00083
00084 H235_TimeStamp::H235_TimeStamp(unsigned tag, PASN_Object::TagClass tagClass)
00085 : PASN_Integer(tag, tagClass)
00086 {
00087 SetConstraints(PASN_Object::FixedConstraint, 1, 4294967295U);
00088 }
00089
00090
00091 H235_TimeStamp & H235_TimeStamp::operator=(int v)
00092 {
00093 SetValue(v);
00094 return *this;
00095 }
00096
00097
00098 H235_TimeStamp & H235_TimeStamp::operator=(unsigned v)
00099 {
00100 SetValue(v);
00101 return *this;
00102 }
00103
00104
00105 PObject * H235_TimeStamp::Clone() const
00106 {
00107 #ifndef PASN_LEANANDMEAN
00108 PAssert(IsClass(H235_TimeStamp::Class()), PInvalidCast);
00109 #endif
00110 return new H235_TimeStamp(*this);
00111 }
00112
00113
00114
00115
00116
00117
00118 H235_RandomVal::H235_RandomVal(unsigned tag, PASN_Object::TagClass tagClass)
00119 : PASN_Integer(tag, tagClass)
00120 {
00121 }
00122
00123
00124 H235_RandomVal & H235_RandomVal::operator=(int v)
00125 {
00126 SetValue(v);
00127 return *this;
00128 }
00129
00130
00131 H235_RandomVal & H235_RandomVal::operator=(unsigned v)
00132 {
00133 SetValue(v);
00134 return *this;
00135 }
00136
00137
00138 PObject * H235_RandomVal::Clone() const
00139 {
00140 #ifndef PASN_LEANANDMEAN
00141 PAssert(IsClass(H235_RandomVal::Class()), PInvalidCast);
00142 #endif
00143 return new H235_RandomVal(*this);
00144 }
00145
00146
00147
00148
00149
00150
00151 H235_Password::H235_Password(unsigned tag, PASN_Object::TagClass tagClass)
00152 : PASN_BMPString(tag, tagClass)
00153 {
00154 SetConstraints(PASN_Object::FixedConstraint, 1, 128);
00155 }
00156
00157
00158 H235_Password & H235_Password::operator=(const char * v)
00159 {
00160 SetValue(v);
00161 return *this;
00162 }
00163
00164
00165 H235_Password & H235_Password::operator=(const PString & v)
00166 {
00167 SetValue(v);
00168 return *this;
00169 }
00170
00171
00172 H235_Password & H235_Password::operator=(const PWORDArray & v)
00173 {
00174 SetValue(v);
00175 return *this;
00176 }
00177
00178
00179 H235_Password & H235_Password::operator=(const PASN_BMPString & v)
00180 {
00181 SetValue(v);
00182 return *this;
00183 }
00184
00185
00186 PObject * H235_Password::Clone() const
00187 {
00188 #ifndef PASN_LEANANDMEAN
00189 PAssert(IsClass(H235_Password::Class()), PInvalidCast);
00190 #endif
00191 return new H235_Password(*this);
00192 }
00193
00194
00195
00196
00197
00198
00199 H235_Identifier::H235_Identifier(unsigned tag, PASN_Object::TagClass tagClass)
00200 : PASN_BMPString(tag, tagClass)
00201 {
00202 SetConstraints(PASN_Object::FixedConstraint, 1, 128);
00203 }
00204
00205
00206 H235_Identifier & H235_Identifier::operator=(const char * v)
00207 {
00208 SetValue(v);
00209 return *this;
00210 }
00211
00212
00213 H235_Identifier & H235_Identifier::operator=(const PString & v)
00214 {
00215 SetValue(v);
00216 return *this;
00217 }
00218
00219
00220 H235_Identifier & H235_Identifier::operator=(const PWORDArray & v)
00221 {
00222 SetValue(v);
00223 return *this;
00224 }
00225
00226
00227 H235_Identifier & H235_Identifier::operator=(const PASN_BMPString & v)
00228 {
00229 SetValue(v);
00230 return *this;
00231 }
00232
00233
00234 PObject * H235_Identifier::Clone() const
00235 {
00236 #ifndef PASN_LEANANDMEAN
00237 PAssert(IsClass(H235_Identifier::Class()), PInvalidCast);
00238 #endif
00239 return new H235_Identifier(*this);
00240 }
00241
00242
00243
00244
00245
00246
00247 H235_KeyMaterial::H235_KeyMaterial(unsigned tag, PASN_Object::TagClass tagClass)
00248 : PASN_BitString(tag, tagClass)
00249 {
00250 SetConstraints(PASN_Object::FixedConstraint, 1, 2048);
00251 }
00252
00253
00254 PObject * H235_KeyMaterial::Clone() const
00255 {
00256 #ifndef PASN_LEANANDMEAN
00257 PAssert(IsClass(H235_KeyMaterial::Class()), PInvalidCast);
00258 #endif
00259 return new H235_KeyMaterial(*this);
00260 }
00261
00262
00263
00264
00265
00266
00267 H235_NonStandardParameter::H235_NonStandardParameter(unsigned tag, PASN_Object::TagClass tagClass)
00268 : PASN_Sequence(tag, tagClass, 0, FALSE, 0)
00269 {
00270 }
00271
00272
00273 #ifndef PASN_NOPRINTON
00274 void H235_NonStandardParameter::PrintOn(ostream & strm) const
00275 {
00276 int indent = strm.precision() + 2;
00277 strm << "{\n";
00278 strm << setw(indent+24) << "nonStandardIdentifier = " << setprecision(indent) << m_nonStandardIdentifier << '\n';
00279 strm << setw(indent+7) << "data = " << setprecision(indent) << m_data << '\n';
00280 strm << setw(indent-1) << setprecision(indent-2) << "}";
00281 }
00282 #endif
00283
00284
00285 PObject::Comparison H235_NonStandardParameter::Compare(const PObject & obj) const
00286 {
00287 #ifndef PASN_LEANANDMEAN
00288 PAssert(PIsDescendant(&obj, H235_NonStandardParameter), PInvalidCast);
00289 #endif
00290 const H235_NonStandardParameter & other = (const H235_NonStandardParameter &)obj;
00291
00292 Comparison result;
00293
00294 if ((result = m_nonStandardIdentifier.Compare(other.m_nonStandardIdentifier)) != EqualTo)
00295 return result;
00296 if ((result = m_data.Compare(other.m_data)) != EqualTo)
00297 return result;
00298
00299 return PASN_Sequence::Compare(other);
00300 }
00301
00302
00303 PINDEX H235_NonStandardParameter::GetDataLength() const
00304 {
00305 PINDEX length = 0;
00306 length += m_nonStandardIdentifier.GetObjectLength();
00307 length += m_data.GetObjectLength();
00308 return length;
00309 }
00310
00311
00312 BOOL H235_NonStandardParameter::Decode(PASN_Stream & strm)
00313 {
00314 if (!PreambleDecode(strm))
00315 return FALSE;
00316
00317 if (!m_nonStandardIdentifier.Decode(strm))
00318 return FALSE;
00319 if (!m_data.Decode(strm))
00320 return FALSE;
00321
00322 return UnknownExtensionsDecode(strm);
00323 }
00324
00325
00326 void H235_NonStandardParameter::Encode(PASN_Stream & strm) const
00327 {
00328 PreambleEncode(strm);
00329
00330 m_nonStandardIdentifier.Encode(strm);
00331 m_data.Encode(strm);
00332
00333 UnknownExtensionsEncode(strm);
00334 }
00335
00336
00337 PObject * H235_NonStandardParameter::Clone() const
00338 {
00339 #ifndef PASN_LEANANDMEAN
00340 PAssert(IsClass(H235_NonStandardParameter::Class()), PInvalidCast);
00341 #endif
00342 return new H235_NonStandardParameter(*this);
00343 }
00344
00345
00346
00347
00348
00349
00350 H235_DHset::H235_DHset(unsigned tag, PASN_Object::TagClass tagClass)
00351 : PASN_Sequence(tag, tagClass, 0, TRUE, 0)
00352 {
00353 m_halfkey.SetConstraints(PASN_Object::FixedConstraint, 0, 2048);
00354 m_modSize.SetConstraints(PASN_Object::FixedConstraint, 0, 2048);
00355 m_generator.SetConstraints(PASN_Object::FixedConstraint, 0, 2048);
00356 }
00357
00358
00359 #ifndef PASN_NOPRINTON
00360 void H235_DHset::PrintOn(ostream & strm) const
00361 {
00362 int indent = strm.precision() + 2;
00363 strm << "{\n";
00364 strm << setw(indent+10) << "halfkey = " << setprecision(indent) << m_halfkey << '\n';
00365 strm << setw(indent+10) << "modSize = " << setprecision(indent) << m_modSize << '\n';
00366 strm << setw(indent+12) << "generator = " << setprecision(indent) << m_generator << '\n';
00367 strm << setw(indent-1) << setprecision(indent-2) << "}";
00368 }
00369 #endif
00370
00371
00372 PObject::Comparison H235_DHset::Compare(const PObject & obj) const
00373 {
00374 #ifndef PASN_LEANANDMEAN
00375 PAssert(PIsDescendant(&obj, H235_DHset), PInvalidCast);
00376 #endif
00377 const H235_DHset & other = (const H235_DHset &)obj;
00378
00379 Comparison result;
00380
00381 if ((result = m_halfkey.Compare(other.m_halfkey)) != EqualTo)
00382 return result;
00383 if ((result = m_modSize.Compare(other.m_modSize)) != EqualTo)
00384 return result;
00385 if ((result = m_generator.Compare(other.m_generator)) != EqualTo)
00386 return result;
00387
00388 return PASN_Sequence::Compare(other);
00389 }
00390
00391
00392 PINDEX H235_DHset::GetDataLength() const
00393 {
00394 PINDEX length = 0;
00395 length += m_halfkey.GetObjectLength();
00396 length += m_modSize.GetObjectLength();
00397 length += m_generator.GetObjectLength();
00398 return length;
00399 }
00400
00401
00402 BOOL H235_DHset::Decode(PASN_Stream & strm)
00403 {
00404 if (!PreambleDecode(strm))
00405 return FALSE;
00406
00407 if (!m_halfkey.Decode(strm))
00408 return FALSE;
00409 if (!m_modSize.Decode(strm))
00410 return FALSE;
00411 if (!m_generator.Decode(strm))
00412 return FALSE;
00413
00414 return UnknownExtensionsDecode(strm);
00415 }
00416
00417
00418 void H235_DHset::Encode(PASN_Stream & strm) const
00419 {
00420 PreambleEncode(strm);
00421
00422 m_halfkey.Encode(strm);
00423 m_modSize.Encode(strm);
00424 m_generator.Encode(strm);
00425
00426 UnknownExtensionsEncode(strm);
00427 }
00428
00429
00430 PObject * H235_DHset::Clone() const
00431 {
00432 #ifndef PASN_LEANANDMEAN
00433 PAssert(IsClass(H235_DHset::Class()), PInvalidCast);
00434 #endif
00435 return new H235_DHset(*this);
00436 }
00437
00438
00439
00440
00441
00442
00443 H235_ECpoint::H235_ECpoint(unsigned tag, PASN_Object::TagClass tagClass)
00444 : PASN_Sequence(tag, tagClass, 2, TRUE, 0)
00445 {
00446 m_x.SetConstraints(PASN_Object::FixedConstraint, 0, 511);
00447 m_y.SetConstraints(PASN_Object::FixedConstraint, 0, 511);
00448 }
00449
00450
00451 #ifndef PASN_NOPRINTON
00452 void H235_ECpoint::PrintOn(ostream & strm) const
00453 {
00454 int indent = strm.precision() + 2;
00455 strm << "{\n";
00456 if (HasOptionalField(e_x))
00457 strm << setw(indent+4) << "x = " << setprecision(indent) << m_x << '\n';
00458 if (HasOptionalField(e_y))
00459 strm << setw(indent+4) << "y = " << setprecision(indent) << m_y << '\n';
00460 strm << setw(indent-1) << setprecision(indent-2) << "}";
00461 }
00462 #endif
00463
00464
00465 PObject::Comparison H235_ECpoint::Compare(const PObject & obj) const
00466 {
00467 #ifndef PASN_LEANANDMEAN
00468 PAssert(PIsDescendant(&obj, H235_ECpoint), PInvalidCast);
00469 #endif
00470 const H235_ECpoint & other = (const H235_ECpoint &)obj;
00471
00472 Comparison result;
00473
00474 if ((result = m_x.Compare(other.m_x)) != EqualTo)
00475 return result;
00476 if ((result = m_y.Compare(other.m_y)) != EqualTo)
00477 return result;
00478
00479 return PASN_Sequence::Compare(other);
00480 }
00481
00482
00483 PINDEX H235_ECpoint::GetDataLength() const
00484 {
00485 PINDEX length = 0;
00486 if (HasOptionalField(e_x))
00487 length += m_x.GetObjectLength();
00488 if (HasOptionalField(e_y))
00489 length += m_y.GetObjectLength();
00490 return length;
00491 }
00492
00493
00494 BOOL H235_ECpoint::Decode(PASN_Stream & strm)
00495 {
00496 if (!PreambleDecode(strm))
00497 return FALSE;
00498
00499 if (HasOptionalField(e_x) && !m_x.Decode(strm))
00500 return FALSE;
00501 if (HasOptionalField(e_y) && !m_y.Decode(strm))
00502 return FALSE;
00503
00504 return UnknownExtensionsDecode(strm);
00505 }
00506
00507
00508 void H235_ECpoint::Encode(PASN_Stream & strm) const
00509 {
00510 PreambleEncode(strm);
00511
00512 if (HasOptionalField(e_x))
00513 m_x.Encode(strm);
00514 if (HasOptionalField(e_y))
00515 m_y.Encode(strm);
00516
00517 UnknownExtensionsEncode(strm);
00518 }
00519
00520
00521 PObject * H235_ECpoint::Clone() const
00522 {
00523 #ifndef PASN_LEANANDMEAN
00524 PAssert(IsClass(H235_ECpoint::Class()), PInvalidCast);
00525 #endif
00526 return new H235_ECpoint(*this);
00527 }
00528
00529
00530
00531 #ifndef PASN_NOPRINTON
00532 const static PASN_Names Names_H235_ECKASDH[]={
00533 {"eckasdhp",0}
00534 ,{"eckasdh2",1}
00535 };
00536 #endif
00537
00538
00539
00540
00541 H235_ECKASDH::H235_ECKASDH(unsigned tag, PASN_Object::TagClass tagClass)
00542 : PASN_Choice(tag, tagClass, 2, TRUE
00543 #ifndef PASN_NOPRINTON
00544 ,(const PASN_Names *)Names_H235_ECKASDH,2
00545 #endif
00546 )
00547 {
00548 }
00549
00550
00551 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
00552 H235_ECKASDH::operator H235_ECKASDH_eckasdhp &() const
00553 #else
00554 H235_ECKASDH::operator H235_ECKASDH_eckasdhp &()
00555 {
00556 #ifndef PASN_LEANANDMEAN
00557 PAssert(PIsDescendant(PAssertNULL(choice), H235_ECKASDH_eckasdhp), PInvalidCast);
00558 #endif
00559 return *(H235_ECKASDH_eckasdhp *)choice;
00560 }
00561
00562
00563 H235_ECKASDH::operator const H235_ECKASDH_eckasdhp &() const
00564 #endif
00565 {
00566 #ifndef PASN_LEANANDMEAN
00567 PAssert(PIsDescendant(PAssertNULL(choice), H235_ECKASDH_eckasdhp), PInvalidCast);
00568 #endif
00569 return *(H235_ECKASDH_eckasdhp *)choice;
00570 }
00571
00572
00573 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
00574 H235_ECKASDH::operator H235_ECKASDH_eckasdh2 &() const
00575 #else
00576 H235_ECKASDH::operator H235_ECKASDH_eckasdh2 &()
00577 {
00578 #ifndef PASN_LEANANDMEAN
00579 PAssert(PIsDescendant(PAssertNULL(choice), H235_ECKASDH_eckasdh2), PInvalidCast);
00580 #endif
00581 return *(H235_ECKASDH_eckasdh2 *)choice;
00582 }
00583
00584
00585 H235_ECKASDH::operator const H235_ECKASDH_eckasdh2 &() const
00586 #endif
00587 {
00588 #ifndef PASN_LEANANDMEAN
00589 PAssert(PIsDescendant(PAssertNULL(choice), H235_ECKASDH_eckasdh2), PInvalidCast);
00590 #endif
00591 return *(H235_ECKASDH_eckasdh2 *)choice;
00592 }
00593
00594
00595 BOOL H235_ECKASDH::CreateObject()
00596 {
00597 switch (tag) {
00598 case e_eckasdhp :
00599 choice = new H235_ECKASDH_eckasdhp();
00600 return TRUE;
00601 case e_eckasdh2 :
00602 choice = new H235_ECKASDH_eckasdh2();
00603 return TRUE;
00604 }
00605
00606 choice = NULL;
00607 return FALSE;
00608 }
00609
00610
00611 PObject * H235_ECKASDH::Clone() const
00612 {
00613 #ifndef PASN_LEANANDMEAN
00614 PAssert(IsClass(H235_ECKASDH::Class()), PInvalidCast);
00615 #endif
00616 return new H235_ECKASDH(*this);
00617 }
00618
00619
00620
00621
00622
00623
00624 H235_ECGDSASignature::H235_ECGDSASignature(unsigned tag, PASN_Object::TagClass tagClass)
00625 : PASN_Sequence(tag, tagClass, 0, FALSE, 0)
00626 {
00627 m_r.SetConstraints(PASN_Object::FixedConstraint, 0, 511);
00628 m_s.SetConstraints(PASN_Object::FixedConstraint, 0, 511);
00629 }
00630
00631
00632 #ifndef PASN_NOPRINTON
00633 void H235_ECGDSASignature::PrintOn(ostream & strm) const
00634 {
00635 int indent = strm.precision() + 2;
00636 strm << "{\n";
00637 strm << setw(indent+4) << "r = " << setprecision(indent) << m_r << '\n';
00638 strm << setw(indent+4) << "s = " << setprecision(indent) << m_s << '\n';
00639 strm << setw(indent-1) << setprecision(indent-2) << "}";
00640 }
00641 #endif
00642
00643
00644 PObject::Comparison H235_ECGDSASignature::Compare(const PObject & obj) const
00645 {
00646 #ifndef PASN_LEANANDMEAN
00647 PAssert(PIsDescendant(&obj, H235_ECGDSASignature), PInvalidCast);
00648 #endif
00649 const H235_ECGDSASignature & other = (const H235_ECGDSASignature &)obj;
00650
00651 Comparison result;
00652
00653 if ((result = m_r.Compare(other.m_r)) != EqualTo)
00654 return result;
00655 if ((result = m_s.Compare(other.m_s)) != EqualTo)
00656 return result;
00657
00658 return PASN_Sequence::Compare(other);
00659 }
00660
00661
00662 PINDEX H235_ECGDSASignature::GetDataLength() const
00663 {
00664 PINDEX length = 0;
00665 length += m_r.GetObjectLength();
00666 length += m_s.GetObjectLength();
00667 return length;
00668 }
00669
00670
00671 BOOL H235_ECGDSASignature::Decode(PASN_Stream & strm)
00672 {
00673 if (!PreambleDecode(strm))
00674 return FALSE;
00675
00676 if (!m_r.Decode(strm))
00677 return FALSE;
00678 if (!m_s.Decode(strm))
00679 return FALSE;
00680
00681 return UnknownExtensionsDecode(strm);
00682 }
00683
00684
00685 void H235_ECGDSASignature::Encode(PASN_Stream & strm) const
00686 {
00687 PreambleEncode(strm);
00688
00689 m_r.Encode(strm);
00690 m_s.Encode(strm);
00691
00692 UnknownExtensionsEncode(strm);
00693 }
00694
00695
00696 PObject * H235_ECGDSASignature::Clone() const
00697 {
00698 #ifndef PASN_LEANANDMEAN
00699 PAssert(IsClass(H235_ECGDSASignature::Class()), PInvalidCast);
00700 #endif
00701 return new H235_ECGDSASignature(*this);
00702 }
00703
00704
00705
00706
00707
00708
00709 H235_TypedCertificate::H235_TypedCertificate(unsigned tag, PASN_Object::TagClass tagClass)
00710 : PASN_Sequence(tag, tagClass, 0, TRUE, 0)
00711 {
00712 }
00713
00714
00715 #ifndef PASN_NOPRINTON
00716 void H235_TypedCertificate::PrintOn(ostream & strm) const
00717 {
00718 int indent = strm.precision() + 2;
00719 strm << "{\n";
00720 strm << setw(indent+7) << "type = " << setprecision(indent) << m_type << '\n';
00721 strm << setw(indent+14) << "certificate = " << setprecision(indent) << m_certificate << '\n';
00722 strm << setw(indent-1) << setprecision(indent-2) << "}";
00723 }
00724 #endif
00725
00726
00727 PObject::Comparison H235_TypedCertificate::Compare(const PObject & obj) const
00728 {
00729 #ifndef PASN_LEANANDMEAN
00730 PAssert(PIsDescendant(&obj, H235_TypedCertificate), PInvalidCast);
00731 #endif
00732 const H235_TypedCertificate & other = (const H235_TypedCertificate &)obj;
00733
00734 Comparison result;
00735
00736 if ((result = m_type.Compare(other.m_type)) != EqualTo)
00737 return result;
00738 if ((result = m_certificate.Compare(other.m_certificate)) != EqualTo)
00739 return result;
00740
00741 return PASN_Sequence::Compare(other);
00742 }
00743
00744
00745 PINDEX H235_TypedCertificate::GetDataLength() const
00746 {
00747 PINDEX length = 0;
00748 length += m_type.GetObjectLength();
00749 length += m_certificate.GetObjectLength();
00750 return length;
00751 }
00752
00753
00754 BOOL H235_TypedCertificate::Decode(PASN_Stream & strm)
00755 {
00756 if (!PreambleDecode(strm))
00757 return FALSE;
00758
00759 if (!m_type.Decode(strm))
00760 return FALSE;
00761 if (!m_certificate.Decode(strm))
00762 return FALSE;
00763
00764 return UnknownExtensionsDecode(strm);
00765 }
00766
00767
00768 void H235_TypedCertificate::Encode(PASN_Stream & strm) const
00769 {
00770 PreambleEncode(strm);
00771
00772 m_type.Encode(strm);
00773 m_certificate.Encode(strm);
00774
00775 UnknownExtensionsEncode(strm);
00776 }
00777
00778
00779 PObject * H235_TypedCertificate::Clone() const
00780 {
00781 #ifndef PASN_LEANANDMEAN
00782 PAssert(IsClass(H235_TypedCertificate::Class()), PInvalidCast);
00783 #endif
00784 return new H235_TypedCertificate(*this);
00785 }
00786
00787
00788
00789 #ifndef PASN_NOPRINTON
00790 const static PASN_Names Names_H235_AuthenticationBES[]={
00791 {"default",0}
00792 ,{"radius",1}
00793 };
00794 #endif
00795
00796
00797
00798
00799 H235_AuthenticationBES::H235_AuthenticationBES(unsigned tag, PASN_Object::TagClass tagClass)
00800 : PASN_Choice(tag, tagClass, 2, TRUE
00801 #ifndef PASN_NOPRINTON
00802 ,(const PASN_Names *)Names_H235_AuthenticationBES,2
00803 #endif
00804 )
00805 {
00806 }
00807
00808
00809 BOOL H235_AuthenticationBES::CreateObject()
00810 {
00811 choice = (tag <= e_radius) ? new PASN_Null() : NULL;
00812 return choice != NULL;
00813 }
00814
00815
00816 PObject * H235_AuthenticationBES::Clone() const
00817 {
00818 #ifndef PASN_LEANANDMEAN
00819 PAssert(IsClass(H235_AuthenticationBES::Class()), PInvalidCast);
00820 #endif
00821 return new H235_AuthenticationBES(*this);
00822 }
00823
00824
00825
00826 #ifndef PASN_NOPRINTON
00827 const static PASN_Names Names_H235_AuthenticationMechanism[]={
00828 {"dhExch",0}
00829 ,{"pwdSymEnc",1}
00830 ,{"pwdHash",2}
00831 ,{"certSign",3}
00832 ,{"ipsec",4}
00833 ,{"tls",5}
00834 ,{"nonStandard",6}
00835 ,{"authenticationBES",7}
00836 ,{"keyExch",8}
00837 };
00838 #endif
00839
00840
00841
00842
00843 H235_AuthenticationMechanism::H235_AuthenticationMechanism(unsigned tag, PASN_Object::TagClass tagClass)
00844 : PASN_Choice(tag, tagClass, 7, TRUE
00845 #ifndef PASN_NOPRINTON
00846 ,(const PASN_Names *)Names_H235_AuthenticationMechanism,9
00847 #endif
00848 )
00849 {
00850 }
00851
00852
00853 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
00854 H235_AuthenticationMechanism::operator H235_NonStandardParameter &() const
00855 #else
00856 H235_AuthenticationMechanism::operator H235_NonStandardParameter &()
00857 {
00858 #ifndef PASN_LEANANDMEAN
00859 PAssert(PIsDescendant(PAssertNULL(choice), H235_NonStandardParameter), PInvalidCast);
00860 #endif
00861 return *(H235_NonStandardParameter *)choice;
00862 }
00863
00864
00865 H235_AuthenticationMechanism::operator const H235_NonStandardParameter &() const
00866 #endif
00867 {
00868 #ifndef PASN_LEANANDMEAN
00869 PAssert(PIsDescendant(PAssertNULL(choice), H235_NonStandardParameter), PInvalidCast);
00870 #endif
00871 return *(H235_NonStandardParameter *)choice;
00872 }
00873
00874
00875 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
00876 H235_AuthenticationMechanism::operator H235_AuthenticationBES &() const
00877 #else
00878 H235_AuthenticationMechanism::operator H235_AuthenticationBES &()
00879 {
00880 #ifndef PASN_LEANANDMEAN
00881 PAssert(PIsDescendant(PAssertNULL(choice), H235_AuthenticationBES), PInvalidCast);
00882 #endif
00883 return *(H235_AuthenticationBES *)choice;
00884 }
00885
00886
00887 H235_AuthenticationMechanism::operator const H235_AuthenticationBES &() const
00888 #endif
00889 {
00890 #ifndef PASN_LEANANDMEAN
00891 PAssert(PIsDescendant(PAssertNULL(choice), H235_AuthenticationBES), PInvalidCast);
00892 #endif
00893 return *(H235_AuthenticationBES *)choice;
00894 }
00895
00896
00897 BOOL H235_AuthenticationMechanism::CreateObject()
00898 {
00899 switch (tag) {
00900 case e_dhExch :
00901 case e_pwdSymEnc :
00902 case e_pwdHash :
00903 case e_certSign :
00904 case e_ipsec :
00905 case e_tls :
00906 choice = new PASN_Null();
00907 return TRUE;
00908 case e_nonStandard :
00909 choice = new H235_NonStandardParameter();
00910 return TRUE;
00911 case e_authenticationBES :
00912 choice = new H235_AuthenticationBES();
00913 return TRUE;
00914 case e_keyExch :
00915 choice = new PASN_ObjectId();
00916 return TRUE;
00917 }
00918
00919 choice = NULL;
00920 return FALSE;
00921 }
00922
00923
00924 PObject * H235_AuthenticationMechanism::Clone() const
00925 {
00926 #ifndef PASN_LEANANDMEAN
00927 PAssert(IsClass(H235_AuthenticationMechanism::Class()), PInvalidCast);
00928 #endif
00929 return new H235_AuthenticationMechanism(*this);
00930 }
00931
00932
00933
00934 #ifndef PASN_NOPRINTON
00935 const static PASN_Names Names_H235_Element[]={
00936 {"octets",0}
00937 ,{"integer",1}
00938 ,{"bits",2}
00939 ,{"name",3}
00940 ,{"flag",4}
00941 };
00942 #endif
00943
00944
00945
00946
00947 H235_Element::H235_Element(unsigned tag, PASN_Object::TagClass tagClass)
00948 : PASN_Choice(tag, tagClass, 5, TRUE
00949 #ifndef PASN_NOPRINTON
00950 ,(const PASN_Names *)Names_H235_Element,5
00951 #endif
00952 )
00953 {
00954 }
00955
00956
00957 BOOL H235_Element::CreateObject()
00958 {
00959 switch (tag) {
00960 case e_octets :
00961 choice = new PASN_OctetString();
00962 return TRUE;
00963 case e_integer :
00964 choice = new PASN_Integer();
00965 return TRUE;
00966 case e_bits :
00967 choice = new PASN_BitString();
00968 return TRUE;
00969 case e_name :
00970 choice = new PASN_BMPString();
00971 return TRUE;
00972 case e_flag :
00973 choice = new PASN_Boolean();
00974 return TRUE;
00975 }
00976
00977 choice = NULL;
00978 return FALSE;
00979 }
00980
00981
00982 PObject * H235_Element::Clone() const
00983 {
00984 #ifndef PASN_LEANANDMEAN
00985 PAssert(IsClass(H235_Element::Class()), PInvalidCast);
00986 #endif
00987 return new H235_Element(*this);
00988 }
00989
00990
00991
00992
00993
00994
00995 H235_IV8::H235_IV8(unsigned tag, PASN_Object::TagClass tagClass)
00996 : PASN_OctetString(tag, tagClass)
00997 {
00998 SetConstraints(PASN_Object::FixedConstraint, 8);
00999 }
01000
01001
01002 H235_IV8::H235_IV8(const char * v)
01003 {
01004 SetValue(v);
01005 }
01006
01007
01008 H235_IV8::H235_IV8(const PString & v)
01009 {
01010 SetValue(v);
01011 }
01012
01013
01014 H235_IV8::H235_IV8(const PBYTEArray & v)
01015 {
01016 SetValue(v);
01017 }
01018
01019
01020 H235_IV8 & H235_IV8::operator=(const char * v)
01021 {
01022 SetValue(v);
01023 return *this;
01024 }
01025
01026
01027 H235_IV8 & H235_IV8::operator=(const PString & v)
01028 {
01029 SetValue(v);
01030 return *this;
01031 }
01032
01033
01034 H235_IV8 & H235_IV8::operator=(const PBYTEArray & v)
01035 {
01036 SetValue(v);
01037 return *this;
01038 }
01039
01040
01041 PObject * H235_IV8::Clone() const
01042 {
01043 #ifndef PASN_LEANANDMEAN
01044 PAssert(IsClass(H235_IV8::Class()), PInvalidCast);
01045 #endif
01046 return new H235_IV8(*this);
01047 }
01048
01049
01050
01051
01052
01053
01054 H235_IV16::H235_IV16(unsigned tag, PASN_Object::TagClass tagClass)
01055 : PASN_OctetString(tag, tagClass)
01056 {
01057 SetConstraints(PASN_Object::FixedConstraint, 16);
01058 }
01059
01060
01061 H235_IV16::H235_IV16(const char * v)
01062 {
01063 SetValue(v);
01064 }
01065
01066
01067 H235_IV16::H235_IV16(const PString & v)
01068 {
01069 SetValue(v);
01070 }
01071
01072
01073 H235_IV16::H235_IV16(const PBYTEArray & v)
01074 {
01075 SetValue(v);
01076 }
01077
01078
01079 H235_IV16 & H235_IV16::operator=(const char * v)
01080 {
01081 SetValue(v);
01082 return *this;
01083 }
01084
01085
01086 H235_IV16 & H235_IV16::operator=(const PString & v)
01087 {
01088 SetValue(v);
01089 return *this;
01090 }
01091
01092
01093 H235_IV16 & H235_IV16::operator=(const PBYTEArray & v)
01094 {
01095 SetValue(v);
01096 return *this;
01097 }
01098
01099
01100 PObject * H235_IV16::Clone() const
01101 {
01102 #ifndef PASN_LEANANDMEAN
01103 PAssert(IsClass(H235_IV16::Class()), PInvalidCast);
01104 #endif
01105 return new H235_IV16(*this);
01106 }
01107
01108
01109
01110
01111
01112
01113 H235_Params::H235_Params(unsigned tag, PASN_Object::TagClass tagClass)
01114 : PASN_Sequence(tag, tagClass, 2, TRUE, 3)
01115 {
01116 }
01117
01118
01119 #ifndef PASN_NOPRINTON
01120 void H235_Params::PrintOn(ostream & strm) const
01121 {
01122 int indent = strm.precision() + 2;
01123 strm << "{\n";
01124 if (HasOptionalField(e_ranInt))
01125 strm << setw(indent+9) << "ranInt = " << setprecision(indent) << m_ranInt << '\n';
01126 if (HasOptionalField(e_iv8))
01127 strm << setw(indent+6) << "iv8 = " << setprecision(indent) << m_iv8 << '\n';
01128 if (HasOptionalField(e_iv16))
01129 strm << setw(indent+7) << "iv16 = " << setprecision(indent) << m_iv16 << '\n';
01130 if (HasOptionalField(e_iv))
01131 strm << setw(indent+5) << "iv = " << setprecision(indent) << m_iv << '\n';
01132 if (HasOptionalField(e_clearSalt))
01133 strm << setw(indent+12) << "clearSalt = " << setprecision(indent) << m_clearSalt << '\n';
01134 strm << setw(indent-1) << setprecision(indent-2) << "}";
01135 }
01136 #endif
01137
01138
01139 PObject::Comparison H235_Params::Compare(const PObject & obj) const
01140 {
01141 #ifndef PASN_LEANANDMEAN
01142 PAssert(PIsDescendant(&obj, H235_Params), PInvalidCast);
01143 #endif
01144 const H235_Params & other = (const H235_Params &)obj;
01145
01146 Comparison result;
01147
01148 if ((result = m_ranInt.Compare(other.m_ranInt)) != EqualTo)
01149 return result;
01150 if ((result = m_iv8.Compare(other.m_iv8)) != EqualTo)
01151 return result;
01152
01153 return PASN_Sequence::Compare(other);
01154 }
01155
01156
01157 PINDEX H235_Params::GetDataLength() const
01158 {
01159 PINDEX length = 0;
01160 if (HasOptionalField(e_ranInt))
01161 length += m_ranInt.GetObjectLength();
01162 if (HasOptionalField(e_iv8))
01163 length += m_iv8.GetObjectLength();
01164 return length;
01165 }
01166
01167
01168 BOOL H235_Params::Decode(PASN_Stream & strm)
01169 {
01170 if (!PreambleDecode(strm))
01171 return FALSE;
01172
01173 if (HasOptionalField(e_ranInt) && !m_ranInt.Decode(strm))
01174 return FALSE;
01175 if (HasOptionalField(e_iv8) && !m_iv8.Decode(strm))
01176 return FALSE;
01177 if (!KnownExtensionDecode(strm, e_iv16, m_iv16))
01178 return FALSE;
01179 if (!KnownExtensionDecode(strm, e_iv, m_iv))
01180 return FALSE;
01181 if (!KnownExtensionDecode(strm, e_clearSalt, m_clearSalt))
01182 return FALSE;
01183
01184 return UnknownExtensionsDecode(strm);
01185 }
01186
01187
01188 void H235_Params::Encode(PASN_Stream & strm) const
01189 {
01190 PreambleEncode(strm);
01191
01192 if (HasOptionalField(e_ranInt))
01193 m_ranInt.Encode(strm);
01194 if (HasOptionalField(e_iv8))
01195 m_iv8.Encode(strm);
01196 KnownExtensionEncode(strm, e_iv16, m_iv16);
01197 KnownExtensionEncode(strm, e_iv, m_iv);
01198 KnownExtensionEncode(strm, e_clearSalt, m_clearSalt);
01199
01200 UnknownExtensionsEncode(strm);
01201 }
01202
01203
01204 PObject * H235_Params::Clone() const
01205 {
01206 #ifndef PASN_LEANANDMEAN
01207 PAssert(IsClass(H235_Params::Class()), PInvalidCast);
01208 #endif
01209 return new H235_Params(*this);
01210 }
01211
01212
01213
01214
01215
01216
01217 H235_ReturnSig::H235_ReturnSig(unsigned tag, PASN_Object::TagClass tagClass)
01218 : PASN_Sequence(tag, tagClass, 2, FALSE, 0)
01219 {
01220 }
01221
01222
01223 #ifndef PASN_NOPRINTON
01224 void H235_ReturnSig::PrintOn(ostream & strm) const
01225 {
01226 int indent = strm.precision() + 2;
01227 strm << "{\n";
01228 strm << setw(indent+12) << "generalId = " << setprecision(indent) << m_generalId << '\n';
01229 strm << setw(indent+17) << "responseRandom = " << setprecision(indent) << m_responseRandom << '\n';
01230 if (HasOptionalField(e_requestRandom))
01231 strm << setw(indent+16) << "requestRandom = " << setprecision(indent) << m_requestRandom << '\n';
01232 if (HasOptionalField(e_certificate))
01233 strm << setw(indent+14) << "certificate = " << setprecision(indent) << m_certificate << '\n';
01234 strm << setw(indent-1) << setprecision(indent-2) << "}";
01235 }
01236 #endif
01237
01238
01239 PObject::Comparison H235_ReturnSig::Compare(const PObject & obj) const
01240 {
01241 #ifndef PASN_LEANANDMEAN
01242 PAssert(PIsDescendant(&obj, H235_ReturnSig), PInvalidCast);
01243 #endif
01244 const H235_ReturnSig & other = (const H235_ReturnSig &)obj;
01245
01246 Comparison result;
01247
01248 if ((result = m_generalId.Compare(other.m_generalId)) != EqualTo)
01249 return result;
01250 if ((result = m_responseRandom.Compare(other.m_responseRandom)) != EqualTo)
01251 return result;
01252 if ((result = m_requestRandom.Compare(other.m_requestRandom)) != EqualTo)
01253 return result;
01254 if ((result = m_certificate.Compare(other.m_certificate)) != EqualTo)
01255 return result;
01256
01257 return PASN_Sequence::Compare(other);
01258 }
01259
01260
01261 PINDEX H235_ReturnSig::GetDataLength() const
01262 {
01263 PINDEX length = 0;
01264 length += m_generalId.GetObjectLength();
01265 length += m_responseRandom.GetObjectLength();
01266 if (HasOptionalField(e_requestRandom))
01267 length += m_requestRandom.GetObjectLength();
01268 if (HasOptionalField(e_certificate))
01269 length += m_certificate.GetObjectLength();
01270 return length;
01271 }
01272
01273
01274 BOOL H235_ReturnSig::Decode(PASN_Stream & strm)
01275 {
01276 if (!PreambleDecode(strm))
01277 return FALSE;
01278
01279 if (!m_generalId.Decode(strm))
01280 return FALSE;
01281 if (!m_responseRandom.Decode(strm))
01282 return FALSE;
01283 if (HasOptionalField(e_requestRandom) && !m_requestRandom.Decode(strm))
01284 return FALSE;
01285 if (HasOptionalField(e_certificate) && !m_certificate.Decode(strm))
01286 return FALSE;
01287
01288 return UnknownExtensionsDecode(strm);
01289 }
01290
01291
01292 void H235_ReturnSig::Encode(PASN_Stream & strm) const
01293 {
01294 PreambleEncode(strm);
01295
01296 m_generalId.Encode(strm);
01297 m_responseRandom.Encode(strm);
01298 if (HasOptionalField(e_requestRandom))
01299 m_requestRandom.Encode(strm);
01300 if (HasOptionalField(e_certificate))
01301 m_certificate.Encode(strm);
01302
01303 UnknownExtensionsEncode(strm);
01304 }
01305
01306
01307 PObject * H235_ReturnSig::Clone() const
01308 {
01309 #ifndef PASN_LEANANDMEAN
01310 PAssert(IsClass(H235_ReturnSig::Class()), PInvalidCast);
01311 #endif
01312 return new H235_ReturnSig(*this);
01313 }
01314
01315
01316
01317
01318
01319
01320 H235_EncodedReturnSig::H235_EncodedReturnSig(unsigned tag, PASN_Object::TagClass tagClass)
01321 : PASN_OctetString(tag, tagClass)
01322 {
01323 }
01324
01325
01326 PObject * H235_EncodedReturnSig::Clone() const
01327 {
01328 #ifndef PASN_LEANANDMEAN
01329 PAssert(IsClass(H235_EncodedReturnSig::Class()), PInvalidCast);
01330 #endif
01331 return new H235_EncodedReturnSig(*this);
01332 }
01333
01334
01335
01336
01337
01338
01339 H235_KeySyncMaterial::H235_KeySyncMaterial(unsigned tag, PASN_Object::TagClass tagClass)
01340 : PASN_Sequence(tag, tagClass, 0, TRUE, 0)
01341 {
01342 }
01343
01344
01345 #ifndef PASN_NOPRINTON
01346 void H235_KeySyncMaterial::PrintOn(ostream & strm) const
01347 {
01348 int indent = strm.precision() + 2;
01349 strm << "{\n";
01350 strm << setw(indent+12) << "generalID = " << setprecision(indent) << m_generalID << '\n';
01351 strm << setw(indent+14) << "keyMaterial = " << setprecision(indent) << m_keyMaterial << '\n';
01352 strm << setw(indent-1) << setprecision(indent-2) << "}";
01353 }
01354 #endif
01355
01356
01357 PObject::Comparison H235_KeySyncMaterial::Compare(const PObject & obj) const
01358 {
01359 #ifndef PASN_LEANANDMEAN
01360 PAssert(PIsDescendant(&obj, H235_KeySyncMaterial), PInvalidCast);
01361 #endif
01362 const H235_KeySyncMaterial & other = (const H235_KeySyncMaterial &)obj;
01363
01364 Comparison result;
01365
01366 if ((result = m_generalID.Compare(other.m_generalID)) != EqualTo)
01367 return result;
01368 if ((result = m_keyMaterial.Compare(other.m_keyMaterial)) != EqualTo)
01369 return result;
01370
01371 return PASN_Sequence::Compare(other);
01372 }
01373
01374
01375 PINDEX H235_KeySyncMaterial::GetDataLength() const
01376 {
01377 PINDEX length = 0;
01378 length += m_generalID.GetObjectLength();
01379 length += m_keyMaterial.GetObjectLength();
01380 return length;
01381 }
01382
01383
01384 BOOL H235_KeySyncMaterial::Decode(PASN_Stream & strm)
01385 {
01386 if (!PreambleDecode(strm))
01387 return FALSE;
01388
01389 if (!m_generalID.Decode(strm))
01390 return FALSE;
01391 if (!m_keyMaterial.Decode(strm))
01392 return FALSE;
01393
01394 return UnknownExtensionsDecode(strm);
01395 }
01396
01397
01398 void H235_KeySyncMaterial::Encode(PASN_Stream & strm) const
01399 {
01400 PreambleEncode(strm);
01401
01402 m_generalID.Encode(strm);
01403 m_keyMaterial.Encode(strm);
01404
01405 UnknownExtensionsEncode(strm);
01406 }
01407
01408
01409 PObject * H235_KeySyncMaterial::Clone() const
01410 {
01411 #ifndef PASN_LEANANDMEAN
01412 PAssert(IsClass(H235_KeySyncMaterial::Class()), PInvalidCast);
01413 #endif
01414 return new H235_KeySyncMaterial(*this);
01415 }
01416
01417
01418
01419
01420
01421
01422 H235_EncodedKeySyncMaterial::H235_EncodedKeySyncMaterial(unsigned tag, PASN_Object::TagClass tagClass)
01423 : PASN_OctetString(tag, tagClass)
01424 {
01425 }
01426
01427
01428 PObject * H235_EncodedKeySyncMaterial::Clone() const
01429 {
01430 #ifndef PASN_LEANANDMEAN
01431 PAssert(IsClass(H235_EncodedKeySyncMaterial::Class()), PInvalidCast);
01432 #endif
01433 return new H235_EncodedKeySyncMaterial(*this);
01434 }
01435
01436
01437
01438
01439
01440
01441 H235_V3KeySyncMaterial::H235_V3KeySyncMaterial(unsigned tag, PASN_Object::TagClass tagClass)
01442 : PASN_Sequence(tag, tagClass, 7, TRUE, 1)
01443 {
01444 }
01445
01446
01447 #ifndef PASN_NOPRINTON
01448 void H235_V3KeySyncMaterial::PrintOn(ostream & strm) const
01449 {
01450 int indent = strm.precision() + 2;
01451 strm << "{\n";
01452 if (HasOptionalField(e_generalID))
01453 strm << setw(indent+12) << "generalID = " << setprecision(indent) << m_generalID << '\n';
01454 if (HasOptionalField(e_algorithmOID))
01455 strm << setw(indent+15) << "algorithmOID = " << setprecision(indent) << m_algorithmOID << '\n';
01456 strm << setw(indent+9) << "paramS = " << setprecision(indent) << m_paramS << '\n';
01457 if (HasOptionalField(e_encryptedSessionKey))
01458 strm << setw(indent+22) << "encryptedSessionKey = " << setprecision(indent) << m_encryptedSessionKey << '\n';
01459 if (HasOptionalField(e_encryptedSaltingKey))
01460 strm << setw(indent+22) << "encryptedSaltingKey = " << setprecision(indent) << m_encryptedSaltingKey << '\n';
01461 if (HasOptionalField(e_clearSaltingKey))
01462 strm << setw(indent+18) << "clearSaltingKey = " << setprecision(indent) << m_clearSaltingKey << '\n';
01463 if (HasOptionalField(e_paramSsalt))
01464 strm << setw(indent+13) << "paramSsalt = " << setprecision(indent) << m_paramSsalt << '\n';
01465 if (HasOptionalField(e_keyDerivationOID))
01466 strm << setw(indent+19) << "keyDerivationOID = " << setprecision(indent) << m_keyDerivationOID << '\n';
01467 if (HasOptionalField(e_genericKeyMaterial))
01468 strm << setw(indent+21) << "genericKeyMaterial = " << setprecision(indent) << m_genericKeyMaterial << '\n';
01469 strm << setw(indent-1) << setprecision(indent-2) << "}";
01470 }
01471 #endif
01472
01473
01474 PObject::Comparison H235_V3KeySyncMaterial::Compare(const PObject & obj) const
01475 {
01476 #ifndef PASN_LEANANDMEAN
01477 PAssert(PIsDescendant(&obj, H235_V3KeySyncMaterial), PInvalidCast);
01478 #endif
01479 const H235_V3KeySyncMaterial & other = (const H235_V3KeySyncMaterial &)obj;
01480
01481 Comparison result;
01482
01483 if ((result = m_generalID.Compare(other.m_generalID)) != EqualTo)
01484 return result;
01485 if ((result = m_algorithmOID.Compare(other.m_algorithmOID)) != EqualTo)
01486 return result;
01487 if ((result = m_paramS.Compare(other.m_paramS)) != EqualTo)
01488 return result;
01489 if ((result = m_encryptedSessionKey.Compare(other.m_encryptedSessionKey)) != EqualTo)
01490 return result;
01491 if ((result = m_encryptedSaltingKey.Compare(other.m_encryptedSaltingKey)) != EqualTo)
01492 return result;
01493 if ((result = m_clearSaltingKey.Compare(other.m_clearSaltingKey)) != EqualTo)
01494 return result;
01495 if ((result = m_paramSsalt.Compare(other.m_paramSsalt)) != EqualTo)
01496 return result;
01497 if ((result = m_keyDerivationOID.Compare(other.m_keyDerivationOID)) != EqualTo)
01498 return result;
01499
01500 return PASN_Sequence::Compare(other);
01501 }
01502
01503
01504 PINDEX H235_V3KeySyncMaterial::GetDataLength() const
01505 {
01506 PINDEX length = 0;
01507 if (HasOptionalField(e_generalID))
01508 length += m_generalID.GetObjectLength();
01509 if (HasOptionalField(e_algorithmOID))
01510 length += m_algorithmOID.GetObjectLength();
01511 length += m_paramS.GetObjectLength();
01512 if (HasOptionalField(e_encryptedSessionKey))
01513 length += m_encryptedSessionKey.GetObjectLength();
01514 if (HasOptionalField(e_encryptedSaltingKey))
01515 length += m_encryptedSaltingKey.GetObjectLength();
01516 if (HasOptionalField(e_clearSaltingKey))
01517 length += m_clearSaltingKey.GetObjectLength();
01518 if (HasOptionalField(e_paramSsalt))
01519 length += m_paramSsalt.GetObjectLength();
01520 if (HasOptionalField(e_keyDerivationOID))
01521 length += m_keyDerivationOID.GetObjectLength();
01522 return length;
01523 }
01524
01525
01526 BOOL H235_V3KeySyncMaterial::Decode(PASN_Stream & strm)
01527 {
01528 if (!PreambleDecode(strm))
01529 return FALSE;
01530
01531 if (HasOptionalField(e_generalID) && !m_generalID.Decode(strm))
01532 return FALSE;
01533 if (HasOptionalField(e_algorithmOID) && !m_algorithmOID.Decode(strm))
01534 return FALSE;
01535 if (!m_paramS.Decode(strm))
01536 return FALSE;
01537 if (HasOptionalField(e_encryptedSessionKey) && !m_encryptedSessionKey.Decode(strm))
01538 return FALSE;
01539 if (HasOptionalField(e_encryptedSaltingKey) && !m_encryptedSaltingKey.Decode(strm))
01540 return FALSE;
01541 if (HasOptionalField(e_clearSaltingKey) && !m_clearSaltingKey.Decode(strm))
01542 return FALSE;
01543 if (HasOptionalField(e_paramSsalt) && !m_paramSsalt.Decode(strm))
01544 return FALSE;
01545 if (HasOptionalField(e_keyDerivationOID) && !m_keyDerivationOID.Decode(strm))
01546 return FALSE;
01547 if (!KnownExtensionDecode(strm, e_genericKeyMaterial, m_genericKeyMaterial))
01548 return FALSE;
01549
01550 return UnknownExtensionsDecode(strm);
01551 }
01552
01553
01554 void H235_V3KeySyncMaterial::Encode(PASN_Stream & strm) const
01555 {
01556 PreambleEncode(strm);
01557
01558 if (HasOptionalField(e_generalID))
01559 m_generalID.Encode(strm);
01560 if (HasOptionalField(e_algorithmOID))
01561 m_algorithmOID.Encode(strm);
01562 m_paramS.Encode(strm);
01563 if (HasOptionalField(e_encryptedSessionKey))
01564 m_encryptedSessionKey.Encode(strm);
01565 if (HasOptionalField(e_encryptedSaltingKey))
01566 m_encryptedSaltingKey.Encode(strm);
01567 if (HasOptionalField(e_clearSaltingKey))
01568 m_clearSaltingKey.Encode(strm);
01569 if (HasOptionalField(e_paramSsalt))
01570 m_paramSsalt.Encode(strm);
01571 if (HasOptionalField(e_keyDerivationOID))
01572 m_keyDerivationOID.Encode(strm);
01573 KnownExtensionEncode(strm, e_genericKeyMaterial, m_genericKeyMaterial);
01574
01575 UnknownExtensionsEncode(strm);
01576 }
01577
01578
01579 PObject * H235_V3KeySyncMaterial::Clone() const
01580 {
01581 #ifndef PASN_LEANANDMEAN
01582 PAssert(IsClass(H235_V3KeySyncMaterial::Class()), PInvalidCast);
01583 #endif
01584 return new H235_V3KeySyncMaterial(*this);
01585 }
01586
01587
01588
01589
01590
01591
01592 H235_ECKASDH_eckasdhp::H235_ECKASDH_eckasdhp(unsigned tag, PASN_Object::TagClass tagClass)
01593 : PASN_Sequence(tag, tagClass, 0, FALSE, 0)
01594 {
01595 m_modulus.SetConstraints(PASN_Object::FixedConstraint, 0, 511);
01596 m_weierstrassA.SetConstraints(PASN_Object::FixedConstraint, 0, 511);
01597 m_weierstrassB.SetConstraints(PASN_Object::FixedConstraint, 0, 511);
01598 }
01599
01600
01601 #ifndef PASN_NOPRINTON
01602 void H235_ECKASDH_eckasdhp::PrintOn(ostream & strm) const
01603 {
01604 int indent = strm.precision() + 2;
01605 strm << "{\n";
01606 strm << setw(indent+13) << "public_key = " << setprecision(indent) << m_public_key << '\n';
01607 strm << setw(indent+10) << "modulus = " << setprecision(indent) << m_modulus << '\n';
01608 strm << setw(indent+7) << "base = " << setprecision(indent) << m_base << '\n';
01609 strm << setw(indent+15) << "weierstrassA = " << setprecision(indent) << m_weierstrassA << '\n';
01610 strm << setw(indent+15) << "weierstrassB = " << setprecision(indent) << m_weierstrassB << '\n';
01611 strm << setw(indent-1) << setprecision(indent-2) << "}";
01612 }
01613 #endif
01614
01615
01616 PObject::Comparison H235_ECKASDH_eckasdhp::Compare(const PObject & obj) const
01617 {
01618 #ifndef PASN_LEANANDMEAN
01619 PAssert(PIsDescendant(&obj, H235_ECKASDH_eckasdhp), PInvalidCast);
01620 #endif
01621 const H235_ECKASDH_eckasdhp & other = (const H235_ECKASDH_eckasdhp &)obj;
01622
01623 Comparison result;
01624
01625 if ((result = m_public_key.Compare(other.m_public_key)) != EqualTo)
01626 return result;
01627 if ((result = m_modulus.Compare(other.m_modulus)) != EqualTo)
01628 return result;
01629 if ((result = m_base.Compare(other.m_base)) != EqualTo)
01630 return result;
01631 if ((result = m_weierstrassA.Compare(other.m_weierstrassA)) != EqualTo)
01632 return result;
01633 if ((result = m_weierstrassB.Compare(other.m_weierstrassB)) != EqualTo)
01634 return result;
01635
01636 return PASN_Sequence::Compare(other);
01637 }
01638
01639
01640 PINDEX H235_ECKASDH_eckasdhp::GetDataLength() const
01641 {
01642 PINDEX length = 0;
01643 length += m_public_key.GetObjectLength();
01644 length += m_modulus.GetObjectLength();
01645 length += m_base.GetObjectLength();
01646 length += m_weierstrassA.GetObjectLength();
01647 length += m_weierstrassB.GetObjectLength();
01648 return length;
01649 }
01650
01651
01652 BOOL H235_ECKASDH_eckasdhp::Decode(PASN_Stream & strm)
01653 {
01654 if (!PreambleDecode(strm))
01655 return FALSE;
01656
01657 if (!m_public_key.Decode(strm))
01658 return FALSE;
01659 if (!m_modulus.Decode(strm))
01660 return FALSE;
01661 if (!m_base.Decode(strm))
01662 return FALSE;
01663 if (!m_weierstrassA.Decode(strm))
01664 return FALSE;
01665 if (!m_weierstrassB.Decode(strm))
01666 return FALSE;
01667
01668 return UnknownExtensionsDecode(strm);
01669 }
01670
01671
01672 void H235_ECKASDH_eckasdhp::Encode(PASN_Stream & strm) const
01673 {
01674 PreambleEncode(strm);
01675
01676 m_public_key.Encode(strm);
01677 m_modulus.Encode(strm);
01678 m_base.Encode(strm);
01679 m_weierstrassA.Encode(strm);
01680 m_weierstrassB.Encode(strm);
01681
01682 UnknownExtensionsEncode(strm);
01683 }
01684
01685
01686 PObject * H235_ECKASDH_eckasdhp::Clone() const
01687 {
01688 #ifndef PASN_LEANANDMEAN
01689 PAssert(IsClass(H235_ECKASDH_eckasdhp::Class()), PInvalidCast);
01690 #endif
01691 return new H235_ECKASDH_eckasdhp(*this);
01692 }
01693
01694
01695
01696
01697
01698
01699 H235_ECKASDH_eckasdh2::H235_ECKASDH_eckasdh2(unsigned tag, PASN_Object::TagClass tagClass)
01700 : PASN_Sequence(tag, tagClass, 0, FALSE, 0)
01701 {
01702 m_fieldSize.SetConstraints(PASN_Object::FixedConstraint, 0, 511);
01703 m_weierstrassA.SetConstraints(PASN_Object::FixedConstraint, 0, 511);
01704 m_weierstrassB.SetConstraints(PASN_Object::FixedConstraint, 0, 511);
01705 }
01706
01707
01708 #ifndef PASN_NOPRINTON
01709 void H235_ECKASDH_eckasdh2::PrintOn(ostream & strm) const
01710 {
01711 int indent = strm.precision() + 2;
01712 strm << "{\n";
01713 strm << setw(indent+13) << "public_key = " << setprecision(indent) << m_public_key << '\n';
01714 strm << setw(indent+12) << "fieldSize = " << setprecision(indent) << m_fieldSize << '\n';
01715 strm << setw(indent+7) << "base = " << setprecision(indent) << m_base << '\n';
01716 strm << setw(indent+15) << "weierstrassA = " << setprecision(indent) << m_weierstrassA << '\n';
01717 strm << setw(indent+15) << "weierstrassB = " << setprecision(indent) << m_weierstrassB << '\n';
01718 strm << setw(indent-1) << setprecision(indent-2) << "}";
01719 }
01720 #endif
01721
01722
01723 PObject::Comparison H235_ECKASDH_eckasdh2::Compare(const PObject & obj) const
01724 {
01725 #ifndef PASN_LEANANDMEAN
01726 PAssert(PIsDescendant(&obj, H235_ECKASDH_eckasdh2), PInvalidCast);
01727 #endif
01728 const H235_ECKASDH_eckasdh2 & other = (const H235_ECKASDH_eckasdh2 &)obj;
01729
01730 Comparison result;
01731
01732 if ((result = m_public_key.Compare(other.m_public_key)) != EqualTo)
01733 return result;
01734 if ((result = m_fieldSize.Compare(other.m_fieldSize)) != EqualTo)
01735 return result;
01736 if ((result = m_base.Compare(other.m_base)) != EqualTo)
01737 return result;
01738 if ((result = m_weierstrassA.Compare(other.m_weierstrassA)) != EqualTo)
01739 return result;
01740 if ((result = m_weierstrassB.Compare(other.m_weierstrassB)) != EqualTo)
01741 return result;
01742
01743 return PASN_Sequence::Compare(other);
01744 }
01745
01746
01747 PINDEX H235_ECKASDH_eckasdh2::GetDataLength() const
01748 {
01749 PINDEX length = 0;
01750 length += m_public_key.GetObjectLength();
01751 length += m_fieldSize.GetObjectLength();
01752 length += m_base.GetObjectLength();
01753 length += m_weierstrassA.GetObjectLength();
01754 length += m_weierstrassB.GetObjectLength();
01755 return length;
01756 }
01757
01758
01759 BOOL H235_ECKASDH_eckasdh2::Decode(PASN_Stream & strm)
01760 {
01761 if (!PreambleDecode(strm))
01762 return FALSE;
01763
01764 if (!m_public_key.Decode(strm))
01765 return FALSE;
01766 if (!m_fieldSize.Decode(strm))
01767 return FALSE;
01768 if (!m_base.Decode(strm))
01769 return FALSE;
01770 if (!m_weierstrassA.Decode(strm))
01771 return FALSE;
01772 if (!m_weierstrassB.Decode(strm))
01773 return FALSE;
01774
01775 return UnknownExtensionsDecode(strm);
01776 }
01777
01778
01779 void H235_ECKASDH_eckasdh2::Encode(PASN_Stream & strm) const
01780 {
01781 PreambleEncode(strm);
01782
01783 m_public_key.Encode(strm);
01784 m_fieldSize.Encode(strm);
01785 m_base.Encode(strm);
01786 m_weierstrassA.Encode(strm);
01787 m_weierstrassB.Encode(strm);
01788
01789 UnknownExtensionsEncode(strm);
01790 }
01791
01792
01793 PObject * H235_ECKASDH_eckasdh2::Clone() const
01794 {
01795 #ifndef PASN_LEANANDMEAN
01796 PAssert(IsClass(H235_ECKASDH_eckasdh2::Class()), PInvalidCast);
01797 #endif
01798 return new H235_ECKASDH_eckasdh2(*this);
01799 }
01800
01801
01802
01803
01804
01805
01806 H235_ArrayOf_ProfileElement::H235_ArrayOf_ProfileElement(unsigned tag, PASN_Object::TagClass tagClass)
01807 : PASN_Array(tag, tagClass)
01808 {
01809 }
01810
01811
01812 PASN_Object * H235_ArrayOf_ProfileElement::CreateObject() const
01813 {
01814 return new H235_ProfileElement;
01815 }
01816
01817
01818 H235_ProfileElement & H235_ArrayOf_ProfileElement::operator[](PINDEX i) const
01819 {
01820 return (H235_ProfileElement &)array[i];
01821 }
01822
01823
01824 PObject * H235_ArrayOf_ProfileElement::Clone() const
01825 {
01826 #ifndef PASN_LEANANDMEAN
01827 PAssert(IsClass(H235_ArrayOf_ProfileElement::Class()), PInvalidCast);
01828 #endif
01829 return new H235_ArrayOf_ProfileElement(*this);
01830 }
01831
01832
01833
01834
01835
01836
01837 H235_ProfileElement::H235_ProfileElement(unsigned tag, PASN_Object::TagClass tagClass)
01838 : PASN_Sequence(tag, tagClass, 2, TRUE, 0)
01839 {
01840 m_elementID.SetConstraints(PASN_Object::FixedConstraint, 0, 255);
01841 }
01842
01843
01844 #ifndef PASN_NOPRINTON
01845 void H235_ProfileElement::PrintOn(ostream & strm) const
01846 {
01847 int indent = strm.precision() + 2;
01848 strm << "{\n";
01849 strm << setw(indent+12) << "elementID = " << setprecision(indent) << m_elementID << '\n';
01850 if (HasOptionalField(e_paramS))
01851 strm << setw(indent+9) << "paramS = " << setprecision(indent) << m_paramS << '\n';
01852 if (HasOptionalField(e_element))
01853 strm << setw(indent+10) << "element = " << setprecision(indent) << m_element << '\n';
01854 strm << setw(indent-1) << setprecision(indent-2) << "}";
01855 }
01856 #endif
01857
01858
01859 PObject::Comparison H235_ProfileElement::Compare(const PObject & obj) const
01860 {
01861 #ifndef PASN_LEANANDMEAN
01862 PAssert(PIsDescendant(&obj, H235_ProfileElement), PInvalidCast);
01863 #endif
01864 const H235_ProfileElement & other = (const H235_ProfileElement &)obj;
01865
01866 Comparison result;
01867
01868 if ((result = m_elementID.Compare(other.m_elementID)) != EqualTo)
01869 return result;
01870 if ((result = m_paramS.Compare(other.m_paramS)) != EqualTo)
01871 return result;
01872 if ((result = m_element.Compare(other.m_element)) != EqualTo)
01873 return result;
01874
01875 return PASN_Sequence::Compare(other);
01876 }
01877
01878
01879 PINDEX H235_ProfileElement::GetDataLength() const
01880 {
01881 PINDEX length = 0;
01882 length += m_elementID.GetObjectLength();
01883 if (HasOptionalField(e_paramS))
01884 length += m_paramS.GetObjectLength();
01885 if (HasOptionalField(e_element))
01886 length += m_element.GetObjectLength();
01887 return length;
01888 }
01889
01890
01891 BOOL H235_ProfileElement::Decode(PASN_Stream & strm)
01892 {
01893 if (!PreambleDecode(strm))
01894 return FALSE;
01895
01896 if (!m_elementID.Decode(strm))
01897 return FALSE;
01898 if (HasOptionalField(e_paramS) && !m_paramS.Decode(strm))
01899 return FALSE;
01900 if (HasOptionalField(e_element) && !m_element.Decode(strm))
01901 return FALSE;
01902
01903 return UnknownExtensionsDecode(strm);
01904 }
01905
01906
01907 void H235_ProfileElement::Encode(PASN_Stream & strm) const
01908 {
01909 PreambleEncode(strm);
01910
01911 m_elementID.Encode(strm);
01912 if (HasOptionalField(e_paramS))
01913 m_paramS.Encode(strm);
01914 if (HasOptionalField(e_element))
01915 m_element.Encode(strm);
01916
01917 UnknownExtensionsEncode(strm);
01918 }
01919
01920
01921 PObject * H235_ProfileElement::Clone() const
01922 {
01923 #ifndef PASN_LEANANDMEAN
01924 PAssert(IsClass(H235_ProfileElement::Class()), PInvalidCast);
01925 #endif
01926 return new H235_ProfileElement(*this);
01927 }
01928
01929
01930
01931
01932
01933
01934 H235_KeySignedMaterial::H235_KeySignedMaterial(unsigned tag, PASN_Object::TagClass tagClass)
01935 : PASN_Sequence(tag, tagClass, 2, FALSE, 0)
01936 {
01937 }
01938
01939
01940 #ifndef PASN_NOPRINTON
01941 void H235_KeySignedMaterial::PrintOn(ostream & strm) const
01942 {
01943 int indent = strm.precision() + 2;
01944 strm << "{\n";
01945 strm << setw(indent+12) << "generalId = " << setprecision(indent) << m_generalId << '\n';
01946 strm << setw(indent+10) << "mrandom = " << setprecision(indent) << m_mrandom << '\n';
01947 if (HasOptionalField(e_srandom))
01948 strm << setw(indent+10) << "srandom = " << setprecision(indent) << m_srandom << '\n';
01949 if (HasOptionalField(e_timeStamp))
01950 strm << setw(indent+12) << "timeStamp = " << setprecision(indent) << m_timeStamp << '\n';
01951 strm << setw(indent+12) << "encrptval = " << setprecision(indent) << m_encrptval << '\n';
01952 strm << setw(indent-1) << setprecision(indent-2) << "}";
01953 }
01954 #endif
01955
01956
01957 PObject::Comparison H235_KeySignedMaterial::Compare(const PObject & obj) const
01958 {
01959 #ifndef PASN_LEANANDMEAN
01960 PAssert(PIsDescendant(&obj, H235_KeySignedMaterial), PInvalidCast);
01961 #endif
01962 const H235_KeySignedMaterial & other = (const H235_KeySignedMaterial &)obj;
01963
01964 Comparison result;
01965
01966 if ((result = m_generalId.Compare(other.m_generalId)) != EqualTo)
01967 return result;
01968 if ((result = m_mrandom.Compare(other.m_mrandom)) != EqualTo)
01969 return result;
01970 if ((result = m_srandom.Compare(other.m_srandom)) != EqualTo)
01971 return result;
01972 if ((result = m_timeStamp.Compare(other.m_timeStamp)) != EqualTo)
01973 return result;
01974 if ((result = m_encrptval.Compare(other.m_encrptval)) != EqualTo)
01975 return result;
01976
01977 return PASN_Sequence::Compare(other);
01978 }
01979
01980
01981 PINDEX H235_KeySignedMaterial::GetDataLength() const
01982 {
01983 PINDEX length = 0;
01984 length += m_generalId.GetObjectLength();
01985 length += m_mrandom.GetObjectLength();
01986 if (HasOptionalField(e_srandom))
01987 length += m_srandom.GetObjectLength();
01988 if (HasOptionalField(e_timeStamp))
01989 length += m_timeStamp.GetObjectLength();
01990 length += m_encrptval.GetObjectLength();
01991 return length;
01992 }
01993
01994
01995 BOOL H235_KeySignedMaterial::Decode(PASN_Stream & strm)
01996 {
01997 if (!PreambleDecode(strm))
01998 return FALSE;
01999
02000 if (!m_generalId.Decode(strm))
02001 return FALSE;
02002 if (!m_mrandom.Decode(strm))
02003 return FALSE;
02004 if (HasOptionalField(e_srandom) && !m_srandom.Decode(strm))
02005 return FALSE;
02006 if (HasOptionalField(e_timeStamp) && !m_timeStamp.Decode(strm))
02007 return FALSE;
02008 if (!m_encrptval.Decode(strm))
02009 return FALSE;
02010
02011 return UnknownExtensionsDecode(strm);
02012 }
02013
02014
02015 void H235_KeySignedMaterial::Encode(PASN_Stream & strm) const
02016 {
02017 PreambleEncode(strm);
02018
02019 m_generalId.Encode(strm);
02020 m_mrandom.Encode(strm);
02021 if (HasOptionalField(e_srandom))
02022 m_srandom.Encode(strm);
02023 if (HasOptionalField(e_timeStamp))
02024 m_timeStamp.Encode(strm);
02025 m_encrptval.Encode(strm);
02026
02027 UnknownExtensionsEncode(strm);
02028 }
02029
02030
02031 PObject * H235_KeySignedMaterial::Clone() const
02032 {
02033 #ifndef PASN_LEANANDMEAN
02034 PAssert(IsClass(H235_KeySignedMaterial::Class()), PInvalidCast);
02035 #endif
02036 return new H235_KeySignedMaterial(*this);
02037 }
02038
02039
02040
02041
02042
02043
02044 H235_EncodedKeySignedMaterial::H235_EncodedKeySignedMaterial(unsigned tag, PASN_Object::TagClass tagClass)
02045 : PASN_OctetString(tag, tagClass)
02046 {
02047 }
02048
02049
02050 PObject * H235_EncodedKeySignedMaterial::Clone() const
02051 {
02052 #ifndef PASN_LEANANDMEAN
02053 PAssert(IsClass(H235_EncodedKeySignedMaterial::Class()), PInvalidCast);
02054 #endif
02055 return new H235_EncodedKeySignedMaterial(*this);
02056 }
02057
02058
02059
02060
02061
02062
02063 H235_H235CertificateSignature::H235_H235CertificateSignature(unsigned tag, PASN_Object::TagClass tagClass)
02064 : PASN_Sequence(tag, tagClass, 1, TRUE, 0)
02065 {
02066 }
02067
02068
02069 #ifndef PASN_NOPRINTON
02070 void H235_H235CertificateSignature::PrintOn(ostream & strm) const
02071 {
02072 int indent = strm.precision() + 2;
02073 strm << "{\n";
02074 strm << setw(indent+14) << "certificate = " << setprecision(indent) << m_certificate << '\n';
02075 strm << setw(indent+17) << "responseRandom = " << setprecision(indent) << m_responseRandom << '\n';
02076 if (HasOptionalField(e_requesterRandom))
02077 strm << setw(indent+18) << "requesterRandom = " << setprecision(indent) << m_requesterRandom << '\n';
02078 strm << setw(indent+12) << "signature = " << setprecision(indent) << m_signature << '\n';
02079 strm << setw(indent-1) << setprecision(indent-2) << "}";
02080 }
02081 #endif
02082
02083
02084 PObject::Comparison H235_H235CertificateSignature::Compare(const PObject & obj) const
02085 {
02086 #ifndef PASN_LEANANDMEAN
02087 PAssert(PIsDescendant(&obj, H235_H235CertificateSignature), PInvalidCast);
02088 #endif
02089 const H235_H235CertificateSignature & other = (const H235_H235CertificateSignature &)obj;
02090
02091 Comparison result;
02092
02093 if ((result = m_certificate.Compare(other.m_certificate)) != EqualTo)
02094 return result;
02095 if ((result = m_responseRandom.Compare(other.m_responseRandom)) != EqualTo)
02096 return result;
02097 if ((result = m_requesterRandom.Compare(other.m_requesterRandom)) != EqualTo)
02098 return result;
02099 if ((result = m_signature.Compare(other.m_signature)) != EqualTo)
02100 return result;
02101
02102 return PASN_Sequence::Compare(other);
02103 }
02104
02105
02106 PINDEX H235_H235CertificateSignature::GetDataLength() const
02107 {
02108 PINDEX length = 0;
02109 length += m_certificate.GetObjectLength();
02110 length += m_responseRandom.GetObjectLength();
02111 if (HasOptionalField(e_requesterRandom))
02112 length += m_requesterRandom.GetObjectLength();
02113 length += m_signature.GetObjectLength();
02114 return length;
02115 }
02116
02117
02118 BOOL H235_H235CertificateSignature::Decode(PASN_Stream & strm)
02119 {
02120 if (!PreambleDecode(strm))
02121 return FALSE;
02122
02123 if (!m_certificate.Decode(strm))
02124 return FALSE;
02125 if (!m_responseRandom.Decode(strm))
02126 return FALSE;
02127 if (HasOptionalField(e_requesterRandom) && !m_requesterRandom.Decode(strm))
02128 return FALSE;
02129 if (!m_signature.Decode(strm))
02130 return FALSE;
02131
02132 return UnknownExtensionsDecode(strm);
02133 }
02134
02135
02136 void H235_H235CertificateSignature::Encode(PASN_Stream & strm) const
02137 {
02138 PreambleEncode(strm);
02139
02140 m_certificate.Encode(strm);
02141 m_responseRandom.Encode(strm);
02142 if (HasOptionalField(e_requesterRandom))
02143 m_requesterRandom.Encode(strm);
02144 m_signature.Encode(strm);
02145
02146 UnknownExtensionsEncode(strm);
02147 }
02148
02149
02150 PObject * H235_H235CertificateSignature::Clone() const
02151 {
02152 #ifndef PASN_LEANANDMEAN
02153 PAssert(IsClass(H235_H235CertificateSignature::Class()), PInvalidCast);
02154 #endif
02155 return new H235_H235CertificateSignature(*this);
02156 }
02157
02158
02159
02160 #ifndef PASN_NOPRINTON
02161 const static PASN_Names Names_H235_H235Key[]={
02162 {"secureChannel",0}
02163 ,{"sharedSecret",1}
02164 ,{"certProtectedKey",2}
02165 ,{"secureSharedSecret",3}
02166 };
02167 #endif
02168
02169
02170
02171
02172 H235_H235Key::H235_H235Key(unsigned tag, PASN_Object::TagClass tagClass)
02173 : PASN_Choice(tag, tagClass, 3, TRUE
02174 #ifndef PASN_NOPRINTON
02175 ,(const PASN_Names *)Names_H235_H235Key,4
02176 #endif
02177 )
02178 {
02179 }
02180
02181
02182 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
02183 H235_H235Key::operator H235_KeyMaterial &() const
02184 #else
02185 H235_H235Key::operator H235_KeyMaterial &()
02186 {
02187 #ifndef PASN_LEANANDMEAN
02188 PAssert(PIsDescendant(PAssertNULL(choice), H235_KeyMaterial), PInvalidCast);
02189 #endif
02190 return *(H235_KeyMaterial *)choice;
02191 }
02192
02193
02194 H235_H235Key::operator const H235_KeyMaterial &() const
02195 #endif
02196 {
02197 #ifndef PASN_LEANANDMEAN
02198 PAssert(PIsDescendant(PAssertNULL(choice), H235_KeyMaterial), PInvalidCast);
02199 #endif
02200 return *(H235_KeyMaterial *)choice;
02201 }
02202
02203
02204 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
02205 H235_H235Key::operator H235_ENCRYPTED<H235_EncodedKeySyncMaterial> &() const
02206 #else
02207 H235_H235Key::operator H235_ENCRYPTED<H235_EncodedKeySyncMaterial> &()
02208 {
02209 #ifndef PASN_LEANANDMEAN
02210 PAssert(PIsDescendant(PAssertNULL(choice), H235_ENCRYPTED<H235_EncodedKeySyncMaterial>), PInvalidCast);
02211 #endif
02212 return *(H235_ENCRYPTED<H235_EncodedKeySyncMaterial> *)choice;
02213 }
02214
02215
02216 H235_H235Key::operator const H235_ENCRYPTED<H235_EncodedKeySyncMaterial> &() const
02217 #endif
02218 {
02219 #ifndef PASN_LEANANDMEAN
02220 PAssert(PIsDescendant(PAssertNULL(choice), H235_ENCRYPTED<H235_EncodedKeySyncMaterial>), PInvalidCast);
02221 #endif
02222 return *(H235_ENCRYPTED<H235_EncodedKeySyncMaterial> *)choice;
02223 }
02224
02225
02226 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
02227 H235_H235Key::operator H235_SIGNED<H235_EncodedKeySignedMaterial> &() const
02228 #else
02229 H235_H235Key::operator H235_SIGNED<H235_EncodedKeySignedMaterial> &()
02230 {
02231 #ifndef PASN_LEANANDMEAN
02232 PAssert(PIsDescendant(PAssertNULL(choice), H235_SIGNED<H235_EncodedKeySignedMaterial>), PInvalidCast);
02233 #endif
02234 return *(H235_SIGNED<H235_EncodedKeySignedMaterial> *)choice;
02235 }
02236
02237
02238 H235_H235Key::operator const H235_SIGNED<H235_EncodedKeySignedMaterial> &() const
02239 #endif
02240 {
02241 #ifndef PASN_LEANANDMEAN
02242 PAssert(PIsDescendant(PAssertNULL(choice), H235_SIGNED<H235_EncodedKeySignedMaterial>), PInvalidCast);
02243 #endif
02244 return *(H235_SIGNED<H235_EncodedKeySignedMaterial> *)choice;
02245 }
02246
02247
02248 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
02249 H235_H235Key::operator H235_V3KeySyncMaterial &() const
02250 #else
02251 H235_H235Key::operator H235_V3KeySyncMaterial &()
02252 {
02253 #ifndef PASN_LEANANDMEAN
02254 PAssert(PIsDescendant(PAssertNULL(choice), H235_V3KeySyncMaterial), PInvalidCast);
02255 #endif
02256 return *(H235_V3KeySyncMaterial *)choice;
02257 }
02258
02259
02260 H235_H235Key::operator const H235_V3KeySyncMaterial &() const
02261 #endif
02262 {
02263 #ifndef PASN_LEANANDMEAN
02264 PAssert(PIsDescendant(PAssertNULL(choice), H235_V3KeySyncMaterial), PInvalidCast);
02265 #endif
02266 return *(H235_V3KeySyncMaterial *)choice;
02267 }
02268
02269
02270 BOOL H235_H235Key::CreateObject()
02271 {
02272 switch (tag) {
02273 case e_secureChannel :
02274 choice = new H235_KeyMaterial();
02275 return TRUE;
02276 case e_sharedSecret :
02277 choice = new H235_ENCRYPTED<H235_EncodedKeySyncMaterial>();
02278 return TRUE;
02279 case e_certProtectedKey :
02280 choice = new H235_SIGNED<H235_EncodedKeySignedMaterial>();
02281 return TRUE;
02282 case e_secureSharedSecret :
02283 choice = new H235_V3KeySyncMaterial();
02284 return TRUE;
02285 }
02286
02287 choice = NULL;
02288 return FALSE;
02289 }
02290
02291
02292 PObject * H235_H235Key::Clone() const
02293 {
02294 #ifndef PASN_LEANANDMEAN
02295 PAssert(IsClass(H235_H235Key::Class()), PInvalidCast);
02296 #endif
02297 return new H235_H235Key(*this);
02298 }
02299
02300
02301
02302
02303
02304
02305 H235_ClearToken::H235_ClearToken(unsigned tag, PASN_Object::TagClass tagClass)
02306 : PASN_Sequence(tag, tagClass, 8, TRUE, 4)
02307 {
02308 }
02309
02310
02311 #ifndef PASN_NOPRINTON
02312 void H235_ClearToken::PrintOn(ostream & strm) const
02313 {
02314 int indent = strm.precision() + 2;
02315 strm << "{\n";
02316 strm << setw(indent+11) << "tokenOID = " << setprecision(indent) << m_tokenOID << '\n';
02317 if (HasOptionalField(e_timeStamp))
02318 strm << setw(indent+12) << "timeStamp = " << setprecision(indent) << m_timeStamp << '\n';
02319 if (HasOptionalField(e_password))
02320 strm << setw(indent+11) << "password = " << setprecision(indent) << m_password << '\n';
02321 if (HasOptionalField(e_dhkey))
02322 strm << setw(indent+8) << "dhkey = " << setprecision(indent) << m_dhkey << '\n';
02323 if (HasOptionalField(e_challenge))
02324 strm << setw(indent+12) << "challenge = " << setprecision(indent) << m_challenge << '\n';
02325 if (HasOptionalField(e_random))
02326 strm << setw(indent+9) << "random = " << setprecision(indent) << m_random << '\n';
02327 if (HasOptionalField(e_certificate))
02328 strm << setw(indent+14) << "certificate = " << setprecision(indent) << m_certificate << '\n';
02329 if (HasOptionalField(e_generalID))
02330 strm << setw(indent+12) << "generalID = " << setprecision(indent) << m_generalID << '\n';
02331 if (HasOptionalField(e_nonStandard))
02332 strm << setw(indent+14) << "nonStandard = " << setprecision(indent) << m_nonStandard << '\n';
02333 if (HasOptionalField(e_eckasdhkey))
02334 strm << setw(indent+13) << "eckasdhkey = " << setprecision(indent) << m_eckasdhkey << '\n';
02335 if (HasOptionalField(e_sendersID))
02336 strm << setw(indent+12) << "sendersID = " << setprecision(indent) << m_sendersID << '\n';
02337 if (HasOptionalField(e_h235Key))
02338 strm << setw(indent+10) << "h235Key = " << setprecision(indent) << m_h235Key << '\n';
02339 if (HasOptionalField(e_profileInfo))
02340 strm << setw(indent+14) << "profileInfo = " << setprecision(indent) << m_profileInfo << '\n';
02341 strm << setw(indent-1) << setprecision(indent-2) << "}";
02342 }
02343 #endif
02344
02345
02346 PObject::Comparison H235_ClearToken::Compare(const PObject & obj) const
02347 {
02348 #ifndef PASN_LEANANDMEAN
02349 PAssert(PIsDescendant(&obj, H235_ClearToken), PInvalidCast);
02350 #endif
02351 const H235_ClearToken & other = (const H235_ClearToken &)obj;
02352
02353 Comparison result;
02354
02355 if ((result = m_tokenOID.Compare(other.m_tokenOID)) != EqualTo)
02356 return result;
02357 if ((result = m_timeStamp.Compare(other.m_timeStamp)) != EqualTo)
02358 return result;
02359 if ((result = m_password.Compare(other.m_password)) != EqualTo)
02360 return result;
02361 if ((result = m_dhkey.Compare(other.m_dhkey)) != EqualTo)
02362 return result;
02363 if ((result = m_challenge.Compare(other.m_challenge)) != EqualTo)
02364 return result;
02365 if ((result = m_random.Compare(other.m_random)) != EqualTo)
02366 return result;
02367 if ((result = m_certificate.Compare(other.m_certificate)) != EqualTo)
02368 return result;
02369 if ((result = m_generalID.Compare(other.m_generalID)) != EqualTo)
02370 return result;
02371 if ((result = m_nonStandard.Compare(other.m_nonStandard)) != EqualTo)
02372 return result;
02373
02374 return PASN_Sequence::Compare(other);
02375 }
02376
02377
02378 PINDEX H235_ClearToken::GetDataLength() const
02379 {
02380 PINDEX length = 0;
02381 length += m_tokenOID.GetObjectLength();
02382 if (HasOptionalField(e_timeStamp))
02383 length += m_timeStamp.GetObjectLength();
02384 if (HasOptionalField(e_password))
02385 length += m_password.GetObjectLength();
02386 if (HasOptionalField(e_dhkey))
02387 length += m_dhkey.GetObjectLength();
02388 if (HasOptionalField(e_challenge))
02389 length += m_challenge.GetObjectLength();
02390 if (HasOptionalField(e_random))
02391 length += m_random.GetObjectLength();
02392 if (HasOptionalField(e_certificate))
02393 length += m_certificate.GetObjectLength();
02394 if (HasOptionalField(e_generalID))
02395 length += m_generalID.GetObjectLength();
02396 if (HasOptionalField(e_nonStandard))
02397 length += m_nonStandard.GetObjectLength();
02398 return length;
02399 }
02400
02401
02402 BOOL H235_ClearToken::Decode(PASN_Stream & strm)
02403 {
02404 if (!PreambleDecode(strm))
02405 return FALSE;
02406
02407 if (!m_tokenOID.Decode(strm))
02408 return FALSE;
02409 if (HasOptionalField(e_timeStamp) && !m_timeStamp.Decode(strm))
02410 return FALSE;
02411 if (HasOptionalField(e_password) && !m_password.Decode(strm))
02412 return FALSE;
02413 if (HasOptionalField(e_dhkey) && !m_dhkey.Decode(strm))
02414 return FALSE;
02415 if (HasOptionalField(e_challenge) && !m_challenge.Decode(strm))
02416 return FALSE;
02417 if (HasOptionalField(e_random) && !m_random.Decode(strm))
02418 return FALSE;
02419 if (HasOptionalField(e_certificate) && !m_certificate.Decode(strm))
02420 return FALSE;
02421 if (HasOptionalField(e_generalID) && !m_generalID.Decode(strm))
02422 return FALSE;
02423 if (HasOptionalField(e_nonStandard) && !m_nonStandard.Decode(strm))
02424 return FALSE;
02425 if (!KnownExtensionDecode(strm, e_eckasdhkey, m_eckasdhkey))
02426 return FALSE;
02427 if (!KnownExtensionDecode(strm, e_sendersID, m_sendersID))
02428 return FALSE;
02429 if (!KnownExtensionDecode(strm, e_h235Key, m_h235Key))
02430 return FALSE;
02431 if (!KnownExtensionDecode(strm, e_profileInfo, m_profileInfo))
02432 return FALSE;
02433
02434 return UnknownExtensionsDecode(strm);
02435 }
02436
02437
02438 void H235_ClearToken::Encode(PASN_Stream & strm) const
02439 {
02440 PreambleEncode(strm);
02441
02442 m_tokenOID.Encode(strm);
02443 if (HasOptionalField(e_timeStamp))
02444 m_timeStamp.Encode(strm);
02445 if (HasOptionalField(e_password))
02446 m_password.Encode(strm);
02447 if (HasOptionalField(e_dhkey))
02448 m_dhkey.Encode(strm);
02449 if (HasOptionalField(e_challenge))
02450 m_challenge.Encode(strm);
02451 if (HasOptionalField(e_random))
02452 m_random.Encode(strm);
02453 if (HasOptionalField(e_certificate))
02454 m_certificate.Encode(strm);
02455 if (HasOptionalField(e_generalID))
02456 m_generalID.Encode(strm);
02457 if (HasOptionalField(e_nonStandard))
02458 m_nonStandard.Encode(strm);
02459 KnownExtensionEncode(strm, e_eckasdhkey, m_eckasdhkey);
02460 KnownExtensionEncode(strm, e_sendersID, m_sendersID);
02461 KnownExtensionEncode(strm, e_h235Key, m_h235Key);
02462 KnownExtensionEncode(strm, e_profileInfo, m_profileInfo);
02463
02464 UnknownExtensionsEncode(strm);
02465 }
02466
02467
02468 PObject * H235_ClearToken::Clone() const
02469 {
02470 #ifndef PASN_LEANANDMEAN
02471 PAssert(IsClass(H235_ClearToken::Class()), PInvalidCast);
02472 #endif
02473 return new H235_ClearToken(*this);
02474 }
02475
02476
02477
02478
02479
02480
02481 H235_EncodedGeneralToken::H235_EncodedGeneralToken(unsigned tag, PASN_Object::TagClass tagClass)
02482 : PASN_OctetString(tag, tagClass)
02483 {
02484 }
02485
02486
02487 PObject * H235_EncodedGeneralToken::Clone() const
02488 {
02489 #ifndef PASN_LEANANDMEAN
02490 PAssert(IsClass(H235_EncodedGeneralToken::Class()), PInvalidCast);
02491 #endif
02492 return new H235_EncodedGeneralToken(*this);
02493 }
02494
02495
02496
02497
02498
02499
02500 H235_PwdCertToken::H235_PwdCertToken(unsigned tag, PASN_Object::TagClass tagClass)
02501 : H235_ClearToken(tag, tagClass)
02502 {
02503 IncludeOptionalField(e_generalID);
02504 IncludeOptionalField(e_timeStamp);
02505 }
02506
02507
02508 PObject * H235_PwdCertToken::Clone() const
02509 {
02510 #ifndef PASN_LEANANDMEAN
02511 PAssert(IsClass(H235_PwdCertToken::Class()), PInvalidCast);
02512 #endif
02513 return new H235_PwdCertToken(*this);
02514 }
02515
02516
02517
02518
02519
02520
02521 H235_EncodedPwdCertToken::H235_EncodedPwdCertToken(unsigned tag, PASN_Object::TagClass tagClass)
02522 : PASN_OctetString(tag, tagClass)
02523 {
02524 }
02525
02526
02527 PObject * H235_EncodedPwdCertToken::Clone() const
02528 {
02529 #ifndef PASN_LEANANDMEAN
02530 PAssert(IsClass(H235_EncodedPwdCertToken::Class()), PInvalidCast);
02531 #endif
02532 return new H235_EncodedPwdCertToken(*this);
02533 }
02534
02535
02536
02537 #ifndef PASN_NOPRINTON
02538 const static PASN_Names Names_H235_CryptoToken[]={
02539 {"cryptoEncryptedToken",0}
02540 ,{"cryptoSignedToken",1}
02541 ,{"cryptoHashedToken",2}
02542 ,{"cryptoPwdEncr",3}
02543 };
02544 #endif
02545
02546
02547
02548
02549 H235_CryptoToken::H235_CryptoToken(unsigned tag, PASN_Object::TagClass tagClass)
02550 : PASN_Choice(tag, tagClass, 4, TRUE
02551 #ifndef PASN_NOPRINTON
02552 ,(const PASN_Names *)Names_H235_CryptoToken,4
02553 #endif
02554 )
02555 {
02556 }
02557
02558
02559 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
02560 H235_CryptoToken::operator H235_CryptoToken_cryptoEncryptedToken &() const
02561 #else
02562 H235_CryptoToken::operator H235_CryptoToken_cryptoEncryptedToken &()
02563 {
02564 #ifndef PASN_LEANANDMEAN
02565 PAssert(PIsDescendant(PAssertNULL(choice), H235_CryptoToken_cryptoEncryptedToken), PInvalidCast);
02566 #endif
02567 return *(H235_CryptoToken_cryptoEncryptedToken *)choice;
02568 }
02569
02570
02571 H235_CryptoToken::operator const H235_CryptoToken_cryptoEncryptedToken &() const
02572 #endif
02573 {
02574 #ifndef PASN_LEANANDMEAN
02575 PAssert(PIsDescendant(PAssertNULL(choice), H235_CryptoToken_cryptoEncryptedToken), PInvalidCast);
02576 #endif
02577 return *(H235_CryptoToken_cryptoEncryptedToken *)choice;
02578 }
02579
02580
02581 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
02582 H235_CryptoToken::operator H235_CryptoToken_cryptoSignedToken &() const
02583 #else
02584 H235_CryptoToken::operator H235_CryptoToken_cryptoSignedToken &()
02585 {
02586 #ifndef PASN_LEANANDMEAN
02587 PAssert(PIsDescendant(PAssertNULL(choice), H235_CryptoToken_cryptoSignedToken), PInvalidCast);
02588 #endif
02589 return *(H235_CryptoToken_cryptoSignedToken *)choice;
02590 }
02591
02592
02593 H235_CryptoToken::operator const H235_CryptoToken_cryptoSignedToken &() const
02594 #endif
02595 {
02596 #ifndef PASN_LEANANDMEAN
02597 PAssert(PIsDescendant(PAssertNULL(choice), H235_CryptoToken_cryptoSignedToken), PInvalidCast);
02598 #endif
02599 return *(H235_CryptoToken_cryptoSignedToken *)choice;
02600 }
02601
02602
02603 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
02604 H235_CryptoToken::operator H235_CryptoToken_cryptoHashedToken &() const
02605 #else
02606 H235_CryptoToken::operator H235_CryptoToken_cryptoHashedToken &()
02607 {
02608 #ifndef PASN_LEANANDMEAN
02609 PAssert(PIsDescendant(PAssertNULL(choice), H235_CryptoToken_cryptoHashedToken), PInvalidCast);
02610 #endif
02611 return *(H235_CryptoToken_cryptoHashedToken *)choice;
02612 }
02613
02614
02615 H235_CryptoToken::operator const H235_CryptoToken_cryptoHashedToken &() const
02616 #endif
02617 {
02618 #ifndef PASN_LEANANDMEAN
02619 PAssert(PIsDescendant(PAssertNULL(choice), H235_CryptoToken_cryptoHashedToken), PInvalidCast);
02620 #endif
02621 return *(H235_CryptoToken_cryptoHashedToken *)choice;
02622 }
02623
02624
02625 #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
02626 H235_CryptoToken::operator H235_ENCRYPTED<H235_EncodedPwdCertToken> &() const
02627 #else
02628 H235_CryptoToken::operator H235_ENCRYPTED<H235_EncodedPwdCertToken> &()
02629 {
02630 #ifndef PASN_LEANANDMEAN
02631 PAssert(PIsDescendant(PAssertNULL(choice), H235_ENCRYPTED<H235_EncodedPwdCertToken>), PInvalidCast);
02632 #endif
02633 return *(H235_ENCRYPTED<H235_EncodedPwdCertToken> *)choice;
02634 }
02635
02636
02637 H235_CryptoToken::operator const H235_ENCRYPTED<H235_EncodedPwdCertToken> &() const
02638 #endif
02639 {
02640 #ifndef PASN_LEANANDMEAN
02641 PAssert(PIsDescendant(PAssertNULL(choice), H235_ENCRYPTED<H235_EncodedPwdCertToken>), PInvalidCast);
02642 #endif
02643 return *(H235_ENCRYPTED<H235_EncodedPwdCertToken> *)choice;
02644 }
02645
02646
02647 BOOL H235_CryptoToken::CreateObject()
02648 {
02649 switch (tag) {
02650 case e_cryptoEncryptedToken :
02651 choice = new H235_CryptoToken_cryptoEncryptedToken();
02652 return TRUE;
02653 case e_cryptoSignedToken :
02654 choice = new H235_CryptoToken_cryptoSignedToken();
02655 return TRUE;
02656 case e_cryptoHashedToken :
02657 choice = new H235_CryptoToken_cryptoHashedToken();
02658 return TRUE;
02659 case e_cryptoPwdEncr :
02660 choice = new H235_ENCRYPTED<H235_EncodedPwdCertToken>();
02661 return TRUE;
02662 }
02663
02664 choice = NULL;
02665 return FALSE;
02666 }
02667
02668
02669 PObject * H235_CryptoToken::Clone() const
02670 {
02671 #ifndef PASN_LEANANDMEAN
02672 PAssert(IsClass(H235_CryptoToken::Class()), PInvalidCast);
02673 #endif
02674 return new H235_CryptoToken(*this);
02675 }
02676
02677
02678
02679
02680
02681
02682 H235_CryptoToken_cryptoEncryptedToken::H235_CryptoToken_cryptoEncryptedToken(unsigned tag, PASN_Object::TagClass tagClass)
02683 : PASN_Sequence(tag, tagClass, 0, FALSE, 0)
02684 {
02685 }
02686
02687
02688 #ifndef PASN_NOPRINTON
02689 void H235_CryptoToken_cryptoEncryptedToken::PrintOn(ostream & strm) const
02690 {
02691 int indent = strm.precision() + 2;
02692 strm << "{\n";
02693 strm << setw(indent+11) << "tokenOID = " << setprecision(indent) << m_tokenOID << '\n';
02694 strm << setw(indent+8) << "token = " << setprecision(indent) << m_token << '\n';
02695 strm << setw(indent-1) << setprecision(indent-2) << "}";
02696 }
02697 #endif
02698
02699
02700 PObject::Comparison H235_CryptoToken_cryptoEncryptedToken::Compare(const PObject & obj) const
02701 {
02702 #ifndef PASN_LEANANDMEAN
02703 PAssert(PIsDescendant(&obj, H235_CryptoToken_cryptoEncryptedToken), PInvalidCast);
02704 #endif
02705 const H235_CryptoToken_cryptoEncryptedToken & other = (const H235_CryptoToken_cryptoEncryptedToken &)obj;
02706
02707 Comparison result;
02708
02709 if ((result = m_tokenOID.Compare(other.m_tokenOID)) != EqualTo)
02710 return result;
02711 if ((result = m_token.Compare(other.m_token)) != EqualTo)
02712 return result;
02713
02714 return PASN_Sequence::Compare(other);
02715 }
02716
02717
02718 PINDEX H235_CryptoToken_cryptoEncryptedToken::GetDataLength() const
02719 {
02720 PINDEX length = 0;
02721 length += m_tokenOID.GetObjectLength();
02722 length += m_token.GetObjectLength();
02723 return length;
02724 }
02725
02726
02727 BOOL H235_CryptoToken_cryptoEncryptedToken::Decode(PASN_Stream & strm)
02728 {
02729 if (!PreambleDecode(strm))
02730 return FALSE;
02731
02732 if (!m_tokenOID.Decode(strm))
02733 return FALSE;
02734 if (!m_token.Decode(strm))
02735 return FALSE;
02736
02737 return UnknownExtensionsDecode(strm);
02738 }
02739
02740
02741 void H235_CryptoToken_cryptoEncryptedToken::Encode(PASN_Stream & strm) const
02742 {
02743 PreambleEncode(strm);
02744
02745 m_tokenOID.Encode(strm);
02746 m_token.Encode(strm);
02747
02748 UnknownExtensionsEncode(strm);
02749 }
02750
02751
02752 PObject * H235_CryptoToken_cryptoEncryptedToken::Clone() const
02753 {
02754 #ifndef PASN_LEANANDMEAN
02755 PAssert(IsClass(H235_CryptoToken_cryptoEncryptedToken::Class()), PInvalidCast);
02756 #endif
02757 return new H235_CryptoToken_cryptoEncryptedToken(*this);
02758 }
02759
02760
02761
02762
02763
02764
02765 H235_CryptoToken_cryptoSignedToken::H235_CryptoToken_cryptoSignedToken(unsigned tag, PASN_Object::TagClass tagClass)
02766 : PASN_Sequence(tag, tagClass, 0, FALSE, 0)
02767 {
02768 }
02769
02770
02771 #ifndef PASN_NOPRINTON
02772 void H235_CryptoToken_cryptoSignedToken::PrintOn(ostream & strm) const
02773 {
02774 int indent = strm.precision() + 2;
02775 strm << "{\n";
02776 strm << setw(indent+11) << "tokenOID = " << setprecision(indent) << m_tokenOID << '\n';
02777 strm << setw(indent+8) << "token = " << setprecision(indent) << m_token << '\n';
02778 strm << setw(indent-1) << setprecision(indent-2) << "}";
02779 }
02780 #endif
02781
02782
02783 PObject::Comparison H235_CryptoToken_cryptoSignedToken::Compare(const PObject & obj) const
02784 {
02785 #ifndef PASN_LEANANDMEAN
02786 PAssert(PIsDescendant(&obj, H235_CryptoToken_cryptoSignedToken), PInvalidCast);
02787 #endif
02788 const H235_CryptoToken_cryptoSignedToken & other = (const H235_CryptoToken_cryptoSignedToken &)obj;
02789
02790 Comparison result;
02791
02792 if ((result = m_tokenOID.Compare(other.m_tokenOID)) != EqualTo)
02793 return result;
02794 if ((result = m_token.Compare(other.m_token)) != EqualTo)
02795 return result;
02796
02797 return PASN_Sequence::Compare(other);
02798 }
02799
02800
02801 PINDEX H235_CryptoToken_cryptoSignedToken::GetDataLength() const
02802 {
02803 PINDEX length = 0;
02804 length += m_tokenOID.GetObjectLength();
02805 length += m_token.GetObjectLength();
02806 return length;
02807 }
02808
02809
02810 BOOL H235_CryptoToken_cryptoSignedToken::Decode(PASN_Stream & strm)
02811 {
02812 if (!PreambleDecode(strm))
02813 return FALSE;
02814
02815 if (!m_tokenOID.Decode(strm))
02816 return FALSE;
02817 if (!m_token.Decode(strm))
02818 return FALSE;
02819
02820 return UnknownExtensionsDecode(strm);
02821 }
02822
02823
02824 void H235_CryptoToken_cryptoSignedToken::Encode(PASN_Stream & strm) const
02825 {
02826 PreambleEncode(strm);
02827
02828 m_tokenOID.Encode(strm);
02829 m_token.Encode(strm);
02830
02831 UnknownExtensionsEncode(strm);
02832 }
02833
02834
02835 PObject * H235_CryptoToken_cryptoSignedToken::Clone() const
02836 {
02837 #ifndef PASN_LEANANDMEAN
02838 PAssert(IsClass(H235_CryptoToken_cryptoSignedToken::Class()), PInvalidCast);
02839 #endif
02840 return new H235_CryptoToken_cryptoSignedToken(*this);
02841 }
02842
02843
02844
02845
02846
02847
02848 H235_CryptoToken_cryptoHashedToken::H235_CryptoToken_cryptoHashedToken(unsigned tag, PASN_Object::TagClass tagClass)
02849 : PASN_Sequence(tag, tagClass, 0, FALSE, 0)
02850 {
02851 }
02852
02853
02854 #ifndef PASN_NOPRINTON
02855 void H235_CryptoToken_cryptoHashedToken::PrintOn(ostream & strm) const
02856 {
02857 int indent = strm.precision() + 2;
02858 strm << "{\n";
02859 strm << setw(indent+11) << "tokenOID = " << setprecision(indent) << m_tokenOID << '\n';
02860 strm << setw(indent+13) << "hashedVals = " << setprecision(indent) << m_hashedVals << '\n';
02861 strm << setw(indent+8) << "token = " << setprecision(indent) << m_token << '\n';
02862 strm << setw(indent-1) << setprecision(indent-2) << "}";
02863 }
02864 #endif
02865
02866
02867 PObject::Comparison H235_CryptoToken_cryptoHashedToken::Compare(const PObject & obj) const
02868 {
02869 #ifndef PASN_LEANANDMEAN
02870 PAssert(PIsDescendant(&obj, H235_CryptoToken_cryptoHashedToken), PInvalidCast);
02871 #endif
02872 const H235_CryptoToken_cryptoHashedToken & other = (const H235_CryptoToken_cryptoHashedToken &)obj;
02873
02874 Comparison result;
02875
02876 if ((result = m_tokenOID.Compare(other.m_tokenOID)) != EqualTo)
02877 return result;
02878 if ((result = m_hashedVals.Compare(other.m_hashedVals)) != EqualTo)
02879 return result;
02880 if ((result = m_token.Compare(other.m_token)) != EqualTo)
02881 return result;
02882
02883 return PASN_Sequence::Compare(other);
02884 }
02885
02886
02887 PINDEX H235_CryptoToken_cryptoHashedToken::GetDataLength() const
02888 {
02889 PINDEX length = 0;
02890 length += m_tokenOID.GetObjectLength();
02891 length += m_hashedVals.GetObjectLength();
02892 length += m_token.GetObjectLength();
02893 return length;
02894 }
02895
02896
02897 BOOL H235_CryptoToken_cryptoHashedToken::Decode(PASN_Stream & strm)
02898 {
02899 if (!PreambleDecode(strm))
02900 return FALSE;
02901
02902 if (!m_tokenOID.Decode(strm))
02903 return FALSE;
02904 if (!m_hashedVals.Decode(strm))
02905 return FALSE;
02906 if (!m_token.Decode(strm))
02907 return FALSE;
02908
02909 return UnknownExtensionsDecode(strm);
02910 }
02911
02912
02913 void H235_CryptoToken_cryptoHashedToken::Encode(PASN_Stream & strm) const
02914 {
02915 PreambleEncode(strm);
02916
02917 m_tokenOID.Encode(strm);
02918 m_hashedVals.Encode(strm);
02919 m_token.Encode(strm);
02920
02921 UnknownExtensionsEncode(strm);
02922 }
02923
02924
02925 PObject * H235_CryptoToken_cryptoHashedToken::Clone() const
02926 {
02927 #ifndef PASN_LEANANDMEAN
02928 PAssert(IsClass(H235_CryptoToken_cryptoHashedToken::Class()), PInvalidCast);
02929 #endif
02930 return new H235_CryptoToken_cryptoHashedToken(*this);
02931 }
02932
02933
02934 #endif // if ! H323_DISABLE_H235
02935
02936
02937