Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Convert DSA DER Private Key to PEMConverts a DSA private key from DER format to PEM. Demonstrates how to write both encrypted and unencrypted PEM formatted private keys.
Dim success As Boolean Dim dsa As New Chilkat.Dsa() success = dsa.UnlockComponent("Anything for 30-day trial") If (success <> true) Then MsgBox(dsa.LastErrorText) Exit Sub End If ' Load a DER private key. success = dsa.FromDerFile("dsa_priv.der") If (success <> true) Then MsgBox(dsa.LastErrorText) Exit Sub End If Dim pemStr As String ' Save to unencrypted PEM: pemStr = dsa.ToPem() success = dsa.SaveText(pemStr,"dsa_priv.pem") If (success <> true) Then MsgBox(dsa.LastErrorText) Exit Sub End If ' Save to encrypted PEM: pemStr = dsa.ToEncryptedPem("myPassword") success = dsa.SaveText(pemStr,"dsa_privEncrypted.pem") If (success <> true) Then MsgBox(dsa.LastErrorText) Exit Sub End If MsgBox("Finished!") |
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.