コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SecurityCredential" /> class.
        /// </summary>
        /// <param name="package">The security package to use.</param>
        /// <param name="use">The manner in which the credential will be used.</param>
        /// <exception cref="ArgumentNullException"><paramref name="package" /> is null.</exception>
        protected SecurityCredential(SecurityPackageInfo package, CredentialUse use)
        {
            PackageInfo = package ?? throw new ArgumentNullException(nameof(package));

            _safeCredentialHandle = new SafeCredentialHandle();
            _safeCredentialHandle.AcquireCredentialHandle(package.Name, use);

            _principleName = new Lazy <string>(() => _safeCredentialHandle.GetPrincipleName());
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClientSecurityCredential" /> class.
 /// </summary>
 /// <param name="package">The security package to use.</param>
 /// <exception cref="ArgumentNullException"><paramref name="package" /> is null.</exception>
 public ClientSecurityCredential(SecurityPackageInfo package)
     : base(package, CredentialUse.Outbound)
 {
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClientSecurityCredential" /> class.
 /// </summary>
 /// <param name="package">The security package to use.</param>
 /// <exception cref="SspiException">The specified security package could not be found.</exception>
 public ClientSecurityCredential(SecurityPackage package)
     : this(SecurityPackageInfo.GetSecurityPackage(package))
 {
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ServerSecurityCredential" /> class.
 /// </summary>
 /// <param name="package">The security package to use.</param>
 /// <exception cref="ArgumentNullException"><paramref name="package" /> is null.</exception>
 public ServerSecurityCredential(SecurityPackageInfo package)
     : base(package, CredentialUse.Inbound)
 {
 }