Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add key attestations #389

Open
wants to merge 48 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6da765e
first draft for key attestation
paulbastian Sep 6, 2024
876c29c
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Sep 10, 2024
feced43
Apply suggestions from code review
paulbastian Sep 17, 2024
56e26fc
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Sep 20, 2024
7c0baa3
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Sep 20, 2024
a96b09b
Apply suggestions from code review
paulbastian Sep 23, 2024
f5db4bf
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Sep 23, 2024
6e3a118
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Sep 23, 2024
64878e0
use key attestation in JWT proof type
paulbastian Sep 23, 2024
1932f71
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 1, 2024
3c15c3c
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 1, 2024
ef84be4
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 1, 2024
bfa2a26
adding metadata and text for apr
paulbastian Oct 1, 2024
8a8dcfd
text for two methods of using key attestation
paulbastian Oct 3, 2024
42de92f
add new proof type for key attestation
c2bo Oct 3, 2024
1b98041
add document history entry for key attestation
c2bo Oct 3, 2024
23c8762
fix reference for attestation proof type
c2bo Oct 3, 2024
7735e1c
add references to key attestation usage
c2bo Oct 3, 2024
05aa467
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 8, 2024
246e083
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 10, 2024
33612a3
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 10, 2024
4e6dc79
Apply suggestions from code review
paulbastian Oct 10, 2024
1f9e94b
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 10, 2024
1131416
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 10, 2024
f71e748
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 10, 2024
4b3c00d
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 11, 2024
c148e8c
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 11, 2024
4d803c0
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 11, 2024
f9cfdba
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 11, 2024
b004300
Apply suggestions from code review
paulbastian Oct 11, 2024
638cc52
Apply suggestions from code review
paulbastian Oct 11, 2024
3c6bb15
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 11, 2024
02aaaa9
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 11, 2024
0641305
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 11, 2024
5677f13
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 11, 2024
19b7815
simplify text in security consideration
paulbastian Oct 11, 2024
e7c882e
Apply suggestions from code review
paulbastian Oct 14, 2024
00224dc
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 14, 2024
28f282b
Apply suggestions from code review
paulbastian Oct 15, 2024
0fc69ef
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 15, 2024
30f32fc
Apply suggestions from code review
paulbastian Oct 18, 2024
e71e851
guidance to use all attested keys in jwt proof type
paulbastian Oct 21, 2024
996139e
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 22, 2024
799b9d3
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 22, 2024
d840dda
Apply suggestions from code review
paulbastian Oct 24, 2024
77fe221
rename key_type to key_storage_type
paulbastian Oct 24, 2024
e578c84
clarify that key_storage_type and user_authentication values should b…
paulbastian Oct 24, 2024
c20d7f9
Update openid-4-verifiable-credential-issuance-1_0.md
paulbastian Oct 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions openid-4-verifiable-credential-issuance-1_0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2166,6 +2166,89 @@ The following is a non-normative example of a Credential Response containing a C

<{{examples/credential_response_sd_jwt_vc.txt}}

# Key Attestations {#keyattestation}

A key attestation is an interoperable mechanism to proof the authenticity and security properties of a key and its storage component. Keys may be stored in various key storage components, that differ regarding the private key's protection against extraction and duplication as well as the user's authentication to unlock key operations. Key storage components may be software-based or hardware-based and may be on the same device as the wallet, external security tokens or remote services that enable cryptographic key operations.
paulbastian marked this conversation as resolved.
Show resolved Hide resolved

A Wallet may provide key attestations to inform the Issuer about the properties of the provided keys. Credential Issuers may want to evaluate key attestations to decide whether keys are eligible to its own security requirements, which can results from regulatory requirements and laws or internal design decisions. An Issuer SHOULD communicate his requirements through his metadata or out-of-band.
paulbastian marked this conversation as resolved.
Show resolved Hide resolved

paulbastian marked this conversation as resolved.
Show resolved Hide resolved
paulbastian marked this conversation as resolved.
Show resolved Hide resolved
todo: motivate interoperability for issuers
paulbastian marked this conversation as resolved.
Show resolved Hide resolved

todo: explain usage of this within proof type or DPoP Proof

## Key Attestation in JWT format

The JWT is signed by the Wallet Provider or the Wallet's key storage component itself and contains the following elements:

