protected synchronized void loadCACertificates ( boolean force ) throws InvalidArgumentException , CryptoException , TransactionException { if ( ! force && msps != null && ! msps . isEmpty ( ) ) { return ; } logger . debug ( format ( "Channel %s loadCACertificates" , name ) ) ; Map < String , MSP > lmsp = parseConfigBlock ( force ) ; if ( lmsp == null || lmsp . isEmpty ( ) ) { throw new InvalidArgumentException ( "Unable to load CA certificates. Channel " + name + " does not have any MSPs." ) ; } List < byte [ ] > certList ; for ( MSP msp : lmsp . values ( ) ) { logger . debug ( "loading certificates for MSP : " + msp . getID ( ) ) ; certList = Arrays . asList ( msp . getRootCerts ( ) ) ; if ( certList . size ( ) > 0 ) { client . getCryptoSuite ( ) . loadCACertificatesAsBytes ( certList ) ; } certList = Arrays . asList ( msp . getIntermediateCerts ( ) ) ; if ( certList . size ( ) > 0 ) { client . getCryptoSuite ( ) . loadCACertificatesAsBytes ( certList ) ; } // not adding admin certs. Admin certs should be signed by the CA } logger . debug ( format ( "Channel %s loadCACertificates completed " , name ) ) ; }
load the peer organizations CA certificates into the channel s trust store so that we can verify signatures from peer messages