public static string verifyText(string src, IPrivKey key) { int rc = Crypt_Verify(src, -1, null, null, key.getKey()); if (rc != 0) { throw(new IPrivException(rc)); } return(""); }
public static IPrivKey openPublicKey(string path, uint keyserial) { IPrivKey k = new IPrivKey(); int rc = Crypt_OpenPublicKeyFromFile(0, path, keyserial, k.getKey(), null); if (rc != 0) { throw(new IPrivException(rc)); } return(k); }
public static IPrivKey openSecretKey(string path, string passwd) { IPrivKey k = new IPrivKey(); int rc = Crypt_OpenSecretKeyFromFile(0, path, passwd, k.getKey()); if (rc != 0) { throw(new IPrivException(rc)); } return(k); }
public static string signText(string src, IPrivKey key) { string dst; StringBuilder tmp = new StringBuilder(2048); int rc = Crypt_Sign(src, src.Length, tmp, tmp.Capacity, key.getKey()); if (rc < 0) { throw(new IPrivException(rc)); } dst = tmp.ToString(0, rc); return(dst); }
public static void closeKey(IPrivKey key) { Crypt_CloseKey(key.getKey()); }