예제 #1
0
 /// <exception cref="System.Exception"></exception>
 public virtual void SetPubKey(byte[] y, byte[] p, byte[] q, byte[] g)
 {
     DSAPublicKeySpec dsaPubKeySpec = new DSAPublicKeySpec(new BigInteger(y), new BigInteger
         (p), new BigInteger(q), new BigInteger(g));
     PublicKey pubKey = keyFactory.GeneratePublic(dsaPubKeySpec);
     signature.InitVerify(pubKey);
 }
예제 #2
0
파일: KeyFactory.cs 프로젝트: shoff/ngit
        public override PublicKey GeneratePublic(KeySpec key)
        {
            DSAPublicKeySpec spec = (DSAPublicKeySpec)key;
            DSAParameters    dsp  = new DSAParameters();

            dsp.G = spec.GetG().GetBytes();
            dsp.P = spec.GetP().GetBytes();
            dsp.Q = spec.GetQ().GetBytes();
            dsp.Y = spec.GetY().GetBytes();
            return(new DSAPublicKey(dsp));
        }