Commits (1)
module LibItsPki_EncdecDeclarations {
// LibIts
import from IEEE1609dot2BaseTypes language "ASN.1:1997" all;
import from EtsiTs102941BaseTypes language "ASN.1:1997" all;
import from EtsiTs102941TypesEnrolment language "ASN.1:1997" all;
import from EtsiTs102941TypesAuthorization language "ASN.1:1997" all;
......@@ -90,4 +91,37 @@ module LibItsPki_EncdecDeclarations {
external function fx_dec_AuthorizationValidationRequest(inout bitstring b, out EtsiTs102941TypesAuthorizationValidation.AuthorizationValidationRequest p) return integer
with {extension "prototype(sliding) decode(PER)"}
/**
* @desc Encoding function for EtsiTs102941BaseTypes PublicKeys
* @param p The certificate to encode
* @return The encode message in OER format
*/
external function fx_enc_PublicKeys(in EtsiTs102941BaseTypes.PublicKeys p) return bitstring
with {extension "prototype(convert) encode(PER)"}
external function fx_dec_PublicKeys(inout bitstring b, out EtsiTs102941BaseTypes.PublicKeys p) return integer
with {extension "prototype(sliding) decode(PER)"}
/**
* @desc Encoding function for IEEE1609dot2BaseTypes PublicVerificationKey
* @param p The certificate to encode
* @return The encode message in OER format
*/
external function fx_enc_PublicVerificationKey(in IEEE1609dot2BaseTypes.PublicVerificationKey p) return bitstring
with {extension "prototype(convert) encode(PER)"}
external function fx_dec_PublicVerificationKey(inout bitstring b, out IEEE1609dot2BaseTypes.PublicVerificationKey p) return integer
with {extension "prototype(sliding) decode(PER)"}
/**
* @desc Encoding function for IEEE1609dot2BaseTypes PublicEncryptionKey
* @param p The certificate to encode
* @return The encode message in OER format
*/
external function fx_enc_PublicEncryptionKey(in IEEE1609dot2BaseTypes.PublicEncryptionKey p) return bitstring
with {extension "prototype(convert) encode(PER)"}
external function fx_dec_PublicEncryptionKey(inout bitstring b, out IEEE1609dot2BaseTypes.PublicEncryptionKey p) return integer
with {extension "prototype(sliding) decode(PER)"}
} // End of module LibItsPki_EncdecDeclarations
This diff is collapsed.
......@@ -38,7 +38,15 @@ module LibItsPki_Pixits {
/**
* @desc Indicate which encryption algorithem to be used
*/
modulepar SecurityAlg PX_EC_ALG := e_nist_p256;
modulepar SecurityAlg PX_EC_ALG_FOR_EC := e_nist_p256; // TODO Use RCA to determine encryption algorithm?
/**
* @desc Indicate which encryption algorithem to be used
*/
modulepar SecurityAlg PX_EC_ALG_FOR_AT := e_nist_p256;
/**
* @desc Indicate which encryption algorithem to be used
*/
modulepar SecurityAlg PX_EC_ALG_FOR_ATV := e_nist_p256;
/**
* @desc Indicate which verification algorithem to be used
......
......@@ -624,6 +624,8 @@ module LibItsSecurity_Functions {
out Oct32 p_publicKeyCompressed,
out integer p_compressed_mode
) return boolean {
log(">>> f_generate_key_pair_nistp256");
if (PICS_SEC_FIXED_KEYS) { // Debug mode: Use fixed values
p_privateKey := '43481BC44C073C1432DB6EC4F0EF57062BEA08E4C19F811567325AD1FD1C6577'O;
p_publicKeyX := '0B5D74B033531C51D17B4F218DD4E39289AE4BF2EE3D7BAB7C07DAF0C14F0317'O;
......@@ -653,6 +655,7 @@ module LibItsSecurity_Functions {
out Oct32 p_publicKeyCompressed,
out integer p_compressed_mode
) return boolean {
log(">>> f_generate_key_pair_brainpoolp256");
return fx_generateKeyPair_brainpoolp256(p_privateKey, p_publicKeyX, p_publicKeyY, p_publicKeyCompressed, p_compressed_mode);
}
......
......@@ -1804,6 +1804,17 @@ module LibItsSecurity_Templates {
seconds := p_duration
} // End of template m_duration_in_seconds
/**
* @desc Send template for Duration (in hours)
* @param p_duration The duration value
* @see Draft ETSI TS 103 097 V1.3.1 Clause 4.2.18 Duration
*/
template (value) Duration m_duration_in_hours(
in template (value) Int16 p_duration
) := {
hours := p_duration
} // End of template m_duration_in_hours
/**
* @desc Receive template for Duration (in seconds)
* @param p_duration The duration value
......
......@@ -22,12 +22,13 @@ module LibItsSecurity_TypesAndValues {
// Test Adapter certificates & private keys - Valid behavior
const charstring cc_taCert_A := "CERT_TS_A_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */
const charstring cc_taCert_A_AA := "CERT_TS_A_AA";
const charstring cc_taCert_A1 := "CERT_TS_A_A1_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */
const charstring cc_taCert_A2 := "CERT_TS_A_A2_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */
const charstring cc_taCert_A3 := "CERT_TS_A_A3_AT"; /** Default certificate, without region validity restriction, to be used when secured messages are sent from TA to IUT */
const charstring cc_taCert_B := "CERT_TS_B_AT"; /** Default certificate, with circular region, to be used when secured messages are sent from TA to IUT */
const charstring cc_taCert_B1 := "CERT_TS_B_1_AT";
const charstring cc_taCert_B_AA := "CERT_TS_B_1_AA";
const charstring cc_taCert_B_AA := "CERT_TS_B_1_AA";
const charstring cc_taCert_C := "CERT_TS_C_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */
const charstring cc_taCert_C1 := "CERT_TS_C1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */
const charstring cc_taCert_CA1 := "CERT_TS_CA1_AT"; /** Certificate with a rectangular region, to be used when secured messages are sent from TA to IUT */
......