Esempio n. 1
0
        public DerInteger(
            BigInteger value)
        {
            if (value == null)
                throw new ArgumentNullException("value");

            bytes = value.ToByteArray();
        }
 public DerEnumerated(
     BigInteger val)
 {
     bytes = val.ToByteArray();
 }
 private byte[] int2octets(BigInteger v)
 {
     byte[] @out = v.ToByteArray();
     if(@out.Length < rolen)
     {
         byte[] out2 = new byte[rolen];
         Array.Copy(@out, 0,
                 out2, rolen - @out.Length,
                 @out.Length);
         return out2;
     }
     else if(@out.Length > rolen)
     {
         byte[] out2 = new byte[rolen];
         Array.Copy(@out, @out.Length - rolen,
                 out2, 0, rolen);
         return out2;
     }
     else
     {
         return @out;
     }
 }