private static CertificateProvider newCertificateProvider ( ComponentManager manager , Store store ) throws GeneralSecurityException { try { CertificateProvider provider = manager . getInstance ( CertificateProvider . class , "BCStoreX509" ) ; ( ( BcStoreX509CertificateProvider ) provider ) . setStore ( store ) ; return provider ; } catch ( ComponentLookupException e ) { throw new GeneralSecurityException ( "Unable to initialize the certificates store" , e ) ; } }
Wrap a bouncy castle store into an adapter for the CertificateProvider interface .