Spring micro project to read the letter or Alipay profile apiclient_cert.p12

    In the development of the payment module, go read some configuration files, such as micro-channel refund, this micro-channel public number.

    Profile habits in the project (I am more accustomed to), on the project through relatively King Road, directly File to read, will not have problems in the local project, you will not find the file on the server. Here we read using Spring XML configuration code

    Use ClassPathResource cl = new ClassPathResource ( "apiclient_cert.p12"); this is a spring loaded xml configuration file in the file operation, more practical.

KeyStore keyStore  = KeyStore.getInstance("PKCS12");
ClassPathResource cl = new ClassPathResource("apiclient_cert.p12");
try {
        keyStore.load(cl.getInputStream(), mchId.toCharArray());
    } finally {

 }

 

Released six original articles · won praise 0 · views 10000 +

Guess you like

Origin blog.csdn.net/zhang199563/article/details/81478139