test_LibItsSecurity_TypesAndValues.ttcn3 126 KB
Newer Older
module test_LibItsSecurity_TypesAndValues {
    
    // LibCommon
garciay's avatar
garciay committed
    import from LibItsCommon_Functions all;
    import from LibCommon_DataStrings all;
    
garciay's avatar
garciay committed
    // LibItsCommon
    import from LibItsCommon_TypesAndValues all;
    import from LibItsCommon_Templates all;
    import from LibItsCommon_Functions all;
    
    // LibItsSecurity
    import from LibItsSecurity_TypesAndValues all;
garciay's avatar
garciay committed
    import from LibItsSecurity_Templates all;
    import from LibItsSecurity_Functions all;
    import from LibItsSecurity_Pixits all;
    
    // TestUnits
    import from test_CommonCodec all; 
    
    group LibItsSecurity_testCases {
        
        group securityAcPrimitives {
            
            /**
             * @desc Validate Security AcPrimitive
             */
            testcase tc_acEnableSecurity() runs on TCType system TCType {
                
                f_loadCertificates(PX_IUT_SEC_CONFIG_NAME);
                vc_location := {
                    22345,
                    54321,
                    '0000'O
                };
                
garciay's avatar
garciay committed
                test_PDU<AcSecPrimitive>(
                    m_acEnableSecurity(
garciay's avatar
garciay committed
                    ), 
garciay's avatar
garciay committed
                ); 
            }
            
        } // End of group securityAcPrimitives 
        
        group basicFormatElements {
            
            /**
             * @desc Validate PublicKey/EccPoint
             * @verdict Pass on success, Fail otherwise
             */
            testcase tc_PublicKey_eccPoint_01() runs on TCType system TCType {
                test_PDU<PublicKey>(
                    m_publicKey_eccPoint(
                        m_eccPointecdsa_nistp256_with_sha256_x_coordinate_only(
                            'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O
                        )
                    )
                );
            } // End of testcase tc_PublicKey_eccPoint_01
            
            /**
             * @desc Validate PublicKey/EccPoint
             * @verdict Pass on success, Fail otherwise
             */
            testcase tc_PublicKey_eccPoint_02() runs on TCType system TCType {
                test_PDU<PublicKey>(
                    m_publicKey_eccPoint(
                        m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                            'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O,
                            '639D5CB825989E92F0A77B31EF65DE5B3505C75FD7B12BA64DBA89897DCB4043'O
                        )
                    )
                );
            } // End of testcase tc_PublicKey_eccPoint_02
            
            /**
             * @desc Validate PublicKey/EccPoint
             * @verdict Pass on success, Fail otherwise
             */
            testcase tc_PublicKey_aesccm_01() runs on TCType system TCType {
                test_PDU<PublicKey>(
                    m_publicKey_aesccm(
                        m_aesccm(
                            m_eccPointecdsa_nistp256_with_sha256_x_coordinate_only(
                                'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O
                            )
                        )
                    )
                );
            } // End of testcase tc_PublicKey_aesccm_01
            
            /**
             * @desc Validate PublicKey/EccPoint
             * @verdict Pass on success, Fail otherwise
             */
            testcase tc_PublicKey_aesccm_02() runs on TCType system TCType {
                test_PDU<PublicKey>(
                    m_publicKey_aesccm(
                        m_aesccm(
                            m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O,
                                '639D5CB825989E92F0A77B31EF65DE5B3505C75FD7B12BA64DBA89897DCB4043'O
                            )
                        )
                    )
                );
            } // End of testcase tc_PublicKey_aesccm_02
            
            /**
             * @desc Validate EcdsaSignature
             * @remark The EccPointType of R shall be set to x_coordinate_only
             * @verdict Pass on success, Fail otherwise
             */
            testcase tc_EcdsaSignature_01() runs on TCType system TCType {
                test_PDU<EcdsaSignature>(
                    m_ecdsaSignature(
                        m_eccPointecdsa_nistp256_with_sha256_x_coordinate_only(
                            'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O
                        ),
                        '00008A08AE40EC69030C056E48152F7A14F72BA4F305C2E6AA31997ABE93E7FD'O
                    )
                );
            } // End of testcase tc_EcdsaSignature_01
            
            testcase tc_Duration_01() runs on TCType system TCType {
                test_PDU<Duration>(
                     m_duration_in_seconds(
                          456
                    )
                );
            } // End of testcase tc_Duration_01
            
