Commit b741b3d3 authored by garciay's avatar garciay
Browse files

Add Brainpool Security support

parent 0972821f
Loading
Loading
Loading
Loading
+118 −17
Original line number Original line Diff line number Diff line
@@ -816,21 +816,21 @@ module LibItsSecurity_Templates {
            sSig := p_sSig
            sSig := p_sSig
        } // End of template mw_ecdsaNistP256Signature
        } // End of template mw_ecdsaNistP256Signature
        
        
        template (value) EcdsaP384Signature m_ecdsaP384Signature(
        template (value) EcdsaP384Signature m_ecdsaBrainpoolP384Signature(
                                                                          in template (value) EccP384CurvePoint p_rSig,
                                                                          in template (value) EccP384CurvePoint p_rSig,
                                                                          in template (value) Oct48 p_sSig
                                                                          in template (value) Oct48 p_sSig
        ) := {
        ) := {
            rSig := p_rSig,
            rSig := p_rSig,
            sSig := p_sSig
            sSig := p_sSig
        } // End of template m_ecdsaP384Signature
        } // End of template m_ecdsaBrainpoolP384Signature
        
        
        template (present) EcdsaP384Signature mw_ecdsaP384Signature(
        template (present) EcdsaP384Signature mw_ecdsaBrainpoolP384Signature(
                                                                             template (present) EccP384CurvePoint p_rSig := ?,
                                                                             template (present) EccP384CurvePoint p_rSig := ?,
                                                                             template (present) Oct48 p_sSig := ?
                                                                             template (present) Oct48 p_sSig := ?
        ) := {
        ) := {
            rSig := p_rSig,
            rSig := p_rSig,
            sSig := p_sSig
            sSig := p_sSig
        } // End of template mw_ecdsaP384Signature
        } // End of template mw_ecdsaBrainpoolP384Signature
        
        
        template (value) EccP256CurvePoint m_eccP256CurvePoint_x_only(
        template (value) EccP256CurvePoint m_eccP256CurvePoint_x_only(
                                                                      in template (value) Oct32 p_x_only
                                                                      in template (value) Oct32 p_x_only
@@ -1047,7 +1047,6 @@ module LibItsSecurity_Templates {
                                                                         in template (value) SequenceOfPsidSsp p_appPermissions,
                                                                         in template (value) SequenceOfPsidSsp p_appPermissions,
                                                                         in template (value) SequenceOfPsidGroupPermissions p_certIssuePermissions,
                                                                         in template (value) SequenceOfPsidGroupPermissions p_certIssuePermissions,
                                                                         in template (value) VerificationKeyIndicator p_verifyKeyIndicator,
                                                                         in template (value) VerificationKeyIndicator p_verifyKeyIndicator,
                                                                         in template (omit) SequenceOfPsidGroupPermissions p_certRequestPermissions := omit,
                                                                         in template (omit) ValidityPeriod p_validityPeriod := omit,
                                                                         in template (omit) ValidityPeriod p_validityPeriod := omit,
                                                                         in template (omit) GeographicRegion p_region := omit,
                                                                         in template (omit) GeographicRegion p_region := omit,
                                                                         in template (omit) SubjectAssurance p_assuranceLevel := omit,
                                                                         in template (omit) SubjectAssurance p_assuranceLevel := omit,
@@ -1060,8 +1059,8 @@ module LibItsSecurity_Templates {
            region                 := p_region,
            region                 := p_region,
            assuranceLevel         := p_assuranceLevel,
            assuranceLevel         := p_assuranceLevel,
            appPermissions         := p_appPermissions,
            appPermissions         := p_appPermissions,
            certIssuePermissions   := p_certIssuePermissions,
            certIssuePermissions   := p_certIssuePermissions, // ETSI TS 103 097 V1.3.1 Clause 7.2.3 Root CA certificates Bullet 4
            certRequestPermissions := p_certRequestPermissions, 
            certRequestPermissions := omit, 
            canRequestRollover     := omit,
            canRequestRollover     := omit,
            encryptionKey          := p_encryptionKey,
            encryptionKey          := p_encryptionKey,
            verifyKeyIndicator     := p_verifyKeyIndicator
            verifyKeyIndicator     := p_verifyKeyIndicator
@@ -1074,9 +1073,8 @@ module LibItsSecurity_Templates {
        template ToBeSignedCertificate mw_toBeSignedCertificate_ca(
        template ToBeSignedCertificate mw_toBeSignedCertificate_ca(
                                                                   template (present) CertificateId p_id := ?,
                                                                   template (present) CertificateId p_id := ?,
                                                                   template (present) SequenceOfPsidSsp p_appPermissions := ?,
                                                                   template (present) SequenceOfPsidSsp p_appPermissions := ?,
                                                                   template (present) SequenceOfPsidGroupPermissions p_certIssuePermissions := ?,
                                                                   template (present) SequenceOfPsidGroupPermissions p_certIssuePermissions,
                                                                   template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?,
                                                                   template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?,
                                                                   template SequenceOfPsidGroupPermissions p_certRequestPermissions := *,
                                                                   template ValidityPeriod p_validityPeriod := *,
                                                                   template ValidityPeriod p_validityPeriod := *,
                                                                   template GeographicRegion p_region := *,
                                                                   template GeographicRegion p_region := *,
                                                                   template SubjectAssurance p_assuranceLevel := *,
                                                                   template SubjectAssurance p_assuranceLevel := *,
@@ -1088,14 +1086,68 @@ module LibItsSecurity_Templates {
            validityPeriod         := p_validityPeriod,
            validityPeriod         := p_validityPeriod,
            region                 := p_region,
            region                 := p_region,
            assuranceLevel         := p_assuranceLevel,
            assuranceLevel         := p_assuranceLevel,
            appPermissions         := p_appPermissions,
            appPermissions         := *,
            certIssuePermissions   := p_certIssuePermissions,
            certIssuePermissions   := p_certIssuePermissions,
            certRequestPermissions := p_certRequestPermissions, 
            certRequestPermissions := *, 
            canRequestRollover     := *,
            canRequestRollover     := *,
            encryptionKey          := p_encryptionKey,
            encryptionKey          := p_encryptionKey,
            verifyKeyIndicator     := p_verifyKeyIndicator
            verifyKeyIndicator     := p_verifyKeyIndicator
        } // End of template mw_toBeSignedCertificate
        } // End of template mw_toBeSignedCertificate
        
        
        /**
         * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions
         * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential
         */
        template (omit) ToBeSignedCertificate m_toBeSignedCertificate_ea(
                                                                         in template (value) CertificateId p_id,
                                                                         in template (value) SequenceOfPsidSsp p_appPermissions,
                                                                         in template (value) VerificationKeyIndicator p_verifyKeyIndicator,
                                                                         in template (omit) ValidityPeriod p_validityPeriod := omit,
                                                                         in template (omit) GeographicRegion p_region := omit,
                                                                         in template (omit) SubjectAssurance p_assuranceLevel := omit,
                                                                         in template (omit) PublicEncryptionKey p_encryptionKey := omit
        ) := { 
            id                     := p_id,
            cracaId                := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2
            crlSeries              := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3
            validityPeriod         := p_validityPeriod,
            region                 := p_region,
            assuranceLevel         := p_assuranceLevel,
            appPermissions         := p_appPermissions,
            certIssuePermissions   := omit,
            certRequestPermissions := omit, 
            canRequestRollover     := omit,
            encryptionKey          := p_encryptionKey,
            verifyKeyIndicator     := p_verifyKeyIndicator
        } // End of template m_toBeSignedCertificate_ea
        
        /**
         * @desc Send template for ToBeSignedCertificate with Enrolment credential restrictions
         * @see ETSI TS 103 097 V1.3.1 Clause 7.2.2 Enrolment credential
         */
        template ToBeSignedCertificate mw_toBeSignedCertificate_ea(
                                                                   template (present) CertificateId p_id := ?,
                                                                   template (present) SequenceOfPsidSsp p_appPermissions := ?,
                                                                   template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?,
                                                                   template ValidityPeriod p_validityPeriod := *,
                                                                   template GeographicRegion p_region := *,
                                                                   template SubjectAssurance p_assuranceLevel := *,
                                                                   template PublicEncryptionKey p_encryptionKey := *
        ) := { 
            id                     := p_id,
            cracaId                := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2
            crlSeries              := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3
            validityPeriod         := p_validityPeriod,
            region                 := p_region,
            assuranceLevel         := p_assuranceLevel,
            appPermissions         := p_appPermissions,
            certIssuePermissions   := *,
            certRequestPermissions := *, 
            canRequestRollover     := *,
            encryptionKey          := p_encryptionKey,
            verifyKeyIndicator     := p_verifyKeyIndicator
        } // End of template mw_toBeSignedCertificate_ea
        
        /**
        /**
         * @desc Send template for ToBeSignedCertificate with AT restrictions
         * @desc Send template for ToBeSignedCertificate with AT restrictions
         * @see ETSI TS 103 097 V1.3.1 Clause 7.2.1 Authorization tickets
         * @see ETSI TS 103 097 V1.3.1 Clause 7.2.1 Authorization tickets
@@ -1103,7 +1155,6 @@ module LibItsSecurity_Templates {
        template (omit) ToBeSignedCertificate m_toBeSignedCertificate_at(
        template (omit) ToBeSignedCertificate m_toBeSignedCertificate_at(
                                                                         in template (value) SequenceOfPsidSsp p_appPermissions,
                                                                         in template (value) SequenceOfPsidSsp p_appPermissions,
                                                                         in template (value) VerificationKeyIndicator p_verifyKeyIndicator,
                                                                         in template (value) VerificationKeyIndicator p_verifyKeyIndicator,
                                                                         in template (omit) SequenceOfPsidGroupPermissions p_certRequestPermissions := omit,
                                                                         in template (omit) ValidityPeriod p_validityPeriod := omit,
                                                                         in template (omit) ValidityPeriod p_validityPeriod := omit,
                                                                         in template (omit) GeographicRegion p_region := omit,
                                                                         in template (omit) GeographicRegion p_region := omit,
                                                                         in template (omit) SubjectAssurance p_assuranceLevel := omit,
                                                                         in template (omit) SubjectAssurance p_assuranceLevel := omit,
@@ -1117,12 +1168,38 @@ module LibItsSecurity_Templates {
            assuranceLevel         := p_assuranceLevel,
            assuranceLevel         := p_assuranceLevel,
            appPermissions         := p_appPermissions,
            appPermissions         := p_appPermissions,
            certIssuePermissions   := omit,
            certIssuePermissions   := omit,
            certRequestPermissions := p_certRequestPermissions, 
            certRequestPermissions := omit, 
            canRequestRollover     := omit,
            canRequestRollover     := omit,
            encryptionKey          := p_encryptionKey,
            encryptionKey          := p_encryptionKey,
            verifyKeyIndicator     := p_verifyKeyIndicator
            verifyKeyIndicator     := p_verifyKeyIndicator
        } // End of template m_toBeSignedCertificate_at
        } // End of template m_toBeSignedCertificate_at
        
        
        /**
         * @desc Send template for ToBeSignedCertificate with AT restrictions
         * @see ETSI TS 103 097 V1.3.1 Clause 7.2.1 Authorization tickets
         */
        template ToBeSignedCertificate mw_toBeSignedCertificate_at(
                                                                   template (present) SequenceOfPsidSsp p_appPermissions := ?,
                                                                   template (present) VerificationKeyIndicator p_verifyKeyIndicator := ?,
                                                                   template ValidityPeriod p_validityPeriod := *,
                                                                   template GeographicRegion p_region := *,
                                                                   template SubjectAssurance p_assuranceLevel := *,
                                                                   template PublicEncryptionKey p_encryptionKey := *
        ) := { 
            id                     := { none_ := NULL },
            cracaId                := '000000'O, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 2
            crlSeries              := 0, // ETSI TS 103 097 V1.3.1 Clause 6 Bullet 3
            validityPeriod         := p_validityPeriod,
            region                 := p_region,
            assuranceLevel         := p_assuranceLevel,
            appPermissions         := p_appPermissions,
            certIssuePermissions   := *,
            certRequestPermissions := *, 
            canRequestRollover     := *,
            encryptionKey          := p_encryptionKey,
            verifyKeyIndicator     := p_verifyKeyIndicator
        } // End of template mw_toBeSignedCertificate_at
        
    } // End of toBeSignedCertificate
    } // End of toBeSignedCertificate
    
    
    group keys {
    group keys {
@@ -1163,6 +1240,30 @@ module LibItsSecurity_Templates {
            ecdsaNistP256 := p_ecdsaNistP256
            ecdsaNistP256 := p_ecdsaNistP256
        } // End of template mw_publicVerificationKey_ecdsaNistP256
        } // End of template mw_publicVerificationKey_ecdsaNistP256
        
        
        template (value) PublicVerificationKey m_publicVerificationKey_ecdsaBrainpoolP256(
                                                                                          in template (value) EccP256CurvePoint p_ecdsaBrainpoolP256r1
        ) := { 
            ecdsaBrainpoolP256r1 := p_ecdsaBrainpoolP256r1
        } // End of template m_publicVerificationKey_ecdsaBrainpoolP256
        
        template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaBrainpoolP256(
                                                                                             template (present) EccP256CurvePoint p_ecdsaBrainpoolP256r1 := ?
        ) := { 
            ecdsaBrainpoolP256r1 := p_ecdsaBrainpoolP256r1
        } // End of template mw_publicVerificationKey_ecdsaBrainpoolP256
        
        template (value) PublicVerificationKey m_publicVerificationKey_ecdsaBrainpoolP384(
                                                                                          in template (value) EccP384CurvePoint p_ecdsaBrainpoolP384r1
        ) := { 
            ecdsaBrainpoolP384r1 := p_ecdsaBrainpoolP384r1
        } // End of template m_publicVerificationKey_ecdsaBrainpoolP384
        
        template (present) PublicVerificationKey mw_publicVerificationKey_ecdsaBrainpoolP384(
                                                                                             template (present) EccP384CurvePoint p_ecdsaBrainpoolP384r1 := ?
        ) := { 
            ecdsaBrainpoolP384r1 := p_ecdsaBrainpoolP384r1
        } // End of template mw_publicVerificationKey_ecdsaBrainpoolP384
        
    } // End of group keys
    } // End of group keys
    
    
    group appPermissions {
    group appPermissions {