/// <summary> /// Gets the platform enum value for the padding used by the specified algorithm. /// </summary> /// <param name="algorithm">The algorithm.</param> /// <returns>The platform-specific enum value for the padding.</returns> private static Platform.PaddingMode GetPadding(SymmetricAlgorithm algorithm) { switch (algorithm.GetPadding()) { case SymmetricAlgorithmPadding.None: return Platform.PaddingMode.None; case SymmetricAlgorithmPadding.PKCS7: return Platform.PaddingMode.PKCS7; default: throw new ArgumentException(); } }