public class KeyFileMapper extends AbstractMapper
Constructor and Description |
---|
KeyFileMapper(Session session)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
createOrUpdate(UUID userId,
String passphrase,
String reminder,
byte[] encryptedKeyFile)
Stores the encrypted keys file on the Absio Broker™ application and protects it with the provided
passphrase.
|
void |
delete()
Deletes an encrypted key file from the Absio Broker™ application.
|
boolean |
doesChecksumMatch(UUID userId,
byte[] encryptedKeyFile)
Generates a checksum of the encrypted keys file and checks if it matches the checksum of a keys file stored on
the Absio Broker™ application.
|
byte[] |
get(UUID userId,
String passphrase)
Retrieves an encrypted keys file stored on the Absio Broker™ application.
|
String |
getReminder(UUID userId)
Retrieves a user's keys file passphrase reminder stored on the Absio Broker™ application.
|
getClient, getCredentials, getServerTime, getSession, isAuthenticated, setSession
public KeyFileMapper(Session session) throws NoSuchPaddingException, NoSuchAlgorithmException
session
- the session for the mapperNoSuchPaddingException
- thrown if the default padding for symmetric encryption is not supportedNoSuchAlgorithmException
- thrown when a cryptographic algorithm is not supportedpublic void createOrUpdate(UUID userId, String passphrase, String reminder, byte[] encryptedKeyFile) throws IOException, BrokerException, NoSuchAlgorithmException, InvalidKeyException, NoSuchPaddingException, InterruptedException
userId
- the user's IDpassphrase
- the user's secret passphrasereminder
- optional reminder for the passphraseencryptedKeyFile
- the encrypted key fileBrokerException
- thrown when the Absio Broker™ application has an issue with the requestIOException
- thrown when there are any IO issuesNoSuchPaddingException
- thrown if the default padding for symmetric encryption is not supportedNoSuchAlgorithmException
- thrown when a cryptographic algorithm is not supportedInvalidKeyException
- thrown when the secret key is improperly formattedInterruptedException
- thrown when there is an interruption during rate limitingpublic void delete() throws IOException, BrokerException, InterruptedException
BrokerException
- thrown when the Absio Broker™ application has an issue with the requestIOException
- thrown when there are any IO issuesInterruptedException
- thrown when there is an interruption during rate limitingpublic boolean doesChecksumMatch(UUID userId, byte[] encryptedKeyFile) throws IOException, BrokerException, NoSuchAlgorithmException, InterruptedException
userId
- the user's IDencryptedKeyFile
- the encrypted key fileBrokerException
- thrown when the Absio Broker™ application has an issue with the requestIOException
- thrown when there are any IO issuesNoSuchAlgorithmException
- thrown when a cryptographic algorithm is not supportedInterruptedException
- thrown when there is an interruption during rate limitingpublic byte[] get(UUID userId, String passphrase) throws IOException, BrokerException, NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, InterruptedException
userId
- the user's IDpassphrase
- the user's secret passphraseBrokerException
- thrown when the Absio Broker™ application has an issue with the requestIOException
- thrown when there are any IO issuesNoSuchPaddingException
- thrown if the default padding for symmetric encryption is not supportedNoSuchAlgorithmException
- thrown when a cryptographic algorithm is not supportedInvalidKeyException
- thrown when the secret key is improperly formattedInterruptedException
- thrown when there is an interruption during rate limitingpublic String getReminder(UUID userId) throws IOException, BrokerException, InterruptedException
userId
- the user's IDBrokerException
- thrown when the Absio Broker™ application has an issue with the requestIOException
- thrown when there are any IO issuesInterruptedException
- thrown when there is an interruption during rate limitingCopyright © 2021. All rights reserved.