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
(Excel) 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. Dim privKey As Chilkat.PrivateKey Set privKey = Chilkat.NewPrivateKey Dim sbPem As Chilkat.StringBuilder Set sbPem = Chilkat.NewStringBuilder success = sbPem.AppendLine("-----BEGIN RSA PRIVATE KEY-----",True) success = sbPem.AppendLine("MIIC .... j5A==",True) success = sbPem.AppendLine("-----END RSA PRIVATE KEY-----",True) success = privKey.LoadPem(sbPem.GetAsString()) If (success <> True) Then Debug.Print privKey.LastErrorText Exit Sub End If Dim rsa As Chilkat.Rsa Set rsa = Chilkat.NewRsa success = rsa.ImportPrivateKeyObj(privKey) If (success <> True) Then Debug.Print rsa.LastErrorText Exit Sub End If rsa.EncodingMode = "base64" strSigned = rsa.OpenSslSignStringENC("12345678") Debug.Print strSigned strOriginal = rsa.OpenSslVerifyStringENC(strSigned) Debug.Print strOriginal |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.