eu-digital-green-certificates / dgc-overview

This repository provides an overview over the EU Digital Green Certificates (DGC) project.
Apache License 2.0
209 stars 29 forks source link

Signing algorithm #26

Closed PeterEbraert closed 3 years ago

PeterEbraert commented 3 years ago

In the guidelines on the certificate governance (section 4.1.1), it is stated that Elliptic Curve "SHOULD BE" used. It is stated that RSA-PSS "SHOULD NOT" be used. At the moment, our PKI does not support either algorithm. We do support RSA-PKCS#1. Can we use RSA-PKCS#1 for the DSC-certificate? It is not explicitely stated for the DSC-certificate. For the other certificates (upload, TLS, DSCA) it is stated that you can use RSA-PKCS#1. Is it also allowed for the DSC-certificate?

Can the DSC-certificate contain an extended key usage "1.3.6.1.5.5.7.3.2" (clientAuth)?

psavva commented 3 years ago

Maybe this helps you Peter? https://github.com/eu-digital-green-certificates/dgc-participating-countries/blob/main/gateway/CertificatePreperation.md#rsa-public-key-certificates

Best Regards Panayiotis Savva

FayR-DTSEC commented 3 years ago

Dear Peter,

maybe I can provide some more insights.

It seems that you confuse the algorithm that the Document Signer (the entity that holds the document signer certificate (DSC)) uses to sign the digital green certificate with the algorithm that the CSCA uses to sign the DSC certificate. It is recommended that the Document Signer uses ECDSA, hence he should hold a public key certificate that contains an EC public key. However, this certificate can be signed with RSA PKCS#1 v1.5 padding.

The certificateGovernance contains requirements for the DSC signature algorithm in Section 4.1 pointing to the Technical Specifications for Digital Green Certificates Volume 1 - Section 3.3.2. This document states that the Document Signer MUST use either ECDSA or RSA-PSS for his digital signatures.

The algorithm that the CSCA uses to sign the DSC certificate depends on the key of the CSCA and can be independent from the DSC signature algorithm.

PeterEbraert commented 3 years ago

Thanks for the response. So now

Just to confirm, 2 questions:

FayR-DTSEC commented 3 years ago

Dear Peter,

please be aware that there are two signature schemes defined in RSA PKCS#1 with different padding. The first one is the legacy padding, often called RSA PKCS#1 v1.5 (often used to sign public key certificates). The RSA signature scheme that is called RSA-PSS (or RSASSA-PSS for RSA Signature Scheme with Appendix Probabilistic Signature Scheme) was defined in PKCS#1 >= v2. The most recent version of PKCS#1 is v2.2 and it can be found in RFC8017.

The digital signature that you apply at your Document Signer with COSE should be PS256 in case of RSA, which is RSASSA-PSS as of RFC 8230 (this was defined in Technical Specifications for Digital Green Certificates Volume 1 - Section 3.3.2.). In case you use PS256 (aka RSA-PSS) you should not use keys > 3000 Bit due to the space limitations of the QR code.

Hope this helps.

Best regards

Robin

PeterEbraert commented 3 years ago

Thanks for the responses. Clear now. Two more querstions:

daniel-eder commented 3 years ago

I believe the signing algorithm is now clarified, if new questions arise please open a new issue