예제 #1
0
        public static Cryptor GetCryptor(CypherAlgorithm algorithm)
        {
            switch (algorithm)
            {
            case CypherAlgorithm.AES:
                return(GetAesCryptor());

            default: throw new InvalidOperationException("Specified algorithm does not exist.");
            }
        }
예제 #2
0
        private CypherAlgorithm[] ConvertToCypherAlgorithmArray(pfPGPCypherAlgorithm[] cypherTypes)
        {
            CypherAlgorithm[] converted = null;
            if (cypherTypes.Length == 0)
            {
                converted    = new CypherAlgorithm[1];
                converted[0] = CypherAlgorithm.CAST5;
                return(converted);
            }

            converted = new CypherAlgorithm[cypherTypes.Length];

            for (int i = 0; i < cypherTypes.Length; i++)
            {
                converted[i] = (CypherAlgorithm)cypherTypes[i];
            }

            return(converted);
        }