Export (0) Print
Expand All
Expand Minimize

SetCredentialsAttributes function

Sets the attributes of a credential, such as the name associated with the credential. The information is valid for any security context created with the specified credential.

Syntax


SECURITY_STATUS WINAPI SetCredentialsAttributes(
  _In_  PCredHandle phCredential,
  _In_  unsigned long ulAttribute,
  _In_  void *pBuffer,
  unsigned long cbBuffer
);

Parameters

phCredential [in]

A handle of the credentials to be set.

ulAttribute [in]

Specifies the attribute to set. This parameter can be any of the following attributes.

ValueMeaning
SECPKG_CRED_ATTR_NAMES

Sets the name of a credential in a pBuffer parameter of type SecPkgCredentials_Names.

This attribute is not supported by Schannel in WOW64 mode.

SECPKG_CRED_ATTR_KDC_PROXY_SETTINGS

Sets the Kerberos proxy setting in a pBuffer parameter of type SecPkgCredentials_KdcProxySettings.

This attribute is only supported by Kerberos.

SECPKG_ATTR_SUPPORTED_ALGS

Sets the supported algorithms in a pBuffer parameter of type SecPkgCred_SupportedAlgs. All supported algorithms are included, regardless of whether they are supported by the provided certificate or enabled on the local computer.

This attribute is supported only by Schannel.

SECPKG_ATTR_CIPHER_STRENGTHS

Sets the cipher strengths in a pBuffer parameter of type SecPkgCred_CipherStrengths.

This attribute is supported only by Schannel.

SECPKG_ATTR_SUPPORTED_PROTOCOLS

Sets the supported algorithms in a pBuffer parameter of type SecPkgCred_SupportedProtocols. All supported protocols are included, regardless of whether they are supported by the provided certificate or enabled on the local computer.

This attribute is supported only by Schannel.

 

pBuffer [in]

A pointer to a buffer that contains the new attribute value. The type of structure returned depends on the value of ulAttribute.

cbBuffer

The size, in bytes, of the pBuffer buffer.

Return value

If the function succeeds, the return value is SEC_E_OK.

If the function fails, the return value may be one of the following error codes.

Return codeDescription
SEC_E_INVALID_HANDLE

The handle passed to the function is not valid.

SEC_E_UNSUPPORTED_FUNCTION

The specified attribute is not supported by Schannel. This return value will only be returned when the Schannel SSP is being used.

SEC_E_INSUFFICIENT_MEMORY

Not enough memory is available to complete the request.

 

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Sspi.h (include Security.h)

Library

Secur32.lib

DLL

Secur32.dll

Unicode and ANSI names

QueryCredentialsAttributesW (Unicode) and QueryCredentialsAttributesA (ANSI)

See also

SSPI Functions
AcquireCredentialsHandle
FreeContextBuffer
SCHANNEL_CRED
SecPkgCred_CipherStrengths
SecPkgCred_SupportedAlgs
SecPkgCred_SupportedProtocols
SecPkgCredentials_Names

 

 

Community Additions

ADD
Show:
© 2014 Microsoft