Credential Constructor
Credential(CryptographicKeyType, string, bool)
Constructs an instance of the Credential class with the provided arguments.
public Credential(CryptographicKeyType keyType, string label, bool touchRequired)
Parameters
Type | Name | Description |
---|---|---|
CryptographicKeyType | keyType |
|
string | label |
The string only contains characters that can be encoded with UTF-8,
and its UTF-8 byte count is between MinLabelByteCount
and MaxLabelByteCount. Non-printing characters are
allowed, as long as they can be encoded with UTF-8. For example,
null (UTF-8: 0x00) and Right-To-Left Mark U+200F (UTF-8: 0xE2 0x80
0x8F) would be acceptable.
The System.Text.UTF8Encoding class contains methods such as
System.Text.UTF8Encoding.GetByteCount(string) which can be used
to validate the string prior to attempting to set it here. It is
recommended to use the constructor
System.Text.UTF8Encoding.UTF8Encoding(bool, bool) so error detection is
enabled for invalid characters.
|
bool | touchRequired |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown when |
ArgumentOutOfRangeException | Thrown when |
Credential()
Constructs an instance of the Credential class.
public Credential()
Remarks
This constructor is provided to allow for object-initializer syntax. The default values are not guaranteed to be valid, so all properties should be set manually.