|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.fhg.igd.semoa.security.AgentEncryptor
This class encrypts agent structures according to a given policy.
When agents with encryption are created, the policy is expressed
by means of a Groups
instance.
Groups
Field Summary | |
protected Map |
folders_
The folders that are access restricted and assigned a particular access control group. |
protected Map |
groups_
The access control groups indexed by name. |
static int |
MAX_P7_LEN
The maximum number of octets that an encoded P7 is allowed to have. |
protected Resource |
struct_
The resource holding the agentstructure. |
Constructor Summary | |
AgentEncryptor(Resource res)
Creates an instance that operates on the agent structure stored by the given Resource . |
|
AgentEncryptor(Resource res,
Groups groups)
Creates an instance with the given Resource . |
Method Summary | |
void |
decrypt()
This method decrypts the folders in the agent structure. |
void |
encrypt()
This method encrypts the folders in the agent structure. |
void |
init()
This method intialises this instance from the agent structure stored in the Resource that was passed to the constructor of this instance. |
void |
init(Map folders,
Map groups)
This method initialises the encryptor with the given maps of folder/name and name/group entries. |
boolean |
isPlain()
This method returns true if the structure does
not contain encrypted data an thus must not be processed by
this instance. |
void |
validateOwner(X509Certificate cert)
This method verifies that the given signing certificate is the authorised owner of the data belonging to the given group.This is done by checking the MACs in the GROUPS entry of the SEAL-INF/INSTALL.MF file. |
void |
validateRecipient(PrivateKey privkey,
X509Certificate cert)
This method verifies that the given certificate is a valid recipient of the initialised access groups. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int MAX_P7_LEN
protected Map groups_
protected Map folders_
Attributes
.
protected Resource struct_
Constructor Detail |
public AgentEncryptor(Resource res)
Resource
.This constructor is typically used when agents are decrypted by a receiving host. Before actual decryption can take place, the bulk encryption keys must be unlocked.
res
- The agent's Resource
.public AgentEncryptor(Resource res, Groups groups)
Resource
. The access groups and folder
assignments are taken over directly from it.This constructor is typically used when agents are created.
groups
- The Groups
with
the readily initialized definition of the groups and
folder assignments. The group files must already be
unlocked. In other words, the groups structures must
contain the secret bullk encryption key.Method Detail |
public void validateOwner(X509Certificate cert) throws GeneralSecurityException
This feature is required to avoid cut & paste attacks on encrypted portions of an agent's structure. Else, an attacker might cut encrypted data and group defs from an agent and paste them into one of its own. If this agent is then sent to a host that is authorised to decrypt then the data is disclosed and may be read by the attacker's agent.
cert
- The signing key certificate of the agent's
owner.
GeneralSecurityException
- if a cut & paste
attack was detected.public void validateRecipient(PrivateKey privkey, X509Certificate cert) throws NoSuchAlgorithmException
cert
- The public encryption key certificate of the
recipient.
NoSuchAlgorithmException
public void init(Map folders, Map groups)
folders
- The map of folder/name entries.
Each value of this map defines the name of a
group in groups
. In other words
each value in this map corresponds to a key
in the other.groups
- The map of name/group entries.
each value in this map consists of a PKCS#7
EnvelopedData structure that contains the
encrypted bulk encryption key to use when
enveloping data that should be accessible
only to the group of recipients defined in
that structure.public void init() throws IOException
P7
files and the INSTALL.MF
file and reconstructs the corresponding mappings.
This method only reads in the appropriate structures.
The agent is not ready to be decrypted after calling
this method. This requires initialisation of the
decryption keys which is done through a call to
validateRecipient
.
IOException
public void encrypt() throws IOException
IOException
public void decrypt() throws IOException
IOException
public boolean isPlain()
true
if the structure does
not contain encrypted data an thus must not be processed by
this instance.
true
if do processing is required.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |