This blog post describes how to convert a .key file (encrypted PEM) format into a .pvk which can be used the Chilkat PrivateKey class (or CkPrivateKey).
The .key file is a text file, and if you open it in a text editor, you’ll see something like this:
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-CBC,AF79F04F0F24239B
lrPuO3GAUVfo0+Mx9a2Btjqr+VkOiOGbks/QgYo2mrE9GX/YOzLhemTQPMVF2gd8
C20PJVuFLjDgocHit6cGRvFlwRGbRbxaCbq6zifrgzAfBa9CRbj1awaiHjFfNe/4
TrJCrO3tP3XMaKvYsYH9B1wHEPzNvAMcyag5rF5t6SfLVqFikhhzapfYBEx+YqoK
jGAIMlZSiXtByB9vJHUHY4pAvPU2YFQpfG8UaS7cvLGJne8fVT4I7IBEbY0SIPiL
njSsHiTnJ1xz+oWn0lpTpC46/Dk6mqxJDnDryYAvGAiXTrusdM3hHBOc/muUwQkC
6n1ZV6kClTf4bgwHndY+gzMhyc3Xgocgx4r4tuGVBM3LnFDVM0pnpJi19OZteUTz
TDagJn21J/bPlOKVuBRzhQlDF7Tcg08AlXHQ5Pul7l78dT/oOstAludAkkbT5fvV
c1vqCE2XdyLR54CjPLtMw75B0wDYMrlp8/AxlQB3fOlHsICuVhp9oZsCUl9/CsQi
uuWGF/EVstbu2TvRuvbKP9ABDk3I4UxBEYXzXZ/zAHlcXoHZWdez4pwg/jJPJ0E3
jWBgEJjDOinx1Q4cJn/FVCUffWNHvUsEvr5YmpCGy5uOadcAAdg8oVdUtsAFs2wS
dvYvXWnDXKCM83HyAVtkWgm/FEtId+1Rh6zBx6QWDTNZ4ZKZBWlP+LmXAF1pLhVv
u3wgrHu4PncONVQgIHDUGBDHLzje/H4QI80V8dMdA97Mj0+XlNQ/hKy+20YD0vV8
1pLyXN1HJUheQJWPQEyb3VOuaLIxza+1cWCRSIBCNfYXjvVIBMFLeQ==
-----END RSA PRIVATE KEY-----
(The .key file is the type of file generated by WS_FTP.)
There is a "pvktool" at http://www.drh-consultancy.demon.co.uk/pvk.html
that can be used to convert from a .key to .pvk.
Run pvk with these options to convert:
pvk -in Test.key -strong -topvk -out Test.pvk
The tool will prompt for both input and output passwords.
Now that you have a .pvk, it may be loaded into the Chilkat PrivateKey class:
ASP: PVK to XML
SQL Server: PVK to XML
C#: PVK to XML
C++: PVK to XML
Delphi: PVK to XML
Visual FoxPro: PVK to XML
Java: PVK to XML
Perl: PVK to XML
Python: PVK to XML
Ruby: PVK to XML
VB.NET: PVK to XML
Visual Basic: PVK to XML
VBScript: PVK to XML