refactoring specs. Added signed certificate tests