Ruby Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Ruby
Examples

Quick Start
Unicode
Byte Array
Bz2
Certificates
CSV
Email
Encryption
FTP
HTML Conversion
HTTP
IMAP
MHT
MIME
POP3
RSA
S/MIME
Signatures
SFTP
SMTP
Socket / SSL
Spider
SSH
SSH Key
SSH Tunnel
Tar
HTTP Upload
XML
XMP
Zip

More Examples...
String
Amazon S3
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
DH Key Exchange
DSA
LZW

 

 

 

 

 

 

 

Import PFX (p12, PKCS12) onto Windows system.

Downloads for Windows/Linux and Install Instructions

Imports a .pfx file containing a digital certificate with public/private key onto a Windows computer. The certificate is saved to a registry based certificate store while the public/private keypair is saved to a Windows protected store.

# file: importPfx.rb

require 'rubygems'
require 'chilkat'

# Import a PFX (PKCS12) digital certificate with private key
# onto a Windows computer.
pfx = Chilkat::CkPfx.new()
pfx.UnlockComponent("anything for 30-day trial")

# If bMachineKeyset = true, the private key is save to the machine-wide protected
# store. Otherwise it is saved to the current logged-on user's protected store
# (and thus only available to the user account that did the import).
bMachineKeyset = false
# Set bLocalMachineCertStore = true to import the certificate to the local machine
# registry store, otherwise import to the current user registry store.
bLocalMachineCertStore = false
# Set bExportable = true to allow the private key to be re-exported.
bExportable = true
# Set bUseWarningDialog = true to turn on high security which causes the Windows
# operating system to issue a warning dialog whenever the private key is accessed.
# Programs running in ASP.NET or a Windows Service will hang if bUseWarningDialog = true
bUseWarningDialog = false

success = pfx.ImportPfxFile("example.pfx","secret",
    bMachineKeyset, bLocalMachineCertStore, bExportable, bUseWarningDialog)
    
if not success
	print "Failed to import PFX\n"
	pfx.SaveLastError("lastError.xml")
else
	print "Imported PFX!\n"
end






 

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