Exemplo n.º 1
0
 public MacData(
     DigestInfo	digInfo,
     byte[]		salt,
     int			iterationCount)
 {
     this.digInfo = digInfo;
     this.salt = (byte[]) salt.Clone();
     this.iterationCount = BigInteger.ValueOf(iterationCount);
 }
Exemplo n.º 2
0
        private MacData(
            Asn1Sequence seq)
        {
            this.digInfo = DigestInfo.GetInstance(seq[0]);
            this.salt = ((Asn1OctetString) seq[1]).GetOctets();

            if (seq.Count == 3)
            {
                this.iterationCount = ((DerInteger) seq[2]).Value;
            }
            else
            {
                this.iterationCount = BigInteger.One;
            }
        }
        private byte[] DerEncode(byte[] hash)
        {
            if (algId == null)
            {
                // For raw RSA, the DigestInfo must be prepared externally
                return hash;
            }

            DigestInfo dInfo = new DigestInfo(algId, hash);

            return dInfo.GetDerEncoded();
        }