EncodeHmacSecretExtension Method
EncodeHmacSecretExtension(PinUvAuthProtocolBase)
Encode the "hmac-secret" extension. This call will be valid only if the RequestHmacSecretExtension(ReadOnlyMemory<Byte>, Nullable<ReadOnlyMemory<Byte>>) has been called, and the Encapsulate(CoseKey) method has been successfully called. The hmac-secret extension must be encoded before calling the GetAssertionCommand.
Note
If you use GetAssertions(GetAssertionParameters) to get any assertion, you do not need to call this method.
public void EncodeHmacSecretExtension(PinUvAuthProtocolBase authProtocol)
Parameters
Type | Name | Description |
---|---|---|
PinUvAuthProtocolBase | authProtocol | An instance of one of the subclasses of |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
System.InvalidOperationException | The Encapsulate method for the |
Remarks
If you want the hmac-secret extension value returned along with the
assertion, then call the RequestHmacSecretExtension
method
with a salt. If you will be using the GetAssertionCommand
to
get the assertion, then you must call this method to encode the
extension. The authProtocol
you supply must be an object for
which the
Encapsulate(CoseKey) method
has been called.
If the RequestHmacSecretExtension
method has not been called,
this method will do nothing. If it has been called, but the
authProtocol
has not been encapsulated, this method will throw
an exception.
The result of this method is stored inside this object. If there is already an encoded hmac-secret extension in the object, this method will build a new one and replace the old one. This might be necessary if a new authenticator public key is retrieved since the last time this method has been called.
See also the documentation for the RequestHmacSecretExtension(ReadOnlyMemory<Byte>, Nullable<ReadOnlyMemory<Byte>>) method, which also includes some code samples.