Class AuthenticatorAttestationResponse
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The AuthenticatorAttestationResponse interface of the Web Authentication API is the result of a WebAuthn credential registration. It contains information about the credential that the server needs to perform WebAuthn assertions, such as its credential ID and public key.
[Value("AuthenticatorAttestationResponse")]
public class AuthenticatorAttestationResponse : AuthenticatorResponse
- Inheritance
-
AuthenticatorAttestationResponse
- Inherited Members
Remarks
An AuthenticatorAttestationResponse object instance is available in the Response property of a PublicKeyCredential object returned by a successful Create(CredentialCreationOptions) call.
This interface inherits from AuthenticatorResponse.
NOTE
This interface is restricted to top-level contexts. Use of its features from within an iframe element will not have any effect.
-AuthenticatorAssertionResponse: the interface for the type of response given when retrieving an existing credential
-AuthenticatorResponse: the parent interface
Constructors
AuthenticatorAttestationResponse()
public AuthenticatorAttestationResponse()
Properties
AttestationObject
The attestationObject property of the
AuthenticatorAttestationResponse interface returns an
ArrayBuffer containing the new public key, as well as signature over the
entire attestationObject with a private key that is stored in the
authenticator when it is manufactured.
[Value("attestationObject")]
public ArrayBuffer AttestationObject { get; }
Property Value
- ArrayBuffer
After decoding the CBOR encoded
ArrayBuffer, the resulting JavaScript object will contain the following
properties:
Remarks
As part of the Create(CredentialCreationOptions) call, an authenticator will
create a new key pair as well as an attestationObject for that key pair. The public key
that corresponds to the private key that has created the attestation signature is well
known; however, there are various well known attestation public key chains for different
ecosystems (for example, Android or TPM attestations).
-Create(CredentialCreationOptions): the method used to create a statement with
a cryptographic challenge which signature by the authenticator is contained in attStmt,
with the specified attestation transport option.
Methods
GetAuthenticatorData()
The getAuthenticatorData() method of the AuthenticatorAttestationResponse interface returns an {{jsxref("ArrayBuffer")}} containing the authenticator data contained within the AttestationObject property.
[Value("getAuthenticatorData")]
public ArrayBuffer GetAuthenticatorData()
Returns
- ArrayBuffer
An ArrayBuffer with a ArrayBufferByteLength of at least 37 bytes, which contains the data structure explained in Authenticator data.This will be equivalent to the authenticator data contained within the AttestationObject property.
Remarks
This is a convenience function, created to allow easy access to the authenticator data without having to write extra parsing code to extract it from the attestationObject.
GetPublicKey()
The getPublicKey() method of the AuthenticatorAttestationResponse interface returns an {{jsxref("ArrayBuffer")}} containing the DER SubjectPublicKeyInfo of the new credential (see Subject Public Key Info), or null if this is not available.
[Value("getPublicKey")]
public ArrayBuffer? GetPublicKey()
Returns
- ArrayBuffer
An ArrayBuffer containing the DER
SubjectPublicKeyInfoof the new credential (see Subject Public Key Info), ornullif this is not available.
Remarks
This is a convenience function, created to allow easy access to the public key. This key will need to be stored in order to verify future authentication operations (i.e., using Get(CredentialRequestOptions)).
GetPublicKeyAlgorithm()
The getPublicKeyAlgorithm() method of the AuthenticatorAttestationResponse interface returns a number that is equal to a COSE Algorithm Identifier, representing the cryptographic algorithm used for the new credential.
[Value("getPublicKeyAlgorithm")]
public long GetPublicKeyAlgorithm()
Returns
- long
A number that is equal to a COSE Algorithm Identifier, representing the cryptographic algorithm used for the new credential.
Remarks
This is a convenience function created to allow easy access to the algorithm type. This information will need to be stored in order to verify future authentication operations (i.e., using Get(CredentialRequestOptions)).
GetTransports()
The getTransports() method of the AuthenticatorAttestationResponse interface returns an array of strings describing the different transports which may be used by the authenticator.
[Value("getTransports")]
public List<string> GetTransports()
Returns
- List<string>
An Array of strings representing the different transports supported by the authenticator, in lexicographical order.
Values may include:
Remarks
Such transports may be USB, NFC, BLE, internal (applicable when the authenticator is not removable from the device), or a hybrid approach. Sites should not interpret this array but instead store it along with the rest of the credential information. In a subsequent Get(CredentialRequestOptions) call, the transports value(s) specified inside publicKey.allowCredentials should be set to the stored array value. This provides a hint to the browser as to which types of authenticators to try when making an assertion for this credential.