            /**
             * @desc Validate Time64WithStandardDeviation
             * @verdict Pass on success, Fail otherwise
             */
            testcase tc_Time64WithStandardDeviation_01() runs on TCType system TCType {
                test_PDU<Time64WithStandardDeviation>(
                    m_time64WithStandardDeviation(
                        oct2int('FACEB00C'O),
                        128
                    )
                );
            } // End of testcase tc_Time64WithStandardDeviation_01
            
            /**
             * @desc Validate TwoDLocation
             * @verdict Pass on success, Fail otherwise
             */
            testcase tc_TwoDLocation_01() runs on TCType system TCType {
                test_PDU<TwoDLocation>(
                    m_twoDLocation(
                        22345,
                        54321
                    )
                );
            } // End of testcase tc_TwoDLocation_01
            
            /**
             * @desc Validate ThreeDLocation
             * @verdict Pass on success, Fail otherwise
             */
            testcase tc_ThreeDLocation_01() runs on TCType system TCType {
                test_PDU<ThreeDLocation>(
                    m_threeDLocation(
                        12345,
                        54321,
                        int2oct(1024, 2)
                    )
                );
            } // End of testcase tc_ThreeDLocation_01
            
            testcase tc_EncryptionParameters_01() runs on TCType system TCType {
                test_PDU<EncryptionParameters>(
                    m_encryptionParameters_aes_128_ccm(
                        '010203040506070808080808'O
                    )
                );
            } // End of testcase tc_EncryptionParameters_01
            
            testcase tc_GeographicRegion_01() runs on TCType system TCType {
                test_PDU<GeographicRegion>(
                    m_geographicRegion_circle(
                        m_twoDLocation(
                            22345,
                            54321
                        ),
                        2550
                    )
                );
            } // End of testcase tc_EncryptionParameters_01
            
            testcase tc_GeographicRegion_02() runs on TCType system TCType {
                test_PDU<GeographicRegion>(
                    m_geographicRegion_rectangle(
                        m_twoDLocation(
                            22345,
                            54321
                        ),
                        m_twoDLocation(
                            2*22345,
                            2*54321
                        )
                    )
                );
            } // End of testcase tc_EncryptionParameters_02
            
            testcase tc_GeographicRegion_03() runs on TCType system TCType {
                test_PDU<GeographicRegion>(
                    m_geographicRegion_polygonial(
                        {
                            m_twoDLocation(
                                22345,
                                54321
                            ),
                            m_twoDLocation(
                                2*22345,
                                2*54321
                            )
                        }
                    )
                );
            } // End of testcase tc_EncryptionParameters_03
            
            template (value) IdentifiedRegion m_identifiedRegion_01 := {
                region_dictionary := e_un_stats,
                region_identifier := 3,
                local_region      := 10
            } // End of template m_identifiedRegion_01
            
            template (value) IdentifiedRegion m_identifiedRegion_02 := {
                region_dictionary := e_iso_3166_1,
                region_identifier := 4567,
                local_region      := 78
            } // End of template m_identifiedRegion_01
            
            template (value) IdentifiedRegion m_identifiedRegion_03 := {
                region_dictionary := e_iso_3166_1,
                region_identifier := 2,
                local_region      := 2184
            } // End of template m_identifiedRegion_03
            
            template (value) IdentifiedRegion m_identifiedRegion_04 := {
                region_dictionary := e_iso_3166_1,
                region_identifier := 2,
                local_region      := 9 * 2184
            } // End of template m_identifiedRegion_04
            
            testcase tc_GeographicRegion_04() runs on TCType system TCType {
                test_PDU<GeographicRegion>(
                    m_geographicRegion_identifiedRegion(
                        m_identifiedRegion_01
                    )
                );
            } // End of testcase tc_GeographicRegion_04
            
            testcase tc_GeographicRegion_05() runs on TCType system TCType {
                test_PDU<GeographicRegion>(
                    m_geographicRegion_identifiedRegion(
                        m_identifiedRegion_02
                    )
                );
            } // End of testcase tc_GeographicRegion_05
            
            testcase tc_GeographicRegion_06() runs on TCType system TCType {
                test_PDU<GeographicRegion>(
                    m_geographicRegion_identifiedRegion(
                        m_identifiedRegion_03
                    )
                );
            } // End of testcase tc_GeographicRegion_06
            
