Пример #1
0
 public byte[] Decrypt(byte[] data)
 {
     lock (lockObj)
     {
         using (RsaInner rsa = new RsaInner(this.data, this.cert))
         {
             return(rsa.Decrypt(data));
         }
     }
 }
Пример #2
0
 public byte[] SignHash(byte[] hash)
 {
     lock (lockObj)
     {
         byte[] ret;
         using (RsaInner rsa = new RsaInner(this.data, this.cert))
         {
             ret = rsa.SignHash(hash);
         }
         return(ret);
     }
 }
Пример #3
0
 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);
     }
 }
Пример #4
0
 public byte[] SignData(byte[] data)
 {
     lock (lockObj)
     {
         byte[] ret;
         using (RsaInner rsa = new RsaInner(this.data, this.cert))
         {
             ret = rsa.SignData(data);
         }
         return(ret);
     }
 }
Пример #5
0
        // MD5
        public static byte[] HashMD5(byte[] data)
        {
            byte[] ret;

            RsaInner.Lock();
            try
            {
                ret = md5.ComputeHash(data);
            }
            finally
            {
                RsaInner.Unlock();
            }

            return(ret);
        }
Пример #6
0
 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;
     }
 }
Пример #7
0
 public byte[] SignHash(byte[] hash)
 {
     lock (lockObj)
     {
         byte[] ret;
         using (RsaInner rsa = new RsaInner(this.data, this.cert))
         {
             ret = rsa.SignHash(hash);
         }
         return ret;
     }
 }
Пример #8
0
 public byte[] SignData(byte[] data)
 {
     lock (lockObj)
     {
         byte[] ret;
         using (RsaInner rsa = new RsaInner(this.data, this.cert))
         {
             ret = rsa.SignData(data);
         }
         return ret;
     }
 }
Пример #9
0
 public byte[] Encrypt(byte[] data)
 {
     lock (lockObj)
     {
         using (RsaInner rsa = new RsaInner(this.data, this.cert))
         {
             return rsa.Encrypt(data);
         }
     }
 }