public static CertStore createCertStore ( TrustedCertificates tc ) throws Exception { CertStore store = null ; if ( tc == null ) { String caCertPattern = "file:" + CoGProperties . getDefault ( ) . getCaCertLocations ( ) + "/*.0" ; store = Stores . getCACertStore ( caCertPattern ) ; } else { SimpleMemoryCertStoreParams params = new SimpleMemoryCertStoreParams ( tc . getCertificates ( ) , null ) ; params . setCerts ( tc . getCertificates ( ) ) ; store = CertStore . getInstance ( SimpleMemoryProvider . CERTSTORE_TYPE , params , SimpleMemoryProvider . PROVIDER_NAME ) ; } return store ; }
Create a CertStore object from TrustedCertificates . The store only loads trusted certificates no signing policies