fido2.attestation
Submodules
Exceptions
Attestation contains invalid data. |
|
The signature of the attestation could not be verified. |
|
The attestation format is not supported. |
|
The CA of the attestation is not trusted. |
Classes
Implements verification of a specific attestation type. |
|
Implements verification of a specific attestation type. |
|
Supported attestation types. |
|
The result of verifying an attestation. |
|
Implements verification of a specific attestation type. |
|
Base class for verifying attestation. |
|
Implements verification of a specific attestation type. |
|
Implements verification of a specific attestation type. |
|
Implements verification of a specific attestation type. |
|
Implements verification of a specific attestation type. |
|
Implements verification of a specific attestation type. |
Functions
|
Verifies a chain of certificates. |
Package Contents
- class fido2.attestation.Attestation[source]
Bases:
abc.ABC
Implements verification of a specific attestation type.
- abstract verify(statement, auth_data, client_data_hash)[source]
Verifies attestation statement.
- Returns:
An AttestationResult if successful.
- Parameters:
statement (Mapping[str, Any])
auth_data (fido2.webauthn.AuthenticatorData)
client_data_hash (bytes)
- Return type:
- static for_type(fmt)[source]
Get an Attestation subclass type for the given format.
- Parameters:
fmt (str)
- Return type:
Type[Attestation]
- class fido2.attestation.NoneAttestation[source]
Bases:
Attestation
Implements verification of a specific attestation type.
- FORMAT = 'none'
- class fido2.attestation.AttestationType[source]
Bases:
enum.IntEnum
Supported attestation types.
- BASIC = 1
- SELF = 2
- ATT_CA = 3
- ANON_CA = 4
- NONE = 0
- class fido2.attestation.AttestationResult[source]
The result of verifying an attestation.
- attestation_type: AttestationType
- exception fido2.attestation.InvalidData[source]
Bases:
InvalidAttestation
Attestation contains invalid data.
- exception fido2.attestation.InvalidSignature[source]
Bases:
InvalidAttestation
The signature of the attestation could not be verified.
- exception fido2.attestation.UnsupportedType(auth_data, fmt=None)[source]
Bases:
InvalidAttestation
The attestation format is not supported.
- auth_data
- fmt
- class fido2.attestation.UnsupportedAttestation(fmt=None)[source]
Bases:
Attestation
Implements verification of a specific attestation type.
- fmt
- exception fido2.attestation.UntrustedAttestation[source]
Bases:
InvalidAttestation
The CA of the attestation is not trusted.
- fido2.attestation.verify_x509_chain(chain)[source]
Verifies a chain of certificates.
Checks that the first item in the chain is signed by the next, and so on. The first item is the leaf, the last is the root.
- Parameters:
chain (List[bytes])
- Return type:
None
- class fido2.attestation.AttestationVerifier(attestation_types=None)[source]
Bases:
abc.ABC
Base class for verifying attestation.
Override the ca_lookup method to provide a trusted root certificate used to verify the trust path from the attestation.
- Parameters:
attestation_types (Optional[Sequence[Attestation]])
- abstract ca_lookup(attestation_result, auth_data)[source]
Lookup a CA certificate to be used to verify a trust path.
- Parameters:
attestation_result (AttestationResult) – The result of the attestation
auth_data (fido2.webauthn.AuthenticatorData) – The AuthenticatorData from the registration
- Return type:
Optional[bytes]
- verify_attestation(attestation_object, client_data_hash)[source]
Verify attestation.
- Parameters:
attestation_object (fido2.webauthn.AttestationObject) – dict containing attestation data.
client_data_hash (bytes) – SHA256 hash of the ClientData bytes.
- Return type:
None
- class fido2.attestation.AppleAttestation[source]
Bases:
fido2.attestation.base.Attestation
Implements verification of a specific attestation type.
- FORMAT = 'apple'
- class fido2.attestation.AndroidSafetynetAttestation(allow_rooted=False)[source]
Bases:
fido2.attestation.base.Attestation
Implements verification of a specific attestation type.
- Parameters:
allow_rooted (bool)
- FORMAT = 'android-safetynet'
- allow_rooted
- class fido2.attestation.PackedAttestation[source]
Bases:
fido2.attestation.base.Attestation
Implements verification of a specific attestation type.
- FORMAT = 'packed'
- class fido2.attestation.FidoU2FAttestation[source]
Bases:
fido2.attestation.base.Attestation
Implements verification of a specific attestation type.
- FORMAT = 'fido-u2f'