예제 #1
0
		/// <exception cref="System.Exception"></exception>
		public virtual void SetPubKey(byte[] e, byte[] n)
		{
			RSAPublicKeySpec rsaPubKeySpec = new RSAPublicKeySpec(new BigInteger(n), new BigInteger
				(e));
			PublicKey pubKey = keyFactory.GeneratePublic(rsaPubKeySpec);
			signature.InitVerify(pubKey);
		}
예제 #2
0
파일: KeyFactory.cs 프로젝트: shoff/ngit
        public override PublicKey GeneratePublic(KeySpec key)
        {
            RSAPublicKeySpec spec    = (RSAPublicKeySpec)key;
            RSAParameters    dparams = new RSAParameters();

            dparams.Modulus  = spec.GetModulus().GetBytes();
            dparams.Exponent = spec.GetPublicExponent().GetBytes();
            return(new RSAPublicKey(dparams));
        }