Added import for SecurityException, several syntatic fixes to signByIdentity.  Removed duplicate setFace. Should be tested.