Security |
The SecurityKey type exposes the following members.
Name | Description | |
---|---|---|
SecurityKey(SecureString) | Constructs a SecurityKey object using the string security key held by the SecureString passed in, or throws a FormatException if the string is clearly invalid. | |
SecurityKey(String) | Constructs a SecurityKey object using the specified string security key or throws a FormatException if the string is clearly invalid. |
Name | Description | |
---|---|---|
Equals |
A SecurityKey object can only be equal to a
SecurityKey object based around the same canonical security key.
(Overrides ObjectEquals(Object)) | |
GetBytes | Returns a new, non-null byte array containing the canonical security key's characters encoded into bytes using the UTF-8 character set. | |
GetHashCode |
Overridden to ensure consistency with Equals.
(Overrides ObjectGetHashCode) | |
ToString |
Returns a non-null, non-empty string indicating that this is a
SecurityKey object, but not giving any indication
as to what the security key actually is.
(Overrides ObjectToString) | |
ToStringKey | Returns the non-null, non-empty, canonical string security key. |
Each API account has two access keys: an account key and a security key. The security key is a private key that should be kept secret. In this respect it is like a password. The only entities that should have access to the security key are: Degree Days.net (systems and staff), the API account holder(s), and any trusted software systems that the API account holder(s) are using to manage their interactions with the API.
Here's an example of a security key:
b79h-tmgg-dwv5-cgxq-j5k9-n34w-mvxv-b5be-kqp5-b6hb-3bey-h5gg-swwd
Like the example above, all security keys are made up of thirteen 4-character blocks separated by hyphens, with each non-hyphen character being one of the following:
abcdefghjkmnpqrstuvwxyz23456789
Security keys do not contain upper-case characters or any of the following easily-confused letters and digits: 'i', 'l', 'o', '0' and '1'. The same is true of account keys (the other type of access key). The intention is to make these keys easy for non-technical users to handle (e.g. if entering them into software that you've made for them).
A SecurityKey object is a wrapper around the characters that constitute a string security key. It is useful for validating security keys from user input, since the constructors will only allow a SecurityKey object to be created with a string of the correct format or a string that can be manipulated into the correct format without too much ambiguity.