예제 #1
0
파일: RsaKey.cs 프로젝트: jinhang2008/FxSsh
        public override void LoadKeyAndCertificatesData(byte[] data)
        {
            using (var worker = new SshDataWorker(data))
            {
                if (worker.ReadString(Encoding.ASCII) != this.Name)
                    throw new CryptographicException("Key and certificates were not created with this algorithm.");

                var args = new RSAParameters();
                args.Exponent = worker.ReadMpint();
                args.Modulus = worker.ReadMpint();

                _algorithm.ImportParameters(args);
            }
        }
예제 #2
0
        public override void LoadKeyAndCertificatesData(byte[] data)
        {
            using (var worker = new SshDataWorker(data))
            {
                if (worker.ReadString(Encoding.ASCII) != this.Name)
                {
                    throw new CryptographicException("Key and certificates were not created with this algorithm.");
                }

                var args = new RSAParameters();
                args.Exponent = worker.ReadMpint();
                args.Modulus  = worker.ReadMpint();

                _algorithm.ImportParameters(args);
            }
        }
예제 #3
0
 protected override void OnLoad(SshDataWorker reader)
 {
     this.E = reader.ReadMpint();
 }
예제 #4
0
 protected override void OnLoad(SshDataWorker reader)
 {
     E = reader.ReadMpint();
 }