LibItsSecurity_Pixits.ttcn3 10.6 KB
Newer Older
garciay's avatar
garciay committed
/**
 *  @author   ETSI / STF481
 *  @version  $URL$
 *            $Id$
 *  @desc     Module containing Pixits for Security Protocol
 *
 */
module LibItsSecurity_Pixits {
garciay's avatar
garciay committed
    // LibItsSecurity
    import from LibItsSecurity_TypesAndValues all;
    import from LibItsSecurity_Templates all;
garciay's avatar
garciay committed
    
     * @desc Index on the certificate to be used. Default: configuration #0
    modulepar integer PX_CERTIFICATE_CONFIG_IDX := 0;
     * @desc CA certificates to be used by the Test Adapter
    modulepar CertificateChain PX_CA_CERTIFICATES := {
        { // Config #0
            version             := 2,
            signer_infos        := {
                {                     
                    type_         := e_self,
                    signerInfo    := omit
                }
            },
            subject_info        := m_subject_info_root_ca(
                '455453495f506c7567746573745f526f6f74'O // ETSI_Plugtest_Root
            ),
            subject_attributes  := {
                m_subject_attribute_verification_key(
                    m_publicKey_eccPoint(
                        m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                            '2310175fc18d35a60b756326603ba4b91222156330c8b2ea9ba11bb77bf4ab2a'O,
                            '6cc5dbdedae46859755c3c7d24bbd0672fa2c19603253250462d561a9cd6e772'O
                        )
                    )
                ),
                m_subject_attribute_encryption_key(
                    m_publicKey_aesccm(
                        m_aesccm(
                            m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                '52b860c7e98b2a80dffb2f0dbb66655e50912f032e5e9e455d4cda2b585288e3'O,
                                '4aa121c98582f1d4142cdf602ca20ece11d4a4c95c10570d3698acea0d88b70a'O
                            )
                        )
                    )
                ),
                m_subject_attribute_assurance_level(
                    m_subjectAssurance(
                        '001'B, 
                        '00'B
                    )
                ),
                m_subject_attribute_its_aid_list(
                    { 
                        16512,
                        16513
                    }
                )
            },
            validity_restrictions   := {
                m_validity_restriction_time_start_and_end(
garciay's avatar
garciay committed
                    1408802285,
                    1513691885
                ),
                m_validity_restriction_region(
                    m_geographicRegion_polygonial(
                        {
                            {
                                latitude    := 498716540, 
                                longitude   := 86382080
                            }, 
                            {
                                latitude    := 498685550, 
                                longitude   := 86411050
                            }, 
                            {
                                latitude    := 492040400, 
                                longitude   := 86475600
                            } 
                        }
                    )
                )
            },
            signature_              := m_signature(
                m_ecdsaSignature(
                    m_eccPointecdsa_nistp256_with_sha256_x_coordinate_only(
                        '4a249cd8c9d06591b5b872e6c43f4cdadb92ddbfdec76efc97ac8e417757d180'O
                    'feb5073184ddd22126758f60ff92f185a668bca761c917e32f08690014e01535'O
                )
            )
        } // End of config #0
     * @desc AA certificates to be used by the Test Adapter
    modulepar CertificateChain PX_AA_CERTIFICATES := {
        { // Config #0
            version             := 2,
            signer_infos        := {
                {
                    type_         := e_certificate,
                    signerInfo    := {
                        certificate := PX_CA_CERTIFICATES[0]
                    } // End of field signerInfo
                } 
            },
            subject_info        := m_subject_info_authorization_authority(
                '455453495F506C7567746573745F4141'O // ETSI_Plugtest_Root
            ),
            subject_attributes  := {
                m_subject_attribute_verification_key(
                    m_publicKey_eccPoint(
                        m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                            'd2099e59a56b776543f64ab8db22fa92c0481bdc90b744d0db1e6aedc166d0d0'O,
                            '3893e3830a5f73552536f7f96682949cd6f294ca432db142602c259cb1f32204'O
                        )
                    )
                ),
                m_subject_attribute_encryption_key(
                    m_publicKey_aesccm(
                        m_aesccm(
                            m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                'cb056cc2d14bfdb33d4018561a3ffb29cab78f009387215a218c761940a5e5a8'O,
                                'cb056cc2d14bfdb33d4018561a3ffb29cab78f009387215a218c761940a5e5a8'O
                            )
                        )
                    )
                ),
                m_subject_attribute_assurance_level(
                    m_subjectAssurance(
                        '001'B, 
                        '00'B
                    )
                ),
                m_subject_attribute_its_aid_list(
                    { 
                        16512,
                        16513
                    }
                )
            },
            validity_restrictions   := {
                m_validity_restriction_time_start_and_end(
garciay's avatar
garciay committed
                    1408802285,
                    1513691885
                ),
                m_validity_restriction_region(
                    m_geographicRegion_polygonial(
                        {
                            {
                                latitude    := 498716540, 
                                longitude   := 86382080
                            }, 
                            {
                                latitude    := 498685550, 
                                longitude   := 86411050
                            }, 
                            {
                                latitude    := 492040400, 
                                longitude   := 86475600
                            } 
                        }
                    )
                )
            },
            signature_              := m_signature(
                m_ecdsaSignature(
                    m_eccPointecdsa_nistp256_with_sha256_x_coordinate_only(
                        'f34c574eaba1c3d5d733b603d765cb9b2a603623c4c927f82ae6b84f95683d80'O
                    '2914da5c5a519d597630c38ca78c1d844475a6c8e0f0343e79ba87af7716f3cd'O
                )
            )
        } // End of config #0
        // TODO Add additional configurations
    };
    
    /**
     * @desc AT certificates to be used by the Test Adapter
    modulepar CertificateChain PX_AT_CERTIFICATES := {
        { // Config #0
                {
                    type_         := e_certificate_digest_with_ecdsap256,
                    signerInfo    := {
                        digest := 'ea16b7847cbc4680'O
                    } // End of field signerInfo
                } 
            },
            subject_info        := m_subject_info_authorization_ticket,
            subject_attributes  := {
                m_subject_attribute_verification_key(
                    m_publicKey_eccPoint(
                        m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                            '7a9e782368297b62b47d3dbe3718f9c9879cfe985f8b734667f4573820f9d46c'O,
                            'ad2b4454bd31ded6c39f9d9338410fbf330995e50743f99782add4f5ce04df45'O
                        )
                    )
                ),
                m_subject_attribute_encryption_key(
                    m_publicKey_aesccm(
                        m_aesccm(
                            m_eccPointecdsa_nistp256_with_sha256_uncompressed(
                                '4bb98551a5f5606f2c5b6dcf640dd5d88530fff6a9d1b9d073537f89dc9f3a76'O,
                                '3f9631c068bed0373c6c2333617b922254e0951ed90e25e3fe3a0a9ffd8f6b5d'O
                            )
                        )
                    )
                ),
                m_subject_attribute_assurance_level(
                    m_subjectAssurance(
                        '001'B, 
                        '00'B
                    )
                ),
                m_subject_attribute_its_aid_list(
                    { 
                        16512,
                        16513
                    }
                )
            },
            validity_restrictions   := {
                m_validity_restriction_time_start_and_end(
garciay's avatar
garciay committed
                    1408802285,
                    1513691885
                )
            },
            signature_              := m_signature(
                m_ecdsaSignature(
                    m_eccPointecdsa_nistp256_with_sha256_x_coordinate_only(
                        'e3cfcb6cca2138cdf82daccf4530c47753a7868e2c1e299346e2acd58ab7dec0'O
                    'ebec940cb0694a779b3055d8bd3a9bc67427021980d60b3780814b62d7555327'O
        } // End of config #0
     * @desc 3D locations
    modulepar ThreeDLocations PX_TRHEED_LOCATIONS := {
        { // Config #0
            latitude    := 12345,
            longitude   := 12345,
            elevation   := '020E'O
        } // End of config #0
        // TODO Add additional configurations
    };
    
    /**
     * @desc Desscribes the Test Adapter security configurations
     */
    modulepar TaConfigs PX_TA_CONFIGS := {
        { // Config #0
            signingPrivateKey   := '673a51298753d89af6d70b52a938a69e3ab7d4f8540823998d0751191e1e31c6'O,
            encryptPrivateKey   := '73122d2d0b40f639db8c62bc90569e312af8f99df4a8f706e8375c8dc1bbc10a'O,
            caCertificate       := PX_CA_CERTIFICATES[0],
            aaCertificate       := PX_AA_CERTIFICATES[0],
            atCertificate       := PX_AT_CERTIFICATES[0],
            location            := PX_TRHEED_LOCATIONS[0]
        } // End of config #0
        // TODO Add additional configurations
    }; // End of modulepar PX_TA_CONFIGS
    
garciay's avatar
garciay committed
} // End of module LibItsSecurity_Pixits