Php openssl“签名和”;无法将提供的密钥参数强制转换为私钥;
我对函数Php openssl“签名和”;无法将提供的密钥参数强制转换为私钥;,php,openssl,certificate,key,sign,Php,Openssl,Certificate,Key,Sign,我对函数openssl\u sign有问题,因为返回此错误 警告:openssl_sign():无法将提供的密钥参数强制转换为私钥 这是我的代码,希望您能提供帮助: <?php $debug=true; $data=file_get_contents(realpath("C:/Users/User/Desktop/xampp/htdocs/server.key")); $doc=file_get_contents(realpath("C:/Users/User/D
openssl\u sign
有问题,因为返回此错误
警告:openssl_sign():无法将提供的密钥参数强制转换为私钥
这是我的代码,希望您能提供帮助:
<?php
$debug=true;
$data=file_get_contents(realpath("C:/Users/User/Desktop/xampp/htdocs/server.key"));
$doc=file_get_contents(realpath("C:/Users/User/Desktop/xampp/htdocs/docum.docx"));
echo $debug ? $data : '';
$priv_key = openssl_pkey_get_private( $data );
$sign="";
$digitalS=openssl_sign ($doc,$sign, $priv_key);
?>
我已经用openssl创建了证书和私钥,现在我想在文档上签名。。。此代码有什么问题?、和朋友们。。。