Interface ISmartkey
Smartkeys are the core building block of Smartcrypt encryption. These contain all the useful information about the underlying cryptographic key.
ISmartkey
s are passive object. They do not update in real time, they do not perform complex logic.
Smartkeys typically want to be used or monitored in an IObservable<T> as that will ensure that
your application is working with the latest key information.
Namespace: PKWARE.Smartcrypt.KeyManagement.Smartkeys
Assembly: SmartcryptKeyManagement.dll
Syntax
public interface ISmartkey
Properties
CanDecrypt
true
if this user is allowed to decrypt using this smartkey. If false
, attempts to retrieve
the decryption key with throw an exception.
Declaration
bool CanDecrypt { get; }
Property Value
Type | Description |
---|---|
Boolean |
CanEncrypt
true
if this user is allowed to encrypt using this smartkey. If false
, attempts to retrieve
the encryption key will throw an exception.
Declaration
bool CanEncrypt { get; }
Property Value
Type | Description |
---|---|
Boolean |
CanManage
true
if this user is allowed to modify this smartkey. If false
, attempts at modification will
result in errors.
Declaration
bool CanManage { get; }
Property Value
Type | Description |
---|---|
Boolean |
Features
May be empty.
Declaration
[NotNull]
IReadOnlyList<Feature> Features { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<Feature> |
Key
Returns the AES key matching the current Revision.
Declaration
[NotNull]
byte[] Key { get; }
Property Value
Type | Description |
---|---|
Byte[] |
Exceptions
Type | Condition |
---|---|
MetaClientException | If not allowed to encrypt using this key. See CanEncrypt. |
Name
Useful for displaying in UIs. May change over time, so not good for programmatic filtering. May be empty, indicating that human users should not be aware of this Smartkey.
Declaration
[NotNull]
string Name { get; }
Property Value
Type | Description |
---|---|
String |
Participants
May be empty.
Declaration
[NotNull]
IReadOnlyList<KnownUser> Participants { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<KnownUser> |
Revision
Of the highest AES key this Smartkey manages.
Declaration
int Revision { get; }
Property Value
Type | Description |
---|---|
Int32 |
Urn
A globally unique identifier for this Smartkey. The Urn for a Smartkey will never change.
Declaration
[NotNull]
string Urn { get; }
Property Value
Type | Description |
---|---|
String |
Methods
GetKeyForDecryption(Int32)
Declaration
[CanBeNull]
byte[] GetKeyForDecryption(int revision)
Parameters
Type | Name | Description |
---|---|---|
Int32 | revision |
Returns
Type | Description |
---|---|
Byte[] | if no key is available for the given revision. |
Exceptions
Type | Condition |
---|---|
MetaClientException | If this key is not allowed to be used for decryption. See CanDecrypt. |