C#
C#
Transition from Cert.ExportPublicKey to Cert.GetPublicKey
Provides instructions for replacing deprecated ExportPublicKey method calls with GetPublicKey.Chilkat C# Downloads
bool success = false;
Chilkat.Cert cert = new Chilkat.Cert();
// ------------------------------------------------------------------------
// The ExportPublicKey method is deprecated:
Chilkat.PublicKey publickeyObj = cert.ExportPublicKey();
if (cert.LastMethodSuccess == false) {
Debug.WriteLine(cert.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using GetPublicKey.
// Your application creates a new, empty PublicKey object which is passed
// in the last argument and filled upon success.
Chilkat.PublicKey publickeyOut = new Chilkat.PublicKey();
success = cert.GetPublicKey(publickeyOut);
if (success == false) {
Debug.WriteLine(cert.LastErrorText);
return;
}