How can I encode a string using HMAC SHA256 algorithm? I went through OpenSSL library but didn't find anything valuable. Your suggestions?
相关问题
- Multiple sockets for clients to connect to
- What is the best way to do a search in a large fil
- “Zero out” sensitive String data in Swift
- glDrawElements only draws half a quad
- Index of single bit in long integer (in C) [duplic
HMAC and SHA256 are separate components in OpenSSL, you'll need to glue them together yourself. (Note that this uses the shorthand methods for doing everything in one shot with monolithic buffers; incremental processing is more complex.)
Even if your input is a string, the result is an arbitrary byte array; if that too needs to be a string then you'll have to apply some other transformation like hexadecimal expansion, Base64 or whatever suits your application.