Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicPythonRubySQL ServerSwiftTclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcel

C# UWP/WinRT Examples


ASN.1
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Azure Cloud Storage
Azure Service Bus
Bounced Email
Box
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Email Object
Encryption
FTP
Facebook
Firebase
GeoOp
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
Gzip
HTML-to-XML/Text
HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)

Jira
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
PayPal
Peoplevox
QuickBooks
REST
REST Misc
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Shopify
Socket/SSL/TLS
Spider
Stream
Stripe
SugarCRM
Tar Archive
Twitter
VoiceBase
Walmart
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Xero
Zip
curl
eBay

 

 

 

(C# UWP/WinRT) HMAC SHA-1 Matching FIPS Examples

Provides an example of computing an HMAC-SHA1 digest to duplicate the FIPS examples at http://csrc.nist.gov/publications/fips/fips198/fips-198a.pdf

Chilkat Universal Windows Platform (UWP) / WinRT Downloads

Chilkat for the Universal Windows Platform (UWP)

Chilkat.Crypt2 crypt = new Chilkat.Crypt2();

bool success = crypt.UnlockComponent("Anything for 30-day trial.");
if (success != true) {
    Debug.WriteLine(crypt.LastErrorText);
    return;
}

string strToSign = "Sample #1";

//  64-byte key
string key = "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f";

//  The expected result:
//  (from Appendix A.1 at http://csrc.nist.gov/publications/fips/fips198/fips-198a.pdf )
string expectedResult = "4f4ca3d5d68ba7cc0a1208c9c61e9c5da0403c0a";

//  Here is the code to duplicate the results:
crypt.HashAlgorithm = "sha-1";
crypt.EncodingMode = "hex";

crypt.SetHmacKeyEncoded(key,"hex");

string mac;
mac = crypt.HmacStringENC(strToSign);

Debug.WriteLine("Computed: " + mac);
Debug.WriteLine("Expected: " + expectedResult);

 

© 2000-2016 Chilkat Software, Inc. All Rights Reserved.