Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(C# UWP/WinRT) RSA Sign using Base64 Private KeySigns a string using a non-encrypted RSA private key in base64 encoding. Returns the RSA signature as a base64 string.
// This requires the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. Chilkat.PrivateKey privKey = new Chilkat.PrivateKey(); bool success; Chilkat.StringBuilder sbPem = new Chilkat.StringBuilder(); sbPem.AppendLine("-----BEGIN RSA PRIVATE KEY-----",true); sbPem.AppendLine("MIIC .... j5A==",true); sbPem.AppendLine("-----END RSA PRIVATE KEY-----",true); success = privKey.LoadPem(sbPem.GetAsString()); if (success != true) { Debug.WriteLine(privKey.LastErrorText); return; } Chilkat.Rsa rsa = new Chilkat.Rsa(); success = rsa.ImportPrivateKeyObj(privKey); if (success != true) { Debug.WriteLine(rsa.LastErrorText); return; } rsa.EncodingMode = "base64"; string strSigned = rsa.OpenSslSignStringENC("12345678"); Debug.WriteLine(strSigned); string strOriginal = rsa.OpenSslVerifyStringENC(strSigned); Debug.WriteLine(strOriginal); |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.