Retrieving an object
Retrieving an unencrypted object
Use the store's get function to retrieve an object.
Retrieving an encrypted object
GetAndDecrypt.Done done = new GetAndDecrypt.Done() {
void onGetAndDecryptDone(@NonNull CondensationObject object) {
// The object was found and decrypted
}
void onGetAndDecryptInvalid(@NonNull String reason) {
// The object was not found
}
void onGetAndDecryptFailed(@NonNull String error) {
// The store reported an error
}
};
new GetAndDecrypt(reference, store, keyPair, done);
var done = keyPair.getAndDecrypt(reference, store);
done.onDone = function(object) {
// The object was found and decrypted
};
done.onInvalid = function(reason) {
// The object was not found
};
done.onFailed = function(error) {
// The store reported an error
};
my ($object, $invalidReason, $storeError) = $keyPair->getAndDecrypt($reference, $store);
if (defined $storeError) {
# The store reported an error
} elsif (defined $invalidReason) {
# The object was not found
} else {
# The object was found and decrypted
}
Retrieves an object from a store and decrypts it.
If the store reported an error, the operation fails with that error. It may succeed when called again at a later time.
If the object is not found, the operation fails as invalid.