Skip to content
LibItsPki_Templates.ttcn 32.8 KiB
Newer Older
/**
 *  @author   ETSI / STF545
 *  @version  $URL$
 *            $Id$
 *  @desc     Module containing templates for IT PKI Protocol
 *  @copyright   ETSI Copyright Notification
 *               No part may be reproduced except as authorized by written permission.
 *               The copyright and the foregoing restriction extend to reproduction in all media.
 *               All rights reserved.
 *
 */
module LibItsPki_Templates {
garciay's avatar
garciay committed
  
  // LibCommon
  import from LibCommon_BasicTypesAndValues all;
  import from LibCommon_DataStrings all;
  
  // LibItsCommon
  import from LibItsCommon_TypesAndValues all;
  import from LibItsCommon_Functions all;
  import from LibItsCommon_TypesAndValues all;
  import from LibItsCommon_ASN1_NamedNumbers all;
  
  // LibIts
  import from IEEE1609dot2BaseTypes language "ASN.1:1997" all;
  import from IEEE1609dot2 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;
  import from EtsiTs102941TypesAuthorizationValidation language "ASN.1:1997" all;
  import from EtsiTs102941MessagesCa language "ASN.1:1997" all;
garciay's avatar
garciay committed
  import from EtsiTs103097Module language "ASN.1:1997" all;
  
  // LibItsSecurity
  import from LibItsSecurity_Templates all;
  // LibItsPki
  import from LibItsPki_TypesAndValues all;

garciay's avatar
garciay committed
  template (value) EtsiTs102941Data m_etsiTs102941Data_inner_ec_request_signed_for_pop(
                                                                                       in template (value) InnerEcRequestSignedForPop p_inner_ec_request_signed_for_pop
                                                                                       ) := {
    version := PkiProtocolVersion,
garciay's avatar
garciay committed
    content := {
      enrolmentRequest := p_inner_ec_request_signed_for_pop
    }
  } // End of template m_etsiTs102941Data_inner_ec_request_signed_for_pop
  
  template (value) EtsiTs102941Data m_etsiTs102941Data_inner_ec_response(
                                                                         in template (value) InnerEcResponse p_inner_ec_response
                                                                         ) := {
    version := PkiProtocolVersion,
garciay's avatar
garciay committed
    content := {
      enrolmentResponse := p_inner_ec_response
    }
  } // End of template m_etsiTs102941Data_inner_ec_response

  template (value) EtsiTs102941Data m_etsiTs102941Data_inner_at_response(
                                                                         in template (value) InnerAtResponse p_inner_at_response
                                                                         ) := {
    version := PkiProtocolVersion,
    content := {
      authorizationResponse := p_inner_at_response
    }
  } // End of template m_etsiTs102941Data_inner_at_response

  template (present) EtsiTs102941Data mw_etsiTs102941Data_inner_ec_response(
                                                                            template (present) InnerEcResponse p_inner_ec_response := ?
                                                                            ) := {
    version := PkiProtocolVersion,
    content := {
      enrolmentResponse := p_inner_ec_response
    }
  } // End of template mw_etsiTs102941Data_inner_ec_response

