本文整理汇总了C++中Credentials::SetLogonEntry方法的典型用法代码示例。如果您正苦于以下问题:C++ Credentials::SetLogonEntry方法的具体用法?C++ Credentials::SetLogonEntry怎么用?C++ Credentials::SetLogonEntry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Credentials
的用法示例。
在下文中一共展示了Credentials::SetLogonEntry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RequestCredentials
bool NativeAuthListenerInternal::RequestCredentials(
/* [in] */ const char* authMechanism,
/* [in] */ const char* authPeer,
/* [in] */ uint16_t authCount,
/* [in] */ const char* userName,
/* [in] */ uint16_t credMask,
/* [in] */ Credentials& credentials)
{
/*
* Take the authentication changed lock to prevent clients from changing the
* authListener out from under us while we are calling out into it.
*/
AutoPtr<ICredentials> cs;
{
AutoLock lock(mBusPtr->mBaAuthenticationChangeLock);
AutoPtr<IAuthListenerInternal> al;
mAuthListener->Resolve(EIID_IAuthListenerInternal, (IInterface**)&al);
if (al == NULL) {
Logger::E("NativeAuthListenerInternal", "RequestCredentials(): Can't get new local reference to AuthListener");
return false;
}
al->RequestCredentials(String(authMechanism), String(authPeer),
(Int32)authCount, String(userName), (Int32)credMask, (ICredentials**)&cs);
}
if (cs == NULL) {
Logger::E("NativeAuthListenerInternal", "RequestCredentials(): Null return from method");
return false;
}
AutoPtr< ArrayOf<Byte> > password;
cs->GetPassword((ArrayOf<Byte>**)&password);
if (password != NULL) {
credentials.SetPassword(qcc::String((const char*)password->GetPayload(), password->GetLength()));
}
String strUserName;
cs->GetUserName(&strUserName);
if (!strUserName.IsNull()) {
credentials.SetUserName(strUserName.string());
}
String certificateChain;
cs->GetCertificateChain(&certificateChain);
if (!certificateChain.IsNull()) {
credentials.SetCertChain(certificateChain.string());
}
String privateKey;
cs->GetPrivateKey(&privateKey);
if (!privateKey.IsNull()) {
credentials.SetPrivateKey(privateKey.string());
}
AutoPtr< ArrayOf<Byte> > logonEntry;
cs->GetLogonEntry((ArrayOf<Byte>**)&logonEntry);
if (logonEntry != NULL) {
credentials.SetLogonEntry(qcc::String((const char*)logonEntry->GetPayload(), logonEntry->GetLength()));
}
AutoPtr<IInteger32> expiration;
cs->GetExpiration((IInteger32**)&expiration);
if (expiration != NULL) {
Int32 seconds;
expiration->GetValue(&seconds);
credentials.SetExpiration(seconds);
}
return true;
}