- 1.私钥可查询出公钥;公钥无法计算私钥,注意保护私钥安全;
- 2.分割字符串:PHP函数substr($str,36|76);
- 3.HEX转base64:PHP函数base64_encode(hex2bin());
- 4.base64转HEX:PHP函数bin2hex(base64_decode());
- 5.公钥HEX转PEM证书:字符串'3059301306072a8648ce3d020106082a811ccf5501822d034200'+公钥,base64_encode(hex2bin());
- 6.公钥PEM证书转公钥HEX:base64转HEX,分割'3059301306072a8648ce3d020106082a811ccf5501822d034200';
- 7.私钥转PEM证书:'30770201010420'+私钥HEX+'a00a06082a811ccf5501822da144034200'+公钥HEX,base64_encode(hex2bin())