Beispiel #1
0
        public void RSASHA1()
        {
            var metadata = SecurityAlgorithmRegistry.GetMetadata(SecurityAlgorithm.RSASHA1);

            Assert.IsNotNull(metadata);
        }
Beispiel #2
0
 public void UnknownAlgorithm()
 {
     SecurityAlgorithmRegistry.GetMetadata((SecurityAlgorithm)0xBA);
 }
Beispiel #3
0
        /// <summary>
        ///   Gets the hash algorithm for the <see cref="SecurityAlgorithm"/>.
        /// </summary>
        /// <param name="algorithm">
        ///   One of the <see cref="SecurityAlgorithm"/> values.
        /// </param>
        /// <returns>
        ///   A new instance of the <see cref="HashAlgorithm"/> that is used
        ///   for the <paramref name="algorithm"/>.
        /// </returns>
        /// <exception cref="NotImplementedException">
        ///   When the <paramref name="algorithm"/> or its <see cref="HashAlgorithm"/>
        ///   is not implemented.
        /// </exception>
        public static HashAlgorithm Create(SecurityAlgorithm algorithm)
        {
            var metadata = SecurityAlgorithmRegistry.GetMetadata(algorithm);

            return(Create(metadata.HashAlgorithm));
        }