RMS SDK for C++  0.2.1
A client library for using Microsoft RMS from Linux.
ClientKey.h
1 /*
2  * ======================================================================
3  * Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
4  * Licensed under the MIT License.
5  * See LICENSE.md in the project root for license information.
6  * ======================================================================
7 */
8 
9 #ifndef CLIENTKEY_H
10 #define CLIENTKEY_H
11 
12 #include "types.h"
13 #include "ClientCredential.h"
14 #include "ClientAssertionCertificate.h"
15 #include "ClientAssertion.h"
16 #include "Authenticator.h"
17 
18 namespace rmsauth {
19 
20 class ClientKey
21 {
22 public:
23  ClientKey(ClientCredentialPtr clientCredential);
24  ClientKey(ClientAssertionCertificatePtr clientCertificate, AuthenticatorPtr authenticator);
25  ClientKey(ClientAssertionPtr clientAssertion);
26  ClientKey(const String& clientId);
27 
28  ClientCredentialPtr credential() const { return credential_; }
29  ClientAssertionCertificatePtr certificate() const { return certificate_; }
30  ClientAssertionPtr assertion() const { return assertion_; }
31  AuthenticatorPtr authenticator() const { return authenticator_; }
32  const String& clientId() const { return clientId_; }
33  bool hasCredential() const { return hasCredential_; }
34 
35 private:
36  ClientCredentialPtr credential_ = nullptr;
37  ClientAssertionCertificatePtr certificate_ = nullptr;
38  ClientAssertionPtr assertion_ = nullptr;
39  AuthenticatorPtr authenticator_ = nullptr;
40  String clientId_;
41  bool hasCredential_;
42 };
43 
44 using ClientKeyPtr = ptr<ClientKey>;
45 
46 } // namespace rmsauth {
47 
48 #endif // CLIENTKEY_H
Definition: ClientKey.h:20
Definition: AcquireTokenForClientHandler.h:14