public static object CreateSignatureFormatter(string uri) { if ((uri == null) || (uri.Length == 0)) { throw new ArgumentNullException("uri"); } return(KeyAlgorithm.CreateFormatter(WebServicesConfiguration.SecurityConfiguration.SignatureFormatters[uri])); }
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); }