at.ac.tuwien.infosys.rnue.interfaces
Interface ISecurityHelper


public interface ISecurityHelper

This interface has to be implemented by the security helper class. An implementation of this class also has to provide a constructor that takes a java.util.Properties argument and throws the at.ac.tuwien.infosys.rnue.helpers.ShareMeException exception in case of an error.


Method Summary
 java.security.PublicKey getPublicKeyFromCA(java.lang.String owner)
          Retrieves the public key belonging to owner from the certification authority; returns the public key of the owner.
 boolean registerPublicKey(java.lang.String owner, java.security.PublicKey pk)
          Registers a public key at the certification authority.
 byte[] sign(java.io.Serializable obj)
          Signs an object.
 boolean verify(java.io.Serializable obj, byte[] sig, java.security.PublicKey pk)
          Verifies the signature of an object.
 

Method Detail

getPublicKeyFromCA

public java.security.PublicKey getPublicKeyFromCA(java.lang.String owner)
                                           throws ShareMeException
Retrieves the public key belonging to owner from the certification authority; returns the public key of the owner.

Parameters:
owner - the owner of the public key
Returns:
the owner's public key
Throws:
ShareMeException - If it could not contact the certification authority, if the key for the specified owner could not be retrieved, or if the retrieved key cannot be converted into a public key.

registerPublicKey

public boolean registerPublicKey(java.lang.String owner,
                                 java.security.PublicKey pk)
                          throws ShareMeException
Registers a public key at the certification authority.

Parameters:
owner - the owner of the public key
pk - the public key
Returns:
true if the registration was successful
Throws:
ShareMeException - If an error occurs

verify

public boolean verify(java.io.Serializable obj,
                      byte[] sig,
                      java.security.PublicKey pk)
               throws ShareMeException
Verifies the signature of an object.

Parameters:
obj - the object whose signature has to be verified
sig - the signature of the object to be verified
pk - the public key of the user who signed the object
Returns:
true if the signature is valid.
Throws:
ShareMeException - If it could not contact the certification authority or could not retrieve the public key.

sign

public byte[] sign(java.io.Serializable obj)
            throws ShareMeException
Signs an object.

Parameters:
obj - the object to be signed
Returns:
the signature.
Throws:
ShareMeException - If an error occurs