Name Property
Name
Get-property witch serves as the unique identifier for the credential.
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | A required parameter is missing or the name exceeds the maximum length. |
Remarks
The Name prevents collisions between different accounts with different providers that might be identified using the same account name, e.g. the user's email address. The Name is created from Period, Issuer and Account Name with the following format: "period/issuer:account". If Period is a default value (30seconds), or the credential's type is HOTP, it'll be: "issuer:account". Also, if Issuer is not specified, the format will be: "period/account" or just "account" for TOTP with default period or HOTP credentials.
At a minimum, this member requires AccountName and Type to be set. The Type
cannot
be None. Also, if Type
is set to Totp, then
Period cannot be null
nor Undefined.
There is a maximum length allowed for the Name (64 bytes in UTF-8 encoding, see Yubico.YubiKey.Oath.Credential.MaximumNameLength). To avoid an exception from being thrown due to invalid length, IsValidNameLength can be called first. If the total length is too long, Issuer and/or AccountName should be shortened.