mirror of https://github.com/beemdevelopment/Aegis
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
Java
41 lines
1.1 KiB
Java
6 years ago
|
package com.beemdevelopment.aegis.vault;
|
||
7 years ago
|
|
||
|
import com.beemdevelopment.aegis.crypto.CryptParameters;
|
||
|
import com.beemdevelopment.aegis.crypto.CryptResult;
|
||
|
import com.beemdevelopment.aegis.crypto.MasterKey;
|
||
|
import com.beemdevelopment.aegis.crypto.MasterKeyException;
|
||
6 years ago
|
import com.beemdevelopment.aegis.vault.slots.SlotList;
|
||
7 years ago
|
|
||
|
import java.io.Serializable;
|
||
|
|
||
6 years ago
|
public class VaultFileCredentials implements Serializable {
|
||
7 years ago
|
private MasterKey _key;
|
||
|
private SlotList _slots;
|
||
|
|
||
6 years ago
|
public VaultFileCredentials() {
|
||
7 years ago
|
_key = MasterKey.generate();
|
||
|
_slots = new SlotList();
|
||
|
}
|
||
|
|
||
6 years ago
|
public VaultFileCredentials(MasterKey key, SlotList slots) {
|
||
7 years ago
|
_key = key;
|
||
|
_slots = slots;
|
||
|
}
|
||
|
|
||
|
public CryptResult encrypt(byte[] bytes) throws MasterKeyException {
|
||
|
return _key.encrypt(bytes);
|
||
|
}
|
||
|
|
||
|
public CryptResult decrypt(byte[] bytes, CryptParameters params) throws MasterKeyException {
|
||
|
return _key.decrypt(bytes, params);
|
||
|
}
|
||
|
|
||
|
public MasterKey getKey() {
|
||
|
return _key;
|
||
|
}
|
||
|
|
||
|
public SlotList getSlots() {
|
||
|
return _slots;
|
||
|
}
|
||
|
}
|