示例#1
0
        /// <summary>
        /// Translte the PIN block under a different
        /// PIN block format.
        /// </summary>
        /// <param name="format">New PIN block format.</param>
        /// <returns>Translated PIN block.</returns>
        public string Translate(PinBlockFormat format)
        {
            var newBlock = new PinBlock(Pin, AccountOrPadding, format);

            return(newBlock.ClearPinBlock);
        }
示例#2
0
        /// <summary>
        /// Translate and encrypt PIN block.
        /// </summary>
        /// <param name="key">Clear encryption key.</param>
        /// <param name="format">New PIN block format.</param>
        /// <returns>Translated and encrypted PIN block.</returns>
        public string Translate(HexKey key, PinBlockFormat format)
        {
            var newBlock = new PinBlock(Pin, AccountOrPadding, format);

            return(key.Encrypt(newBlock.ClearPinBlock));
        }