private string signText(string inputText) { IPrivKey secretKey = null; try { secretKey = IPriv.openSecretKey(m_Configuration.SecretKeyPath, m_Configuration.SecretKeyPassword); return(secretKey.signText(inputText)); } catch (IPrivException err) { throw new CryptographicException(err + " (код ошибки = " + err.code + ")", err); } finally { secretKey?.closeKey(); } }
private string Sign(string message) { string res = null; IPrivKey sec = null; try { sec = IPriv.openSecretKey(SecretKey, Password); res = sec.signText(message); } catch (IPrivException ex) { Functions.AddEvent("Error signing the message!", string.Format("Sign!: [{0}]", ex.Message), EventType.Critical, null, ex); } if (sec != null) { sec.closeKey(); } return(res); }