public abstract class AbstractSmartkey extends Object implements Smartkey
Modifier and Type | Method and Description |
---|---|
boolean |
canDecrypt() |
boolean |
canEncrypt() |
boolean |
canManage() |
List<Feature> |
getFeatures() |
SecretKey |
getKey() |
SecretKey |
getKeyForDecryption(int revision) |
String |
getName()
Useful for displaying in UIs.
|
List<KnownUser> |
getParticipants() |
int |
getRevision() |
String |
getUrn()
The URN for a Smartkey will never change.
|
String |
toString() |
@Nonnull public String getName()
Smartkey
@Nonnull public String getUrn()
Smartkey
@Nonnull public SecretKey getKey() throws MetaClientException
getKey
in interface Smartkey
Smartkey.getRevision()
MetaClientException
- if not allowed to encrypt using this keySmartkey.canEncrypt()
public int getRevision()
getRevision
in interface Smartkey
@Nonnull public List<Feature> getFeatures()
getFeatures
in interface Smartkey
@Nonnull public List<KnownUser> getParticipants()
getParticipants
in interface Smartkey
public boolean canManage()
public boolean canEncrypt()
canEncrypt
in interface Smartkey
true
if this user is allowed to encrypt using this smartkey. If
false
, attempts to retrieve the encryption key will throw an exception.public boolean canDecrypt()
canDecrypt
in interface Smartkey
true
if this user is allowed to decrypt using this smartkey. If
false
, attempts to retrieve the decryption key with throw an exception.@Nullable public SecretKey getKeyForDecryption(int revision) throws MetaClientException
getKeyForDecryption
in interface Smartkey
null
if no key is available for the given revisionMetaClientException
- if this key is not allowed to be used for decryptionSmartkey.canDecrypt()