Ejemplo n.º 1
0
 public static object CreateSignatureFormatter(string uri)
 {
     if ((uri == null) || (uri.Length == 0))
     {
         throw new ArgumentNullException("uri");
     }
     return(KeyAlgorithm.CreateFormatter(WebServicesConfiguration.SecurityConfiguration.SignatureFormatters[uri]));
 }
Ejemplo n.º 2
0
        public virtual SymmetricKeyAlgorithm GenerateSessionKey(byte[] keyBytes)
        {
            SymmetricKeyAlgorithm alg = KeyAlgorithm.Create(this.DefaultSessionKeyAlgorithm) as SymmetricKeyAlgorithm;

            if (alg == null)
            {
                throw new ArgumentException("Failed to create Symmetric EncryptionFormatter named " + this.DefaultSessionKeyAlgorithm);
            }
            alg.KeyBytes = keyBytes;
            return(alg);
        }