Click or drag to resize
SecurityKey Class
The longer of the two access keys that are needed to use the Degree API.
Inheritance Hierarchy

Namespace: DegreeDays.Api
Assembly: DegreeDaysApi (in DegreeDaysApi.dll) Version: (
public sealed class SecurityKey

The SecurityKey type exposes the following members.

Public methodSecurityKey(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.
Public methodSecurityKey(String)
Constructs a SecurityKey object using the specified string security key or throws a FormatException if the string is clearly invalid.
Public methodEquals
A SecurityKey object can only be equal to a SecurityKey object based around the same canonical security key.
(Overrides ObjectEquals(Object).)
Public methodGetBytes
Returns a new, non-null byte array containing the canonical security key's characters encoded into bytes using the UTF-8 character set.
Public methodGetHashCode
Overridden to ensure consistency with Equals.
(Overrides ObjectGetHashCode.)
Public methodToString
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.)
Public methodToStringKey
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 (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:


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:


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.

See Also