Compartilhar via


CREDENTIAL (Windows CE 5.0)

Send Feedback

This structure is used by the Credential Manager API to read credentials from, and write credentials to, the registry. This structure is deprecated, use the CRED structure instead.

typedefstruct_CREDENTIAL{DWORDFlags;DWORDType;FILETIMELastWritten;DWORDCredentialBlobSize;LPBYTECredentialBlob;DWORDPersist;LPTSTRUserName;}CREDENTIAL,*PCREDENTIAL;

Members

  • Flags
    Bit field that specifies the credential's characteristics. Undefined bits must be set to zero, to avoid conflicts with future enhancements. The following table shows the possible flag.

    Flag Description
    CRED_FLAGS_PROMPT_NOW (2) If set, only the user name is saved; the credential BLOB (password) has not been written into the structure.

    NetUI writes the credential with this flag set, assuming the domain password will not be written until the user is prompted for it.

  • Type
    Credential type, which cannot be changed after the credential is created.

    Applications should allow for credential types they do not recognize. The following table shows the credential types.

    Type Description
    CRED_TYPE_GENERIC (1) Stored as an opaque BLOB, but it has no identifying characteristics.
    CRED_TYPE_DOMAIN_PASSWORD (2) Network user name and password.
    CRED_TYPE_DOMAIN_CERTIFICATE (3) A certificate credential specific to Microsoft authentication packages. It is a hash of the contents of a certificate in the local certificate store.
    CRED_TYPE_DOMAIN_VISIBLE_PASSWORD (4) A plaintext password, such as those used by Passport and RAS.
    CRED_TYPE_NTLM_PASSWORD (5) For internal use.
    CRED_TYPE_KERBEROS_PASSWORD (6) For internal use.
  • LastWritten
    Specifies the last time the stored credential was modified in UTC format.

  • CredentialBlobSize
    Size of the CredentialBlob data pointed to, in bytes. It cannot be longer than CRED_MAX_CREDENTIAL_BLOB_SIZE (512 characters).

  • CredentialBlob
    Pointer to the credential data.

    Credentials are expected to be portable. It is the application's responsibility to define the alignment and byte orientation of the data CredentialBlob points to. The following table shows the credential types.

    Type Description
    CRED_TYPE_GENERIC Defined by the application.
    CRED_TYPE_DOMAIN_PASSWORD Unused. Should be NULL.
    CRED_TYPE_DOMAIN_CERTIFICATE Points to an MD5 hash of the certificate. The hash indexes the certificate in the MY store.
    CRED_TYPE_DOMAIN_VISIBLE_PASSWORD Points to the cleartext Unicode password for UserName. The string pointed to is not a C string and does not include a trailing zero.
    CRED_TYPE_NTLM_PASSWORD Points to a credential with NTLM format.
    CRED_TYPE_KERBEROS_PASSWORD Points to a credential with Kerberos format.
  • Persist
    Defines the persistence of the credential. The following table shows the possible flags.

    Flag Description
    CRED_PERSIST_SESSION (1) This credential persists only for the current logon session. It is not visible to other logon sessions of the same user. It is discarded when the user logs off.
    CRED_PERSIST_LOCAL_MACHINE (2) This credential persists for all subsequent logon sessions on this machine. It is visible to other logon session of this user on this machine. It is not visible to logon sessions of this user on other machines.
  • UserName
    Points to a C string with the user name of the account. It cannot be longer than CRED_MAX_USERNAME_LENGTH (513) characters, including the trailing NULL.

    If the type is CRED_TYPE_GENERIC, the Credential Manager ignores this field, even if it is non-NULL.

    If the type is CRED_TYPE_DOMAIN_VISIBLE_PASSWORD or CRED_TYPE_DOMAIN_PASSWORD, the string is a DomainName\UserName, such as YourDomainName\KimAkers.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Credmgr.h.

See Also

Credential Manager Structures

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.