During this period, an authentication protocol is implemented, which can be divided into the client and the server. The client uses the Windows operating system, the server uses the Linux operating system, and the client (Windows ), use the signature certificate in the Windows certificate library to sign the message (use the Windows crypto Library), and then use the OpenSSL library
During this period, an authentication protocol is implemented, which can be divided into the client and the server. The client uses the Windows operating system, the server uses the Linux operating system, and the client (Windows ), use the signature certificate in the Windows certificate library to sign the message (use the Windows crypto Library), and then use the OpenSSL library to verify the signature value on the server (Linux ~~
The client uses the function interface:
CertOpenSystemStore-open the system certificate library
CryptUIDlgSelectCertifiCatEFromStore-select a certificate from the certificate library to obtain the certificate Context
CertGetCertificateContExTProperty-obtain the secret container name corresponding to the CRYPT_KEY_PROV_INFO structure of the CERT_KEY_PROV_INFO_PROP_ID attribute.
CryptAcquireContext-connect to the key container
CryptCreateHash-create a Hash object
CryptHashData-obtain the Hash value
CryptSignHash-sign the Hash value to obtain the signature Value
The server uses the function interface:
D2i_X509_bio-generate an x509 Certificate from the encoded Certificate
X509_get_pubkey-get the public key from the x509 Certificate
EVP_MD_CTX_init-Initialize ctx
EVP_VerifyInit_ex-verify the signature
EVP_VerifyUpDate
EVP_VerifyFinal
There is a key point here: the signature value generated by the crypto library must be reversed before it can be verified by the OpenSSL library ~~ Remember ~