* in the JOSE header,
* `alg`: REQUIRED. A digital signature algorithm identifier such as per IANA "JSON Web Signature and Encryption Algorithms" registry [@IANA.JOSE.ALGS]. It MUST NOT be `none` or an identifier for a symmetric algorithm (MAC).
* `typ`: REQUIRED. MUST be `openid4vci-keyattestation+jwt`, which explicitly types the key proof JWT as recommended in Section 3.11 of [@!RFC8725].
paulbastian marked this conversation as resolved.
Show resolved Hide resolved

The key attestation may use `x5c`, `kid`, `trust_chain` or other mechanisms to convey the public key and the associated trust mechanism to sign the key attestation.
paulbastian marked this conversation as resolved.
Show resolved Hide resolved

* in the JWT body,
* `iat`: REQUIRED (number). Integer for the time at which the key attestation was issued using the syntax defined in [@!RFC7519].
* `exp`: REQUIRED (number). Integer for the time at which the key attestation expires using the syntax defined in [@!RFC7519].
paulbastian marked this conversation as resolved.
Show resolved Hide resolved
* `keys` : REQUIRED. Array of attested keys using the syntax of JWK as defined in [@!RFC7517].
paulbastian marked this conversation as resolved.
Show resolved Hide resolved
* `key_type` : OPTIONAL. String that asserts the key storage component and its security mechanism of attested keys from `keys`. This specification defines initial values in (#keyattestation-keytypes).
paulbastian marked this conversation as resolved.
Show resolved Hide resolved
* `user_authentication` : OPTIONAL. String that asserts the security mechanism the key storage component uses to authenticate the End-User to authorize access to the private key from `keys`. This specification defines initial values in (#keyattestation-auth).
paulbastian marked this conversation as resolved.
Show resolved Hide resolved
* `apr` : OPTIONAL. String that asserts the resistance to a certain attack potential as described
paulbastian marked this conversation as resolved.
Show resolved Hide resolved
* `nonce`: OPTIONAL. String that represents a nonce provided by the Issuer to proof that a key attestation was freshly generated.
paulbastian marked this conversation as resolved.
Show resolved Hide resolved

todo: add optional `status` parameter
paulbastian marked this conversation as resolved.
Show resolved Hide resolved

paulbastian marked this conversation as resolved.
Show resolved Hide resolved
The Credential Issuer MUST validate that the JWT used as a proof is actually signed by a key identified in the JOSE Header.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this object also used for proof type "attestation"? If so, this statement should be conditional.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are correct. @c2bo did you add this text?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is from from your initial commit, but it seems I forgot to change it when introducing the second proof type. We should move this into the jwt proof type text imho.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The Credential Issuer MUST validate that the JWT used as a proof is actually signed by a key identified in the JOSE Header.
If used with the `jwt` proof type, the Credential Issuer MUST validate that the JWT used as a proof is signed by a key contained in the attestation in the JOSE Header.


This is an example of a Wallet Instance Attestation:
paulbastian marked this conversation as resolved.
Show resolved Hide resolved

```json
{
"typ": "openid4vci-keyattestation+jwt",
paulbastian marked this conversation as resolved.
Show resolved Hide resolved
"alg": "ES256",
"kid": "1"
Copy link
Contributor

@nemqe nemqe Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stupid comment, but this kid is a bit confusing for me here in this form, is this referring to a particular key from the attestation or is it just a random value for the sake of the example?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This jwt would be signed by the Wallet Backend or the key storage directly - it cannot be referring to a key from the attestation. But it might make sense to change it to x5c for the example to avoid confusion?

Suggested change
"kid": "1"
"x5c": ["MIIDQjCCA..."]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would just point out this thing if it makes sense.

https://openid.github.io/OpenID4VCI/openid-4-verifiable-credential-issuance-wg-draft.html#section-8.2-2.3.1 says:

Object providing a single proof of possession of the cryptographic key material to which the issued Credential instance will be bound to...

Not sure if this will be in conflict because now credentials are not then bound to the key doing the proof or possession

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! We probably need to adapt those lines describing proofs and proof a bit. We still get a proof that the wallet is in possession of the key(s), it just doesn't have to be a proof of possession.

}
.
{
"iss": "<identifier of the issuer of this key attestation>",
"iat": 1516247022,
paulbastian marked this conversation as resolved.
Show resolved Hide resolved
"exp": 1541493724,
"key_type": "strong_box",
paulbastian marked this conversation as resolved.
Show resolved Hide resolved
"user_authentication": "system_pin",
paulbastian marked this conversation as resolved.
Show resolved Hide resolved
"apr" : "https://trust-list.eu/apr/high",
paulbastian marked this conversation as resolved.
Show resolved Hide resolved
"keys": [
paulbastian marked this conversation as resolved.
Show resolved Hide resolved
{
"kty": "EC",
"crv": "P-256",
"x": "TCAER19Zvu3OHF4j4W4vfSVoHIP1ILilDls7vCeGemc",
"y": "ZxjiWWbZMQGHVWKVQ4hbSIirsVfuecCE6t4jT9F2HZQ"
}
]
}
```

## Key Types {#keyattestation-keytypes}

This specification defines the following values for `key_type`:
paulbastian marked this conversation as resolved.
Show resolved Hide resolved

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without any further information or references, I believe it is almost impossible for a reader to know what Trusted Execution Environment or Secure Element mean. If they are supposed to refer to Android and iOS concepts, should we include explicit references or description.

If the OpenID4VCI spec defines these identifiers then it also need to define its meaning in a usable way.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, references are needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The best reference I was able to find was section 3.3 of ISO 27071 (https://www.iso.org/obp/ui/en/#iso:std:iso-iec:27071:ed-1:v1:en) for the general descriptions and then reference ios (secure enclace) and android (strong box) directly?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an additional question, what is meant with secure_element? Is that an abstraction to unify the Android and iOS concepts (secure_enclave and strong_box)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say both secure enclave and strong box are subtypes of a secure element.
In general I would say, a secure element is a security chip/component that provides a secure platform that is capable of securely running applications and storing its confidential data (keys etc).

Copy link
Contributor Author

@paulbastian paulbastian Oct 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trusted Execution Environments are isolated secured processing areas on a common purpose main processor running its own operating system.
Secure Elements usually refers to Common Criteria certified chips that use ISO7816 or ISO14443 from the smartcard industry.

I agree that we would use some references and further explanations for the key types

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think there were specs for TEE in their own standards body, right?

Copy link
Contributor

@awoie awoie Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is a rabbit hole but to be even more specific, Secure Elements themselves can also comply to different Common Criteria protection profiles which means they can have different characteristics, i.e., not all of them are equally secure, and some of them don't even comply to any since they didn't perform certification.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@awoie that's correct. That's why the apr claim is actually the most interesting one, but for some this is hard to measure and some people will not have the security background to know what it actually means, that's why I put key_storage_type and user_authentication as a more approachable/easy way to describe the key storage component

* `software`: It MUST be used when the Wallet uses software-based key management.
* `tee`: It SHOULD be used when the Wallet uses the Trusted Execution Environment for key management.
* `secure_enclave`: It SHOULD be used when the Wallet uses the Secure Enclave for key management.
* `strong_box`: It SHOULD be used when the Wallet uses the Strongbox for key management.
* `secure_element`: It SHOULD be used when the Wallet uses a Secure Element for key management.
paulbastian marked this conversation as resolved.
Show resolved Hide resolved
* `hsm`: It SHOULD be used when the Wallet uses Hardware Security Module (HSM).
paulbastian marked this conversation as resolved.
Show resolved Hide resolved

paulbastian marked this conversation as resolved.
Show resolved Hide resolved
## User Authentication Types {#keyattestation-auth}

This specification defines the following values for `user_authentication`:

* `system_biometry`: It MUST be used when the key usage is authorized by the mobile operating system using a biometric factor.
c2bo marked this conversation as resolved.
Show resolved Hide resolved
paulbastian marked this conversation as resolved.
Show resolved Hide resolved
* `system_pin`: It MUST be used when the key usage is authorized by the mobile operating system using personal identification number (PIN).
* `internal_biometry`: It MUST be used when the key usage is authorized by the Wallet using a biometric factor.
* `internal_pin`: It MUST be used when the key usage is authorized by the Wallet using PIN.
* `secure_element_pin` It MUST be used when the key usage is authorized by the secure element managing the key itself using PIN.
paulbastian marked this conversation as resolved.
Show resolved Hide resolved

todo: text about Level of assurance and attack potential resistance

# IANA Considerations

## Sub-Namespace Registration
Expand Down
Loading