(Ruby) Workaround for the deprecated Crypt2.AddPfxSourceData method
Shows how to replace the deprecated AddPfxSourceData method. (Chilkat is moving away from the use of CkByteData.) Note: This example requires Chilkat v11.0.0 or greater.
require 'chilkat'
crypt = Chilkat::CkCrypt2.new()
path = "c:/data/example.pfx"
pfxPassword = "secret"
# ------------------------------------------------------------------------
# The AddPfxSourceData method is deprecated:
inData = Chilkat::CkByteData.new()
inData.loadFile(path)
success = crypt.AddPfxSourceData(inData,pfxPassword)
# ------------------------------------------------------------------------
# Workaround.
# (Chilkat is moving away from using CkByteData)
bdIn = Chilkat::CkBinData.new()
bdIn.LoadFile(path)
success = crypt.AddPfxSourceBd(bdIn,pfxPassword)
|