예제 #1
0
파일: RSA.cs 프로젝트: GuardianRG/Animus
 /// <summary>
 /// Decrypt the specified str using the specified keys.
 /// </summary>
 /// <param name="str">String.</param>
 /// <param name="keys">Keys.</param>
 public static string Decrypt(string str, KeyPair keys)
 {
     if (!keys.HasPrivateKey)
         throw new Exception ("The KeyPair doesn't contain a private key.");
     return Decrypt (str, keys.PrivateKey);
 }
예제 #2
0
파일: RSA.cs 프로젝트: GuardianRG/Animus
 /// <summary>
 /// Decrypt the specified data using the specified keys.
 /// </summary>
 /// <param name="data">Data.</param>
 /// <param name="keys">Keys.</param>
 public static byte[] Decrypt(byte[] data, KeyPair keys)
 {
     if (!keys.HasPrivateKey)
         throw new Exception ("This KeyPair doesn't contain a private key.");
     return Decrypt (data, keys.PrivateKey);
 }
예제 #3
0
파일: RSA.cs 프로젝트: GuardianRG/Animus
 /// <summary>
 /// Initializes a new instance of the <see cref="RSA"/> class.
 /// </summary>
 /// <param name="keyPair">Key pair.</param>
 public RSA(KeyPair keyPair)
 {
     this.keyPair = keyPair;
 }
예제 #4
0
파일: RSA.cs 프로젝트: GuardianRG/Animus
 /// <summary>
 /// Initializes a new instance of the <see cref="RSA"/> class.
 /// </summary>
 /// <param name="publicKey">Public key.</param>
 /// <param name="privateKey">Private key.</param>
 public RSA(string publicKey, string privateKey)
 {
     keyPair = new KeyPair (publicKey, privateKey);
 }
예제 #5
0
파일: RSA.cs 프로젝트: GuardianRG/Animus
 /// <summary>
 /// Initializes a new instance of the <see cref="RSA"/> class.
 /// </summary>
 /// <param name="publicKey">Public key.</param>
 public RSA(string publicKey)
 {
     keyPair = new KeyPair (publicKey);
 }
예제 #6
0
파일: RSA.cs 프로젝트: GuardianRG/Animus
 /// <summary>
 /// Encrypt the specified data using the specified keys.
 /// </summary>
 /// <param name="data">Data.</param>
 /// <param name="keys">Keys.</param>
 public static byte[] Encrypt(byte[] data, KeyPair keys)
 {
     return Encrypt (data, keys.PublicKey);
 }
예제 #7
0
파일: RSA.cs 프로젝트: GuardianRG/Animus
 /// <summary>
 /// Encrypt the specified str using the specified keys.
 /// </summary>
 /// <param name="str">String.</param>
 /// <param name="keys">Keys.</param>
 public static string Encrypt(string str, KeyPair keys)
 {
     return Encrypt (str, keys.PublicKey);
 }