Getting Attributes of a Key
Call the GetKeyAttributes method to retrieve the attributes of a key.
NaeKeyManagement nkm = new NaeKeyManagement(session);
Dictionary<string, object> SystemAttr = new Dictionary<string, object>();
Dictionary<string, object> CustomAttr = new Dictionary<string, object>();
nkm.GetKeyAttributes(session, keyname, SystemAttr, CustomAttr);
You can also retrieve the information for a specific key version by using version number prefix (#versionNumber).
The following table lists the attributes returned by this method with description.
| Attribute | Description |
|---|---|
| KeyName | Contains the subject of the query. |
| Keybits | Contains the key size. |
| KeySize | Contains the key size. |
| Algorithms | Lists the set of algorithms with which this key can be used. |
| Algorithm | Contains a standard identifier string for the cryptographic algorithm. See Supported Key Algorithms for more information on supported algorithms and key sizes. |
| Versioned | Indicates that the key is a versioned key. |
| Exportable | Indicates that the key is exportable. |
| Deletable | Indicates that the key is deletable. |
| Encrypt | Indicates that the key is capable of encryption. Only present and applicable for symmetric keys. |
| Decrypt | Indicates that the key is capable of decryption. Only present and applicable for symmetric keys. |
| Sign | Indicates that the key is capable of creating signatures. |
| SignV | Indicates that the key is capable of verifying signatures. |
| MAC | Indicates that the key is capable of creating MACs. |
| MACV | Indicates that the key is capable of verifying MACs. |
| UsePublic | Indicates that the public portion of the key can encrypt data. Only present and applicable for asymmetric keys. |
| UsePrivate | Indicates that the private portion of the key can decrypt data. Only present and applicable for asymmetric keys. |
| Fingerprint | The key's fingerprint. |
| DefaultIVBase16 | The default IV of the key. |
| KeyVersionNumber | The version number of this key. |
| KeyVersion State | The state of the key version. |
| NumKey Versions | The total number of key versions for this key. |
| NumActive Versions | The number of versions in the active state. |
| NumRestricted Versions | The number of versions in the restricted state. |
| NumRetired Versions | The number of versions in the retired state. |
| NumWipedVersions | The number of versions in the wiped state. |
| CustomAttributeList | List of custom attributes. The actual values are base64 encoded. This element is not included if the key does not have any associated custom attributes. |
| KeyCreationDate | The key's creation date and time. The creation date and time displays according to the time zone set on the CipherTrust Application Data Protection for .NET Core. |
| IsOwner | Present if the User issuing the KeyInfoRequest command is the Key Owner. |