2 * Copyright (C) 2009 Martin Willi
3 * Hochschule fuer Technik Rapperswil
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 /*******************************************************************************
19 * identification part enumeration test
20 ******************************************************************************/
24 enumerator_t
*enumerator
;
29 id
= identification_create_from_string("C=CH, O=strongSwan, CN=tester");
31 enumerator
= id
->create_part_enumerator(id
);
32 while (enumerator
->enumerate(enumerator
, &part
, &data
))
37 if (part
!= ID_PART_RDN_C
||
38 !chunk_equals(data
, chunk_create("CH", 2)))
44 if (part
!= ID_PART_RDN_O
||
45 !chunk_equals(data
, chunk_create("strongSwan", 10)))
51 if (part
!= ID_PART_RDN_CN
||
52 !chunk_equals(data
, chunk_create("tester", 6)))
65 enumerator
->destroy(enumerator
);