Refactored To CertificateProvider Interface with default implementation

- Implemented the required changes
- Updated and expanded the test-cases