            testcase tc_GeographicRegion_07() runs on TCType system TCType {
                test_PDU<GeographicRegion>(
                    m_geographicRegion_identifiedRegion(
                        m_identifiedRegion_04
                    )
                );
            } // End of testcase tc_GeographicRegion_07
            
            testcase tc_GeographicRegion_08() runs on TCType system TCType {
                test_PDU<GeographicRegion>(
                    m_geographicRegion_nonce
                );
            } // End of testcase tc_GeographicRegion_08
            
        } // End of group basicFormatElements
            
        group securityHeader {
            
            testcase tc_Payload_01() runs on TCType system TCType {
                test_PDU<SecPayload>(
                    m_payload_signed_external
                );
            } // End of testcase tc_Payload_01
            
            testcase tc_Payload_02() runs on TCType system TCType {
                test_PDU<SecPayload>(
                    m_payload_unsecured('DEEDBEEF'O)
                );
            } // End of testcase tc_Payload_02
            
            testcase tc_Payload_03() runs on TCType system TCType {
                test_PDU<SecPayload>(
                    m_payload_signed('DEEDBEEF'O)
                );
            } // End of testcase tc_Payload_03
            
            testcase tc_Payload_04() runs on TCType system TCType {
                test_PDU<SecPayload>(
                    m_payload_encrypted('DEEDBEEF'O)
                );
            } // End of testcase tc_Payload_04
            
            testcase tc_Payload_05() runs on TCType system TCType {
                test_PDU<SecPayload>(
                    m_payload_signed_and_encrypted('DEEDBEEF'O)
                );
            } // End of testcase tc_Payload_05
            
            testcase tc_HeaderField_01() runs on TCType system TCType {
                test_PDU<HeaderField>(
                    m_header_field_generation_time(
                        123456789
                    )
                );
            } // End of testcase tc_HeaderField_01
            
            testcase tc_HeaderField_02() runs on TCType system TCType {
                test_PDU<HeaderField>(
                    m_header_field_generation_time_with_standard_deviation(
                        m_time64WithStandardDeviation(
                            oct2int('FACEB00C'O),
                            128
                        )
                    )
                );
            } // End of testcase tc_HeaderField_02
            
            testcase tc_HeaderField_03() runs on TCType system TCType {
                test_PDU<HeaderField>(
                    m_header_field_expiry_time(
                        3600
                    )
                );
            } // End of testcase tc_HeaderField_03
            
            testcase tc_HeaderField_04() runs on TCType system TCType {
                test_PDU<HeaderField>(
                    m_header_field_generation_location(
                        m_threeDLocation(
                            -12345,
                            -54321,
                            int2oct(1024, 2)
                        )
                    )
                );
            } // End of testcase tc_HeaderField_04
            
            testcase tc_HeaderField_05() runs on TCType system TCType {
                test_PDU<HeaderField>(
                    m_header_field_unrecognised_certificate(
                        '060708'O
                    )
                );
            } // End of testcase tc_HeaderField_05
            
            testcase tc_HeaderField_06() runs on TCType system TCType {
                test_PDU<HeaderField>(
                    mw_header_field_its_aid(36)
                );
            } // End of testcase tc_HeaderField_06
            
            testcase tc_HeaderField_07() runs on TCType system TCType {
                test_PDU<HeaderField>(
                    mw_header_field_its_aid(37)
379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809
                );
            } // End of testcase tc_HeaderField_07
            
            testcase tc_HeaderField_08() runs on TCType system TCType {
                test_PDU<HeaderField>(
                    m_header_field_its_aid(
                        12345
                    )
                );
            } // End of testcase tc_HeaderField_08
            
            testcase tc_HeaderField_09() runs on TCType system TCType {
                test_PDU<HeaderField>(
                    m_header_field_signer_info(
                        m_signerInfo_self
                    )
                );
            } // End of testcase tc_HeaderField_09
            
            testcase tc_HeaderField_10() runs on TCType system TCType {
                test_PDU<HeaderField>(
                    m_header_field_enc_params(
                        m_encryptionParameters_aes_128_ccm(
                            '010203040506070808080808'O
                        )
                    )
                );
            } // End of testcase tc_HeaderField_10
            
            testcase tc_TrailerField_01() runs on TCType system TCType {
                test_PDU<TrailerField>(
                    m_trailer_field_signature(
                        m_signature(
                            m_ecdsaSignature(
                                m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                    'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O,
                                    '639D5CB825989E92F0A77B31EF65DE5B3505C75FD7B12BA64DBA89897DCB4043'O
                                ),
                                '00008A08AE40EC69030C056E48152F7A14F72BA4F305C2E6AA31997ABE93E7FD'O
                            )
                        )
                    )
                );
            } // End of testcase tc_TrailerField_01
            
            testcase tc_SecuredMessage_01() runs on TCType system TCType {
                test_PDU<SecuredMessage>(
                    m_secureMessage_dummy
                );
            } // End of testcase tc_SecuredMessage_01
            
            template (value) SecuredMessage m_secureMessageCAMs_01
            modifies m_secureMessage_dummy := {
                header_fields        := {
                    m_header_field_signer_info(
                        m_signerInfo_digest('0102030405060708'O)
                    ),
                    m_header_field_signer_info(
                        m_signerInfo_digest('1020304050607080'O)
                    )
                },
                payload_field := m_payload_signed('DEEDBEEF01'O),
                trailer_fields        := { 
                    m_trailer_field_signature(
                        m_signature(
                            m_ecdsaSignature(
                                m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                    'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O,
                                    '639D5CB825989E92F0A77B31EF65DE5B3505C75FD7B12BA64DBA89897DCB4043'O
                                ),
                                '00008A08AE40EC69030C056E48152F7A14F72BA4F305C2E6AA31997ABE93E7FD'O
                            )
                        )
                    )
                }
            } // End of template tc_SecuredMessage_01
            
            template (value) SecuredMessage m_secureMessage_02
            modifies m_secureMessage_dummy := {
                header_fields        := {
                    m_header_field_signer_info(
                        m_signerInfo_digest('0102030405060708'O)
                    ),
                    m_header_field_signer_info(
                        m_signerInfo_digest('1020304050607080'O)
                    )
                },
                payload_field := m_payload_signed('DEEDBEEF01'O),
                trailer_fields        := { 
                    m_trailer_field_signature(
                        m_signature(
                            m_ecdsaSignature(
                                m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                    'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O,
                                    '639D5CB825989E92F0A77B31EF65DE5B3505C75FD7B12BA64DBA89897DCB4043'O
                                ),
                                '00008A08AE40EC69030C056E48152F7A14F72BA4F305C2E6AA31997ABE93E7FD'O
                            )
                        )
                    ),
                    m_trailer_field_signature(
                        m_signature(
                            m_ecdsaSignature(
                                m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                    '639D5CB825989E92F0A77B31EF65DE5B3505C75FD7B12BA64DBA89897DCB4043'O,
                                    '00008A08AE40EC69030C056E48152F7A14F72BA4F305C2E6AA31997ABE93E7FD'O
                                ),
                                'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O
                            )
                        )
                    )
                }
            } // End of template m_secureMessage_02
            
            template (value) SecuredMessage m_secureMessageCAMs
            modifies m_secureMessage_dummy := {
                header_fields        := {
                    m_header_field_signer_info(
                        m_signerInfo_digest('0102030405060708'O)
                    ),
                    m_header_field_generation_time(1000 * f_getCurrentTime()),
                    m_header_field_its_aid_CAM
                },
                payload_field := m_payload_signed('DEEDBEEF01'O),
                trailer_fields        := { 
                    m_trailer_field_signature(
                        m_signature(
                            m_ecdsaSignature(
                                m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                    'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O,
                                    '639D5CB825989E92F0A77B31EF65DE5B3505C75FD7B12BA64DBA89897DCB4043'O
                                ),
                                '00008A08AE40EC69030C056E48152F7A14F72BA4F305C2E6AA31997ABE93E7FD'O
                            )
                        )
                    ),
                    m_trailer_field_signature(
                        m_signature(
                            m_ecdsaSignature(
                                m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                    '639D5CB825989E92F0A77B31EF65DE5B3505C75FD7B12BA64DBA89897DCB4043'O,
                                    '00008A08AE40EC69030C056E48152F7A14F72BA4F305C2E6AA31997ABE93E7FD'O
                                ),
                                'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O
                            )
                        )
                    )
                }
            } // End of template m_secureMessageCAMs
            
            template (value) SecuredMessage m_secureMessageDENMs
            modifies m_secureMessage_dummy := {
                header_fields        := {
                    m_header_field_signer_info(
                        m_signerInfo_digest('0102030405060708'O)
                    ),
                    m_header_field_generation_time(1000 * f_getCurrentTime()),
                    m_header_field_generation_location(
                        m_threeDLocation(
                            12345,
                            54321,
                            int2oct(1024, 2)
                        )
                    ),
                    m_header_field_its_aid_DENM
                },
                payload_field := m_payload_signed('DEEDBEEF01'O),
                trailer_fields        := { 
                    m_trailer_field_signature(
                        m_signature(
                            m_ecdsaSignature(
                                m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                    'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O,
                                    '639D5CB825989E92F0A77B31EF65DE5B3505C75FD7B12BA64DBA89897DCB4043'O
                                ),
                                '00008A08AE40EC69030C056E48152F7A14F72BA4F305C2E6AA31997ABE93E7FD'O
                            )
                        )
                    ),
                    m_trailer_field_signature(
                        m_signature(
                            m_ecdsaSignature(
                                m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                    '639D5CB825989E92F0A77B31EF65DE5B3505C75FD7B12BA64DBA89897DCB4043'O,
                                    '00008A08AE40EC69030C056E48152F7A14F72BA4F305C2E6AA31997ABE93E7FD'O
                                ),
                                'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O
                            )
                        )
                    )
                }
            } // End of template m_secureMessageDENMs
            
            template (value) SecuredMessage m_secureMessageOthers
            modifies m_secureMessage_dummy := {
                header_fields        := {
                    m_header_field_signer_info(
                        m_signerInfo_digest('0102030405060708'O)
                    ),
                    m_header_field_generation_time(1000 * f_getCurrentTime()),
                    m_header_field_generation_location(
                        m_threeDLocation(
                            12345,
                            54321,
                            int2oct(1024, 2)
                        )
                    )
                },
                payload_field := m_payload_signed('DEEDBEEF01'O),
                trailer_fields        := { 
                    m_trailer_field_signature(
                        m_signature(
                            m_ecdsaSignature(
                                m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                    'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O,
                                    '639D5CB825989E92F0A77B31EF65DE5B3505C75FD7B12BA64DBA89897DCB4043'O
                                ),
                                '00008A08AE40EC69030C056E48152F7A14F72BA4F305C2E6AA31997ABE93E7FD'O
                            )
                        )
                    ),
                    m_trailer_field_signature(
                        m_signature(
                            m_ecdsaSignature(
                                m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                    '639D5CB825989E92F0A77B31EF65DE5B3505C75FD7B12BA64DBA89897DCB4043'O,
                                    '00008A08AE40EC69030C056E48152F7A14F72BA4F305C2E6AA31997ABE93E7FD'O
                                ),
                                'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O
                            )
                        )
                    )
                }
            } // End of template m_secureMessageOthers
            
            testcase tc_SecuredMessage_02() runs on TCType system TCType {
                test_PDU<SecuredMessage>(
                    m_secureMessage_02
                );
            } // End of testcase tc_SecuredMessage_02
            
            testcase tc_SecuredMessage_03() runs on TCType system TCType {
                test_PDU<SecuredMessage>(
                    m_secureMessageCAMs
                );
                
                if (match(valueof(m_secureMessageCAMs), mdw_securedMessage_CAMs) == true) {
                    setverdict(pass, "Basic");
                }
                if (match(valueof(m_secureMessageCAMs), mdw_securedMessage_CAMs(mw_header_field_signer_info_digest)) == true) {
                    setverdict(pass, "With digest");
                }
                if (match(valueof(m_secureMessageCAMs), mdw_securedMessage_CAMs(mw_header_field_signer_info_certificate)) == false) {
                    setverdict(pass, "With certificate mismatch");
                }
                if (match(valueof(m_secureMessageCAMs), mdw_securedMessage_DENMs) == true) {
                    setverdict(fail, "Shall not match with DENM template");
                    stop;
                }
                if (match(valueof(m_secureMessageCAMs), mdw_securedMessage_Others) == true) {
                    setverdict(fail, "Shall not match with Other template");
                    stop;
                }
            } // End of testcase tc_SecuredMessage_03
            
            testcase tc_SecuredMessage_04() runs on TCType system TCType {
                test_PDU<SecuredMessage>(
                    m_secureMessageDENMs
                );
                
                if (match(valueof(m_secureMessageDENMs), mdw_securedMessage_DENMs) == true) {
                    setverdict(pass, "Basic");
                }
                if (match(valueof(m_secureMessageDENMs), mdw_securedMessage_DENMs(mw_header_field_signer_info_digest)) == true) {
                    setverdict(pass, "With digest");
                }
                if (match(valueof(m_secureMessageDENMs), mdw_securedMessage_DENMs(mw_header_field_signer_info_certificate)) == false) {
                    setverdict(pass, "With certificate mismatch");
                }
                if (match(valueof(m_secureMessageDENMs), mdw_securedMessage_CAMs) == true) {
                    setverdict(fail, "Shall not match with CAM template");
                    stop;
                }
                if (match(valueof(m_secureMessageDENMs), mdw_securedMessage_Others) == true) {
                    setverdict(fail, "Shall not match with Other template");
                    stop;
                }
            } // End of testcase tc_SecuredMessage_04
            
            testcase tc_SecuredMessage_05() runs on TCType system TCType {
                test_PDU<SecuredMessage>(
                m_secureMessageOthers
                );
                
                if (match(valueof(m_secureMessageOthers), mdw_securedMessage_Others) == true) {
                    setverdict(pass, "Basic");
                }
                if (match(valueof(m_secureMessageOthers), mdw_securedMessage_Others(mw_header_field_signer_info_digest)) == true) {
                    setverdict(pass, "With digest");
                }
                if (match(valueof(m_secureMessageOthers), mdw_securedMessage_Others(mw_header_field_signer_info_certificate)) == false) {
                    setverdict(pass, "With certificate mismatch");
                }
                if (match(valueof(m_secureMessageOthers), mdw_securedMessage_CAMs) == true) {
                    setverdict(fail, "Shall not match with CAM template");
                    stop;
                }
                if (match(valueof(m_secureMessageOthers), mdw_securedMessage_CAMs) == true) {
                    setverdict(fail, "Shall not match with CAM template");
                    stop;
                }
                if (match(valueof(m_secureMessageOthers), mdw_securedMessage_DENMs) == true) {
                    setverdict(fail, "Shall not match with DENM template");
                    stop;
                }
            } // End of testcase tc_SecuredMessage_05
            
        } // End of group securityHeader
        
        group certificates {
            
            testcase tc_SubjectInfo_01() runs on TCType system TCType {
                test_PDU<SubjectInfo>(
                    m_subject_info_root_ca('DEADBEEF'O)
                );
            } // End of testcase tc_SubjectInfo_01
            
            testcase tc_SubjectInfo_02() runs on TCType system TCType {
                test_PDU<SubjectInfo>(
                    m_subject_info_revocation('DE5EA5ED'O)
                );
            } // End of testcase tc_SubjectInfo_02
            
            testcase tc_SubjectAttribute_01() runs on TCType system TCType {
                test_PDU<SubjectAttribute>(
                    m_subject_attribute_verification_key(
                        m_publicKey_eccPoint(
                            m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O,
                                '639D5CB825989E92F0A77B31EF65DE5B3505C75FD7B12BA64DBA89897DCB4043'O
                            )
                        )
                    )
                );
            } // End of testcase tc_SubjectAttribute_01
            
            testcase tc_SubjectAttribute_02() runs on TCType system TCType {
                test_PDU<SubjectAttribute>(
                    m_subject_attribute_encryption_key(
                        m_publicKey_eccPoint(
                            m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O,
                                '639D5CB825989E92F0A77B31EF65DE5B3505C75FD7B12BA64DBA89897DCB4043'O
                            )
                        )
                    )
                );
            } // End of testcase tc_SubjectAttribute_02
            
            testcase tc_SubjectAttribute_03() runs on TCType system TCType {
                test_PDU<SubjectAttribute>(
                    m_subject_attribute_reconstruction_value(
                        m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                            'D89D70110B4AB76904CBD27578420F0814380A5E4183F42AE602BE903EE606F8'O,
                            '639D5CB825989E92F0A77B31EF65DE5B3505C75FD7B12BA64DBA89897DCB4043'O
                        )
                    )
                );
            } // End of testcase tc_SubjectAttribute_03
            
            testcase tc_SubjectAttribute_04() runs on TCType system TCType {
                test_PDU<SubjectAttribute>(
                    m_subject_attribute_assurance_level(
                        m_subjectAssurance(
                            '101'B,
                            '11'B
                        )
                    )
                );
            } // End of testcase tc_SubjectAttribute_04
            
            testcase tc_SubjectAttribute_05() runs on TCType system TCType {
                test_PDU<SubjectAttribute>(
                    m_subject_attribute_its_aid_list(
                        {
                            9 * 2184,
                            7 * 2184,
                            5 * 2184,
                            3 * 2184,
                            2184
                        }
                    )
                );
            } // End of testcase tc_SubjectAttribute_05
            
            testcase tc_SubjectAttribute_06() runs on TCType system TCType {
                test_PDU<SubjectAttribute>(
                    m_subject_attribute_its_aid_ssp_list(
                        {
                            {
                                9 * 2184,
                                m_sspTest
                            },
                            {
                                7 * 2184,
                                m_sspTest
                            },
                            {
                                5 * 2184,
                                m_sspTest
                            },
                            {
                                3 * 2184,
                                m_sspTest
                            },
                            {
                                2184,
                                m_sspTest
                            }
                        }
                    ), 
                    true,
                    oct2bit('2115C04CC80100BBB80100AAA801009998010088880100'O)
                );
            } // End of testcase tc_SubjectAttribute_06
            
            testcase tc_SubjectAttribute_07() runs on TCType system TCType {
                test_PDU<SubjectAttribute>(
                    m_subject_attribute_its_aid_ssp_list(
                        {
                            {
                                {
                                    version := '00'O,
                                    sspContainer := omit
                                }
                            },
                            {
                                {
                                    version := '00'O,
                                    sspContainer := omit
                                }
                            }
                        }
                    ), 
                );
            } // End of testcase tc_SubjectAttribute_07
            
            testcase tc_SubjectAttribute_08() runs on TCType system TCType {
                test_PDU<SubjectAttribute>(
                    m_subject_attribute_its_aid_ssp_list(
                        {
                            {
                );
            } // End of testcase tc_SubjectAttribute_08
            
            testcase tc_SubjectAttribute_09() runs on TCType system TCType {
                test_PDU<SubjectAttribute>(
                    m_subject_attribute_its_aid_list(
                        { 
                            1631,
                            1632
                        }
                    ),
                );
            } // End of testcase tc_SubjectAttribute_09
            
            testcase tc_SubjectAttribute_10() runs on TCType system TCType {
                test_PDU<SubjectAttribute>(
                    m_subject_attribute_its_aid_ssp_list(
                        {
                            {
                                1631,
                                {
                                    '00'O,
                                    omit
                                }
                            },
                            {
                                1632,
                                {
                                    '00'O,
                                    omit
                                }
                            }
                        }
                    ), 
                );
            } // End of testcase tc_SubjectAttribute_10
            
            testcase tc_SubjectAssurance_01() runs on TCType system TCType {
                test_PDU<SubjectAssurance>(
                    m_subjectAssurance(
                        '101'B,
                        '11'B
                    )
                );
            } // End of testcase tc_SubjectAssurance_01
            
            testcase tc_ValidityRestriction_01() runs on TCType system TCType {
                test_PDU<ValidityRestriction>(
                    m_validity_restriction_time_end(
                        12345
                    )
                );
            } // End of testcase tc_ValidityRestriction_01
            
            testcase tc_ValidityRestriction_02() runs on TCType system TCType {
                test_PDU<ValidityRestriction>(
                    m_validity_restriction_time_start_and_end(
                        12345,
                        12378
                    )
                );
            } // End of testcase tc_ValidityRestriction_02
            
            testcase tc_ValidityRestriction_03() runs on TCType system TCType {
                test_PDU<ValidityRestriction>(
                    m_validity_restriction_time_start_and_duration(
                        12345,
                        m_duration_in_seconds(
                             456
                       )
                    )
                );
            } // End of testcase tc_ValidityRestriction_03
            
            testcase tc_ValidityRestriction_04() runs on TCType system TCType {
                test_PDU<ValidityRestriction>(
                    m_validity_restriction_region(
                        m_geographicRegion_identifiedRegion(
                            m_identifiedRegion_02
                        )
                    )
                );
            } // End of testcase tc_ValidityRestriction_04
            
            testcase tc_ValidityRestriction_05() runs on TCType system TCType {
                test_PDU<ValidityRestriction>(
                    m_validity_restriction_region(
                        m_geographicRegion_circle(
                            {
                                43616908,
                                7052847
                            },
                            10000
                        )
                    )
                );
            } // End of testcase tc_ValidityRestriction_05
            
            
            /**
             * @desc Root certificate self signed
             * @verdict 
             */
            testcase tc_Certificate_01() runs on TCType system TCType {
                test_PDU<Certificate>(
                    m_certificate(
                        m_signerInfo_self, 
                        m_subject_info_root_ca('455453495f506c7567746573745f526f6f74'O), // ETSI_Plugtest_Root
                        {
                            m_subject_attribute_verification_key(
                                m_publicKey_eccPoint(
                                    m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                        '63eb5c4ea82bc6a6b27e5857a075dce18f0e3cdc01d42896418b23f68872e41a'O,
                                        'd04f5dfcdc2be224986e15147840ff21f709dcb6503a416207e1b8e1ce395c2a'O
                                    )
                                )
                            ),
                            m_subject_attribute_verification_key(
                                m_publicKey_aesccm(
                                    m_aesccm(
                                        m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                            '4dff56b92fcf680ee694ee58473f9f7d37516c3708f108a5185c185c5f159f02'O,
                                            'f47aa5d2514f593245dd6575613114182dc83ec67ac2a7b6726421d94c55184b'O
                                        )
                                    )
                                )
                            )
                        }, // End of field subject_attributes
                        {
                        }, // End of field validity_restrictions
                        m_signature(
                            m_ecdsaSignature(
                                m_eccPointecdsa_nistp256_with_sha256_x_coordinate_only(
                                    'd06ff2baf762e9618cac21bd110f271ea2a7c91355dca14753fc9a0dded1ab34'O
                                ),
                                '71db2dd2ba840126e2904297f34386ccdfe86a0ebe0e585748517a5da49808b4'O
                            )
                        )
                    ) // End of template m_certificate
                );
            } // End of testcase tc_Certificate_01
            
            template (value) octetstring m_rootCertificate := '02000412455453495f506c7567746573745f526f6f748091000004a0ce08d329fd7be6b5af8fde7dad64e57fa5ff54dfaf9ec42b7443193c1f9d9d48e3c03250e59f895b17ca1e68cd8f5f1e9b1b06eddd0b98dfde91e88fa1199501010004e82c1957b1da51b5a00f29e51db151b30bd6ef29bd0c2f3e8e5cf457826f8660e59e4783e9b4b2a5b455263183ea88b18ae7e2d90ec805260213978014d1b2bf02202006c04080c0408124011464b4031a5617030303181db9cf7c052616001db9566e0526872a1d53f0d0052783500000a83ef7af9f3509189db625cd2e30eaefaf4f5b604d36389ece4f06b37a3923cf13ce5734485e25e360a7cf386eee795debbe9c61586de56b4fbd46d704109956'O;
            template (value) octetstring m_aaCertificate := '02016da94961ba3e28810210455453495f506c7567746573745f41418091000004c368a797aa7943e4176aa5004d37eec5e12b92fea6b9630a9e197a10702f0f495c775d0e12bdbb21eb18648409443072ff2a383d51b5f7a5a7dca88434b5bb8801010004b244be4855cbb05cc7302903d043fe36d5abaa1b331b8c4de3e74c212cfac113b244be4855cbb05cc7302903d043fe36d5abaa1b331b8c4de3e74c212cfac11302202006c04080c0408124011464b4031a5617030303181db9cf7c052616001db9566e0526872a1d53f0d00527835000004c004618e92921341bcded2f15c58f50aa3590e59a3a798fe1a3b2364d66d8823b855859920f3e7f96e66f85ce90cee26ac71cb2ee9fbeecb64747ce19c50804'O;
            template (value) octetstring m_atCertificate := '0201ebdb26e96a88ea1b01008095000004ceb7c449075ce00c1e7e1f997d443194dcf904f01f6149d4287bdcdb3bad251aa882d59fe8747108e2980c663353967a152c5b27cd83e055f93bc9b9da265859010100044d1c988453d69cae826f8a14f46d672d000b777c606a05b1b622a11f356fb2facba1fa6f2fb2ba44d47765dc6062966ded39161a5222799af887508767b657ec0220210ac040800100c04081010024011464b4031a5617030303181db9cf7c052616001db9566e0526872a1d53f0d005278350000050804677f295dbd99a64aaec8d100f07efd14234a6152012fd1371c32ff1e4479543df14c2de7d744c8526ed330bca75f05e30361a25c11dd2c83bbdf495f81f'O;
            
            testcase tc_Certificate_02() runs on TCType system TCType {
                test_decodePDU<Certificate>(
                    mw_certificate_dummy,
                    m_rootCertificate
                );
            } // End of testcase tc_Certificate_02
            
            testcase tc_Certificate_03() runs on TCType system TCType {
                test_decodePDU<Certificate>(