public class KeyFileMapper extends AbstractFileMapper
Constructor and Description |
---|
KeyFileMapper(KeyRing keyRing,
OFS ofs)
|
Modifier and Type | Method and Description |
---|---|
boolean |
createOrUpdate(UUID userId,
byte[] encryptedKeyFileBlob,
boolean overwrite)
Creates or updates the user's KeyFile bytes in the
OFS , possibly creating both directory and file. |
void |
delete(UUID userId)
Delete the users KeyFile from the
OFS . |
byte[] |
get(UUID userId)
Get the encrypted KeyFile bytes from the
OFS . |
getKeyRing, getOfs, setKeyRing
public boolean createOrUpdate(UUID userId, byte[] encryptedKeyFileBlob, boolean overwrite) throws NoSuchAlgorithmException, IOException
OFS
, possibly creating both directory and file.userId
- the user id that owns the key fileencryptedKeyFileBlob
- the KeyFile (encrypted KeyRing
)overwrite
- true if the KeyFile should overwrite an existing fileNoSuchAlgorithmException
- thrown if the hash algorithm used by the OFS
is not supportedIOException
- thrown if there were any issues trying to write the KeyFilepublic void delete(UUID userId) throws IOException, NoSuchAlgorithmException
OFS
.userId
- the user id that owns the key fileIOException
- thrown if there were any issues trying to delete the KeyFileNoSuchAlgorithmException
- thrown if the hash algorithm used by the OFS
is not supportedpublic byte[] get(UUID userId) throws NoSuchAlgorithmException, IOException
OFS
.userId
- the user id that owns the key fileNoSuchAlgorithmException
- thrown if the hash algorithm used by the OFS
is not supportedIOException
- thrown if there were any issues trying to get the KeyFileCopyright © 2021. All rights reserved.