Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Chilkat2-Python Examples

Web API Categories

ASN.1
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
Geolocation
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
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)
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
REST
REST Misc
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Socket/SSL/TLS
Spider
Stream
Tar Archive
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl

 

 

 

(Chilkat2-Python) RSA Sign using Base64 Private Key

Signs a string using a non-encrypted RSA private key in base64 encoding. Returns the RSA signature as a base64 string.

Chilkat2 Python Downloads

Python Module for Windows, Linux, Alpine Linux,
MAC OS X, Solaris, FreeBSD, OpenBSD,
Raspberry Pi and other single board computers

import sys
import chilkat2

# This requires the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.

privKey = chilkat2.PrivateKey()

sbPem = chilkat2.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):
    print(privKey.LastErrorText)
    sys.exit()

rsa = chilkat2.Rsa()

success = rsa.ImportPrivateKeyObj(privKey)
if (success != True):
    print(rsa.LastErrorText)
    sys.exit()

rsa.EncodingMode = "base64"
strSigned = rsa.OpenSslSignStringENC("12345678")
print(strSigned)

strOriginal = rsa.OpenSslVerifyStringENC(strSigned)
print(strOriginal)

 

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