Beispiel #1
0
 public PuzzleSolution Solve(RsaKey key)
 {
     if (key == null)
     {
         throw new ArgumentNullException(nameof(key));
     }
     return(key.SolvePuzzle(this));
 }
Beispiel #2
0
 public RsaPubKey(byte[] bytes)
 {
     if (bytes == null)
     {
         throw new ArgumentNullException(nameof(bytes));
     }
     try
     {
         DerSequence seq2 = RsaKey.GetRSASequence(bytes);
         var         s    = new RsaPublicKeyStructure(seq2);
         this._Key = new RsaKeyParameters(false, s.Modulus, s.PublicExponent);
     }
     catch (Exception)
     {
         throw new FormatException("Invalid RSA Key");
     }
 }