U:RDoc::NormalClass[iI" HMAC:ETI"OpenSSL::HMAC;TI" Object;To:RDoc::Markup::Document: @parts[o;;[o:RDoc::Markup::Paragraph;[ I"KOpenSSL::HMAC allows computing Hash-based Message Authentication Code ;TI"K(HMAC). It is a type of message authentication code (MAC) involving a ;TI"Mhash function in combination with a key. HMAC can be used to verify the ;TI"8integrity of a message as well as the authenticity.;To:RDoc::Markup::BlankLineo; ;[I">OpenSSL::HMAC has a similar interface to OpenSSL::Digest.;T@S:RDoc::Markup::Heading: leveli: textI")HMAC-SHA256 using one-shot interface;T@o:RDoc::Markup::Verbatim;[ I"key = "key" ;TI"*data = "message-to-be-authenticated" ;TI"8mac = OpenSSL::HMAC.hexdigest("SHA256", key, data) ;TI"L#=> "cddb0db23f469c8bf072b21fd837149bd6ace9ab771cceef14c9e517cc93282e" ;T: @format0S; ; i; I",HMAC-SHA256 using incremental interface;T@o;;[ I" data1 = File.read("file1") ;TI" data2 = File.read("file2") ;TI"key = "key" ;TI"*digest = OpenSSL::Digest::SHA256.new ;TI"+hmac = OpenSSL::HMAC.new(key, digest) ;TI"hmac << data1 ;TI"hmac << data2 ;TI"mac = hmac.digest;T;0: @fileI"ext/openssl/ossl_hmac.c;T:0@omit_headings_from_table_of_contents_below0;0;0[[[[[I" class;T[[: public[[I" digest;TI"ext/openssl/ossl_hmac.c;T[I"hexdigest;T@8[I"new;T@8[:protected[[: private[[I" instance;T[[;[ [I"<<;T@8[I" digest;T@8[I"hexdigest;T@8[I" inspect;T@8[I" reset;T@8[I" to_s;T@8[I" update;T@8[;[[;[[[U:RDoc::Context::Section[i0o;;[;0;0[I"ext/openssl/ossl.c;TI" OpenSSL;FcRDoc::NormalModule