  template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_request(
                                                                             in template (value) InnerAtRequest p_inner_at_request
                                                                             ) := {
    version := PkiProtocolVersion,
    content := {
      authorizationRequest := p_inner_at_request
  } // End of template m_etsiTs102941Data_authorization_request
  template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_response(
                                                                              in template (value) InnerAtResponse p_inner_at_response
                                                                              ) := {
    version := PkiProtocolVersion,
    content := {
      authorizationResponse := p_inner_at_response
    }
  } // End of template m_etsiTs102941Data_authorization_response
  template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_validation_request(
                                                                                        in template (value) AuthorizationValidationRequest p_authorization_validation_request
                                                                                        ) := {
    version := PkiProtocolVersion,
    content := {
      authorizationValidationRequest := p_authorization_validation_request
    }
  } // End of template m_etsiTs102941Data_authorization_validation_request
  
  template (value) EtsiTs102941Data m_etsiTs102941Data_authorization_validation_response(
                                                                                         in template (value) AuthorizationValidationResponse p_authorization_validation_response
                                                                                         ) := {
    version := PkiProtocolVersion,
    content := {
      authorizationValidationResponse := p_authorization_validation_response
    }
  } // End of template m_etsiTs102941Data_authorization_validation_response
  
garciay's avatar
garciay committed
  template (present) EnrolmentRequestMessage mw_enrolmentRequestMessage(
                                                                        template (present) EncryptedData p_encryptedData := ?
                                                                        ) modifies mw_etsiTs103097Data_encrypted := {
  } // End of template mw_enrolmentRequestMessage
  
  template (present) EnrolmentResponseMessage mw_enrolmentResponseMessage(
                                                                         template (present) EncryptedData p_encryptedData := ?
                                                                         ) modifies mw_etsiTs103097Data_encrypted := {
  } // End of template mw_enrolmentResponseMessage

  template (value) EtsiTs103097Data m_authorizationValidationRequestMessage(
                                                                            in template (value) EncryptedData p_encryptedData
                                                                            ) modifies m_etsiTs103097Data_encrypted := {
  } // End of template m_authorizationValidationRequestMessage
Yann Garcia's avatar
Yann Garcia committed
  template (present) EtsiTs103097Data mw_authorizationValidationResponseMessage(
                                                                                template (present) EncryptedData p_encryptedData := ?
                                                                                ) modifies mw_etsiTs103097Data_encrypted := {
  } // End of template mw_authorizationValidationResponseMessage
  
  template (value) AuthorizationRequestMessage m_authorizationRequestMessage(
                                                                             in template (value) EncryptedData p_encryptedData
                                                                             ) modifies m_etsiTs103097Data_encrypted := {
  } // End of template m_authorizationRequestMessage
  
garciay's avatar
garciay committed
  template (present) AuthorizationRequestMessage mw_authorizationRequestMessage(
                                                                                template (present) EncryptedData p_encryptedData := ?
                                                                                ) modifies mw_etsiTs103097Data_encrypted := {
  } // End of template mw_authorizationRequestMessage
  
  template (value) AuthorizationResponseMessage m_authorizationResponseMessage(
                                                                               in template (value) EncryptedData p_encryptedData
                                                                               ) modifies m_etsiTs103097Data_encrypted := {
  } // End of template m_authorizationResponseMessage
garciay's avatar
garciay committed
  template (present) AuthorizationResponseMessage mw_authorizationResponseMessage(
                                                                                  template (present) EncryptedData p_encryptedData := ?
                                                                                  ) modifies mw_etsiTs103097Data_encrypted := {
  } // End of template mw_authorizationResponseMessage
  
garciay's avatar
garciay committed
  template (value) EtsiTs102941DataContent m_enrolmentRequest(
                                                              in template (value) InnerEcRequestSignedForPop p_enrolmentRequest
                                                              ) := {
    enrolmentRequest := p_enrolmentRequest
  } // End of template m_enrolmentRequest
  
  template (present) EtsiTs102941DataContent mw_enrolmentRequest(
                                                                 template (present) InnerEcRequestSignedForPop p_enrolmentRequest := ?
                                                                 ) := {
  enrolmentRequest := p_enrolmentRequest
  } // End of template mw_enrolmentRequest

  template (present) InnerEcRequestSignedForPop mw_innerEcRequestSignedForPop(
                                                                              template (present) SignedData p_signedData := ?
                                                                              ) modifies mw_etsiTs103097Data_signed := {
  } // End of template mw_innerEcRequestSignedForPop
  
garciay's avatar
garciay committed
  template (present) EtsiTs102941DataContent mw_enrolmentResponse(
                                                                  template (present) InnerEcResponse p_enrolmentResponse := ?
                                                                  ) := {
    enrolmentResponse := p_enrolmentResponse
  } // End of template mw_enrolmentResponse
  
  template (value) EtsiTs102941DataContent m_authorizationRequest(
                                                                  in template (value) InnerAtRequest p_authorizationRequest
                                                                  ) := {
    authorizationRequest := p_authorizationRequest
  } // End of template m_authorizationRequest
  
  template (present) EtsiTs102941DataContent mw_authorizationRequest(
                                                                     in template (present) InnerAtRequest p_authorizationRequest := ?
                                                                     ) := {
    authorizationRequest := p_authorizationRequest
  } // End of template mw_authorizationRequest
  
  template (present) EtsiTs102941DataContent mw_authorizationResponse(
                                                                      template (present) InnerAtResponse p_authorizationResponse := ?
                                                                      ) := {
    authorizationResponse := p_authorizationResponse
  } // End of template mw_authorizationResponse
  
YannGarcia's avatar
YannGarcia committed
  template (present) EtsiTs102941DataContent mw_authorizationValidationRequest(
                                                                               template (present) AuthorizationValidationRequest p_authorization_validation_request := ?
                                                                               ) := {
    authorizationValidationRequest := p_authorization_validation_request
  } // End of template mw_authorizationValidationRequest
  
  template (present) EtsiTs102941DataContent mw_authorizationValidationResponse(
YannGarcia's avatar
YannGarcia committed
                                                                                template (present) AuthorizationValidationResponse p_authorization_validation_response := ?
YannGarcia's avatar
YannGarcia committed
    authorizationValidationResponse := p_authorization_validation_response
  } // End of template mw_authorizationValidationResponse
  
garciay's avatar
garciay committed
  template (value) InnerEcRequest m_innerEcRequest(
                                                   in template (value) octetstring p_itsId,
garciay's avatar
garciay committed
                                                   in template (value) PublicKeys p_publicKeys,
                                                   in template (value) CertificateSubjectAttributes p_requestedSubjectAttributes
                                                   ) := {
    itsId                      := p_itsId,
    certificateFormat          := 1,
    publicKeys                 := p_publicKeys,
    requestedSubjectAttributes := p_requestedSubjectAttributes
  } // End of template m_innerEcRequest
  
  template (present) InnerEcRequest mw_innerEcRequest(
                                                      template (present) octetstring p_itsId := ?,
garciay's avatar
garciay committed
                                                      template (present) PublicKeys p_publicKeys := ?,
                                                      template (present) CertificateSubjectAttributes p_requestedSubjectAttributes := ?
                                                      ) := {
    itsId                      := p_itsId,
    certificateFormat          := 1,
    publicKeys                 := p_publicKeys,
    requestedSubjectAttributes := p_requestedSubjectAttributes
  } // End of template mw_innerEcRequest
  
  template (value) InnerAtRequest m_innerAtRequest(
                                                   in template (value) PublicKeys p_publicKeys,
                                                   in template (value) Oct32 p_hmacKey,
                                                   in template (value) SharedAtRequest p_sharedAtRequest,
                                                   in template (value) EcSignature p_ecSignature
                                                   ) := {
    publicKeys      := p_publicKeys,
    hmacKey         := p_hmacKey,
    sharedAtRequest := p_sharedAtRequest,
    ecSignature     := p_ecSignature
  } // End of template m_innerAtRequest
  
  template (present) InnerAtRequest mw_innerAtRequest(
                                                      template (present) PublicKeys p_publicKeys := ?,
                                                      template (present) Oct32 p_hmacKey := ?,
                                                      template (present) SharedAtRequest p_sharedAtRequest := ?,
                                                      template (present) EcSignature p_ecSignature := ?
                                                      ) := {
    publicKeys      := p_publicKeys,
    hmacKey         := p_hmacKey,
    sharedAtRequest := p_sharedAtRequest,
    ecSignature     := p_ecSignature
  } // End of template mw_innerAtRequest
  
garciay's avatar
garciay committed
  template (omit) PublicKeys m_publicKeys(
                                          in template (value) PublicVerificationKey p_verificationKey,
                                          in template (omit) PublicEncryptionKey p_encryptionKey := omit
                                          ) := {
  verificationKey := p_verificationKey,
  encryptionKey   := p_encryptionKey
  } // End of template m_publicKeys
garciay's avatar
garciay committed
  template PublicKeys mw_publicKeys(
                                    template (present) PublicVerificationKey p_verificationKey := ?,
                                    template PublicEncryptionKey p_encryptionKey := *
                                    ) := {
  verificationKey := p_verificationKey,
  encryptionKey   := p_encryptionKey
  } // End of template mw_publicKeys
  template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_none(
                                                                                      in template (value) SequenceOfPsidSsp p_appPermissions,
                                                                                      in template (omit) ValidityPeriod p_validityPeriod := omit,
                                                                                      in template (omit) GeographicRegion p_region := omit,
                                                                                      in template (omit) SubjectAssurance p_assuranceLevel := omit
                                                                                      ) := {
  id                   := { none_ := NULL },
  validityPeriod       := p_validityPeriod,
  region               := p_region,
  assuranceLevel       := p_assuranceLevel,
  appPermissions       := p_appPermissions,
  certIssuePermissions := omit
  } // End of template m_certificateSubjectAttributes_id_none
  
YannGarcia's avatar
YannGarcia committed
  template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_omit(
                                                                                      in template (value) SequenceOfPsidSsp p_appPermissions,
                                                                                      in template (omit) ValidityPeriod p_validityPeriod := omit,
                                                                                      in template (omit) GeographicRegion p_region := omit,
                                                                                      in template (omit) SubjectAssurance p_assuranceLevel := omit
                                                                                      ) modifies m_certificateSubjectAttributes_id_none := {
  id                   := omit
  } // End of template m_certificateSubjectAttributes_id_omit
  
  template (omit) CertificateSubjectAttributes m_certificateSubjectAttributes_id_name(
                                                                                      in template (value) Hostname p_name,
                                                                                      in template (value) SequenceOfPsidSsp p_appPermissions,
                                                                                      in template (omit) ValidityPeriod p_validityPeriod := omit,
                                                                                      in template (omit) GeographicRegion p_region := omit,
                                                                                      in template (omit) SubjectAssurance p_assuranceLevel := omit
                                                                                      ) := {
  id                   := { name := p_name },
garciay's avatar
garciay committed
  validityPeriod       := p_validityPeriod,
  region               := p_region,
  assuranceLevel       := p_assuranceLevel,
  appPermissions       := p_appPermissions,
  certIssuePermissions := omit
  } // End of template m_certificateSubjectAttributes_id_name
garciay's avatar
garciay committed
  template (value) InnerEcResponse m_innerEcResponse_ok(
                                                        in template (value) Oct16 p_requestHash,
                                                        in template (value) EtsiTs103097Certificate p_certificate
                                                        ) := {
  requestHash  := p_requestHash,
  responseCode := ok,
  certificate  := p_certificate
  } // End of template m_innerEcResponse_ok
garciay's avatar
garciay committed
  template (present) InnerEcResponse mw_innerEcResponse_ok(
                                                           template (present) Oct16 p_requestHash := ?,
                                                           template (present) EtsiTs103097Certificate p_certificate := ?
                                                           ) := {
  requestHash  := p_requestHash,
  responseCode := ok,
  certificate  := p_certificate
  } // End of template mw_innerEcResponse_ok
garciay's avatar
garciay committed
  template (value) InnerEcResponse m_innerEcResponse_ko(
                                                        in template (value) Oct16 p_requestHash,
                                                        in template (value) EnrolmentResponseCode p_responseCode
                                                        ) := {
  requestHash  := p_requestHash,
  responseCode := p_responseCode,
  certificate  := omit
  } // End of template m_innerEcResponse_ko
garciay's avatar
garciay committed
  template (present) InnerEcResponse mw_innerEcResponse_ko(
                                                           template (present) Oct16 p_requestHash := ?,
                                                           template (present) EnrolmentResponseCode p_responseCode := complement(ok)
                                                           ) := {
  requestHash  := p_requestHash,
  responseCode := p_responseCode,
garciay's avatar
garciay committed
  } // End of template mw_innerEcResponse_ko
  
  template (value) InnerAtResponse m_innerAtResponse_ok(
                                                        in template (value) Oct16 p_requestHash,
                                                        in template (value) EtsiTs103097Certificate p_certificate
                                                        ) := {
  requestHash  := p_requestHash,
  responseCode := ok,
  certificate  := p_certificate
  } // End of template m_innerAtResponse_ok
  
  template (present) InnerAtResponse mw_innerAtResponse_ok(
                                                           template (present) Oct16 p_requestHash := ?,
                                                           template (present) EtsiTs103097Certificate p_certificate := ?
                                                           ) := {
    requestHash  := p_requestHash,
    responseCode := ok,
    certificate  := p_certificate
  } // End of template mw_innerAtResponse_ok
  template (value) InnerAtResponse m_innerAtResponse_ko(
                                                        in template (value) Oct16 p_requestHash,
                                                        in template (value) AuthorizationResponseCode p_responseCode
                                                        ) := {
    requestHash  := p_requestHash,
    responseCode := p_responseCode,
    certificate  := omit
  } // End of template m_innerAtResponse_ko
  
  template (present) InnerAtResponse mw_innerAtResponse_ko(
                                                           template (present) Oct16 p_requestHash := ?,
                                                           template (present) AuthorizationResponseCode p_responseCode := complement(ok)
                                                           ) := {
  requestHash  := p_requestHash,
  responseCode := p_responseCode,
  certificate  := omit
  } // End of template mw_innerAtResponse_ko
YannGarcia's avatar
YannGarcia committed
  template (value) AuthorizationValidationRequest m_authorization_validation_request(
                                                                                     in template (value) SharedAtRequest p_sharedAtRequest,
                                                                                     in template (value) EcSignature p_ecSignature
                                                                                     ) := {
    sharedAtRequest := p_sharedAtRequest,
    ecSignature     := p_ecSignature
YannGarcia's avatar
YannGarcia committed
  } // End of template m_authorization_validation_request
YannGarcia's avatar
YannGarcia committed
  template (present) AuthorizationValidationRequest mw_authorization_validation_request(
                                                                                        template (present) SharedAtRequest p_sharedAtRequest := ?,
                                                                                        template (present) EcSignature p_ecSignature := ?
                                                                                        ) := {
    sharedAtRequest := p_sharedAtRequest,
    ecSignature     := p_ecSignature
YannGarcia's avatar
YannGarcia committed
  } // End of template mw_authorization_validation_request
  
  template (value) AuthorizationValidationResponse m_authorizationValidationResponse_ok(
                                                                                        template (value) Oct16 p_requestHash,
                                                                                        template (value) CertificateSubjectAttributes p_confirmedSubjectAttributes
                                                                                        ) := {
    requestHash                := p_requestHash,
    responseCode               := ok,
    confirmedSubjectAttributes := p_confirmedSubjectAttributes
  } // End of template m_authorizationValidationResponse_ok
  
  template (present) AuthorizationValidationResponse mw_authorizationValidationResponse_ok(
                                                                                           template (present) Oct16 p_requestHash := ?,
                                                                                           template (present) CertificateSubjectAttributes p_confirmedSubjectAttributes := ?
                                                                                           ) := {
    requestHash                := p_requestHash,
    responseCode               := ok,
    confirmedSubjectAttributes := p_confirmedSubjectAttributes
  } // End of template mw_authorizationValidationResponse_ok
  
  template (value) AuthorizationValidationResponse m_authorizationValidationResponse_ko(
                                                                                        in template (value) Oct16 p_requestHash,
                                                                                        in template (value) AuthorizationValidationResponseCode p_responseCode
                                                                                         ) := {
    requestHash                := p_requestHash,
    responseCode               := p_responseCode,
    confirmedSubjectAttributes := omit
  } // End of template m_authorizationValidationResponse_ko

  template (present) AuthorizationValidationResponse mw_authorizationValidationResponse_ko(
                                                                                           template (present) Oct16 p_requestHash := ?
                                                                                           ) := {
    requestHash                := p_requestHash,
    responseCode               := complement(ok),
    confirmedSubjectAttributes := omit
  } // End of template mw_authorizationValidationResponse_ko

  template (value) SharedAtRequest m_shared_at_request(
                                                       in template (value) HashedId8 p_eaId,
                                                       in template (value) Oct16 p_keyTag,
                                                       in template (value) CertificateSubjectAttributes p_requestedSubjectAttributes
                                                       ) := {
    eaId                       := p_eaId,
    keyTag                     := p_keyTag,
    certificateFormat          := 1,
    requestedSubjectAttributes := p_requestedSubjectAttributes
  } // End of template m_shared_at_request
  
  template (present) SharedAtRequest mw_shared_at_request(
                                                          template (present) HashedId8 p_eaId := ?,
                                                          template (present) Oct16 p_keyTag := ?,
                                                          template (present) CertificateSubjectAttributes p_requestedSubjectAttributes := ?
                                                       ) := {
    eaId                       := p_eaId,
    keyTag                     := p_keyTag,
    certificateFormat          := 1,
    requestedSubjectAttributes := p_requestedSubjectAttributes
  } // End of template mw_shared_at_request

  template (value) EcSignature m_ec_signature(
                                              in template (value) EtsiTs103097Data p_encryptedEcSignature
                                              ) := {
    encryptedEcSignature := p_encryptedEcSignature
  } // End of template m_ec_signature
  
  template (present) EcSignature mw_ec_signature(
                                                 template (present) EtsiTs103097Data p_encryptedEcSignature := ?
                                              ) := {
    encryptedEcSignature := p_encryptedEcSignature
  } // End of template mw_ec_signature

  template (value) EcSignature m_ec_signature_ext_payload(
                                                          in template (value) EtsiTs103097Data p_ecSignature
                                                          ) := {
    ecSignature := p_ecSignature
  } // End of template m_ec_signature_ext_payload
  
  template (present) EcSignature mw_ec_signature_ext_payload(
                                                             template (present) EtsiTs103097Data p_ecSignature := ?
                                                             ) := {
    ecSignature := p_ecSignature
  } // End of template mw_ec_signature_ext_payload
  template (omit) CertificateSubjectAttributes m_certificate_subject_attributes(
                                                                                in template (value) SequenceOfPsidSsp p_appPermissions,
                                                                                in template (value) SequenceOfPsidGroupPermissions p_certIssuePermissions,
                                                                                in template (omit) CertificateId p_id := omit,
                                                                                in template (omit) ValidityPeriod p_validityPeriod := omit,
                                                                                in template (omit) GeographicRegion p_region := omit,
                                                                                in template (omit) SubjectAssurance p_assuranceLevel := omit
                                                                                ) := {
    id                   := p_id,
    validityPeriod       := p_validityPeriod,
    region               := p_region,
    assuranceLevel       := p_assuranceLevel,
    appPermissions       := p_appPermissions,
    certIssuePermissions := p_certIssuePermissions
  } // End of template m_certificate_subject_attributes
  template CertificateSubjectAttributes mw_certificate_subject_attributes(
                                                                          template (present) SequenceOfPsidSsp p_appPermissions := ?,
                                                                          template CertificateId p_id := *,
                                                                          template (present) ValidityPeriod p_validityPeriod := ?,
YannGarcia's avatar
YannGarcia committed
                                                                          template SubjectAssurance p_assuranceLevel := *,
                                                                          template GeographicRegion p_region := *,
                                                                          template SequenceOfPsidGroupPermissions p_certIssuePermissions := omit
                                                                          ) := {
    id                   := p_id ifpresent,
    validityPeriod       := p_validityPeriod,
    region               := p_region,
    assuranceLevel       := p_assuranceLevel,
    appPermissions       := p_appPermissions,
    certIssuePermissions := p_certIssuePermissions
  } // End of template mw_certificate_subject_attributes
  
  template CertificateSubjectAttributes mw_certificate_subject_attributes_optional_assuranceLevel(
                                                                                                  template (present) SequenceOfPsidSsp p_appPermissions := ?,
                                                                                                  template (present) CertificateId p_id := ?,
                                                                                                  template (present) ValidityPeriod p_validityPeriod := ?,
                                                                                                  template SubjectAssurance p_assuranceLevel := *,
                                                                                                  template GeographicRegion p_region := *,
                                                                                                  template SequenceOfPsidGroupPermissions p_certIssuePermissions := omit
                                                                                                  ) := {
    id                   := p_id,
    validityPeriod       := p_validityPeriod,
    region               := p_region,
    assuranceLevel       := p_assuranceLevel,
    appPermissions       := p_appPermissions,
    certIssuePermissions := p_certIssuePermissions
  } // End of template mw_certificate_subject_attributes
  
garciay's avatar
garciay committed
} // End of module LibItsPki_Templates