public byte[] Decrypt(byte[] data) { lock (lockObj) { using (RsaInner rsa = new RsaInner(this.data, this.cert)) { return(rsa.Decrypt(data)); } } }
public byte[] SignHash(byte[] hash) { lock (lockObj) { byte[] ret; using (RsaInner rsa = new RsaInner(this.data, this.cert)) { ret = rsa.SignHash(hash); } return(ret); } }
public bool VerifyHash(byte[] hash, byte[] sign) { lock (lockObj) { bool ret; using (RsaInner rsa = new RsaInner(this.data, this.cert)) { ret = rsa.VerifyHash(hash, sign); } return(ret); } }
public byte[] SignData(byte[] data) { lock (lockObj) { byte[] ret; using (RsaInner rsa = new RsaInner(this.data, this.cert)) { ret = rsa.SignData(data); } return(ret); } }
// MD5 public static byte[] HashMD5(byte[] data) { byte[] ret; RsaInner.Lock(); try { ret = md5.ComputeHash(data); } finally { RsaInner.Unlock(); } return(ret); }
public bool VerifyHash(byte[] hash, byte[] sign) { lock (lockObj) { bool ret; using (RsaInner rsa = new RsaInner(this.data, this.cert)) { ret = rsa.VerifyHash(hash, sign); } return ret; } }
public byte[] SignHash(byte[] hash) { lock (lockObj) { byte[] ret; using (RsaInner rsa = new RsaInner(this.data, this.cert)) { ret = rsa.SignHash(hash); } return ret; } }
public byte[] SignData(byte[] data) { lock (lockObj) { byte[] ret; using (RsaInner rsa = new RsaInner(this.data, this.cert)) { ret = rsa.SignData(data); } return ret; } }
public byte[] Encrypt(byte[] data) { lock (lockObj) { using (RsaInner rsa = new RsaInner(this.data, this.cert)) { return rsa.Encrypt(data); } } }