Esempio n. 1
0
                public void parse(Attribute attribute, EncryptionData.Builder builder, ParseState state)
                {
                    List <Byte> initializationVector = ParseUtil.parseHexadecimal(attribute.value);

                    if ((initializationVector.Count != Constants.IV_SIZE) &&
                        (initializationVector.Count != Constants.IV_SIZE_ALTERNATIVE))
                    {
                        throw ParseException.create(ParseExceptionType.INVALID_IV_SIZE, tag: null, context: attribute.ToString());
                    }

                    builder.withInitializationVector(initializationVector);
                }
        public void parseHexadecimal(byte[] expected, String input)
        {
            var actual = ParseUtil.parseHexadecimal(input, "");

            Assert.Equal(expected.ToList(), actual);
        }