(C#) Transition from Cert.ExportPublicKey to Cert.GetPublicKey
Provides instructions for replacing deprecated ExportPublicKey method calls with GetPublicKey. Note: This example requires Chilkat v11.0.0 or greater.
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();
bool success = cert.GetPublicKey(publickeyOut);
if (success == false) {
Debug.WriteLine(cert.LastErrorText);
return;
}
|