Example #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);
 }
Example #2
0
        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));
        }