예제 #1
0
        /// <summary>
        /// Returns the BigNum as a buffer
        /// </summary>
        /// <returns>Content of BigNum as byte array in OpenSSL byte order</returns>
        public byte[] ToBigArray()
        {
            if (fDisposed)
            {
                throw new ObjectDisposedException("this");
            }

            byte[] buf = new byte[(OpenSSL.BN_num_bits(fBigNum) + 7) / 8];
            OpenSSL.BN_bn2bin(fBigNum, buf);
            return(buf);
        }