Current location - Quotes Website - Signature design - How to sign the php rsa key after pkcs8 encoding?
How to sign the php rsa key after pkcs8 encoding?
Static protection function symbol ($data, $ prikey) (

$ RES = OpenSSL _ get _ private key($ priKey);

//Call openssl built-in signature method to generate signature $sign.

openssl_sign($data,$sign,$ RES);

//Release resources

OpenSSL _ free _ key($ RES);

//base64 coding

$ sign = base64 _ encode($ sign);

return $ sign

}