getBytes() public method

public getBytes ( ) : byte[]
return byte[]
示例#1
0
 // Convert a big integer to a base 64 string
 private string bigint_to_b64(BigInteger bi)
 {
     byte[] b = bi.getBytes();
     return Convert.ToBase64String(b);
 }
示例#2
0
        // Perform an RSA public key operation on input
        public byte[] DoPublic(byte[] input)
        {
            if (input.Length != this.keylen)
                throw new ArgumentException("input.Length does not match keylen");

            if (ReferenceEquals(this.N, null))
                throw new ArgumentException("no key set!");

            BigInteger T = new BigInteger(input);
            if (T >= this.N)
                throw new ArgumentException("input exceeds modulus");

            T = T.modPow(this.E, this.N);

            byte[] b = T.getBytes();
            return pad_bytes(b, this.keylen);
        }