internal SharedAccessSignatureTokenProvider(string keyName, string sharedAccessKey, TimeSpan tokenTimeToLive) { if (string.IsNullOrEmpty(keyName)) { throw new ArgumentNullException("keyName"); } if (keyName.Length > MaxKeyNameLength) { throw new ArgumentOutOfRangeException( "keyName", SRCore.ArgumentStringTooBig("keyName", MaxKeyNameLength)); } if (string.IsNullOrEmpty(sharedAccessKey)) { throw new ArgumentNullException("sharedAccessKey"); } if (sharedAccessKey.Length > MaxKeyLength) { throw new ArgumentOutOfRangeException( "sharedAccessKey", SRCore.ArgumentStringTooBig("sharedAccessKey", MaxKeyLength)); } this._encodedSharedAccessKey = Encoding.UTF8.GetBytes(sharedAccessKey); this._keyName = keyName; this._tokenTimeToLive = tokenTimeToLive; }
internal SharedAccessSignatureTokenProvider(string keyName, string sharedAccessKey, TimeSpan tokenTimeToLive, Microsoft.ServiceBus.TokenScope tokenScope) : base(true, true, tokenScope) { if (string.IsNullOrEmpty(keyName)) { throw new ArgumentNullException("keyName"); } if (keyName.Length > 256) { throw new ArgumentOutOfRangeException("keyName", SRCore.ArgumentStringTooBig("keyName", 256)); } if (string.IsNullOrEmpty(sharedAccessKey)) { throw new ArgumentNullException("sharedAccessKey"); } if (sharedAccessKey.Length > 256) { throw new ArgumentOutOfRangeException("sharedAccessKey", SRCore.ArgumentStringTooBig("sharedAccessKey", 256)); } this.encodedSharedAccessKey = Encoding.UTF8.GetBytes(sharedAccessKey); this.keyName = keyName; this.tokenTimeToLive = tokenTimeToLive; }