summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Security/SL3_SecurityManager.cpp
blob: 0aa06b8c5cad3fb126251229ae2cb0d211c88a40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// $Id$

#include "SL3_SecurityManager.h"
#include "SL3_ContextEstablishmentPolicy.h"
#include "SL3_ObjectCredentialsPolicy.h"


ACE_RCSID (Security,
           SL3_SecurityManager,
           "$Id$")


TAO_BEGIN_VERSIONED_NAMESPACE_DECL

TAO::SL3::SecurityManager::SecurityManager (
  SecurityLevel3::CredentialsCurator_ptr cc)
  : credentials_curator_ (SecurityLevel3::CredentialsCurator::_duplicate (cc))
{
}

TAO::SL3::SecurityManager::~SecurityManager (void)
{
}

SecurityLevel3::CredentialsCurator_ptr
TAO::SL3::SecurityManager::credentials_curator (
    ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  return
    SecurityLevel3::CredentialsCurator::_duplicate (
      this->credentials_curator_.in ());
}

SecurityLevel3::TargetCredentials_ptr
TAO::SL3::SecurityManager::get_target_credentials (CORBA::Object_ptr /* the_object */
                                                   ACE_ENV_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (),
                    SecurityLevel3::TargetCredentials::_nil ());
}

SecurityLevel3::ContextEstablishmentPolicy_ptr
TAO::SL3::SecurityManager::create_context_estab_policy (
    SecurityLevel3::CredsDirective creds_directive,
    const SecurityLevel3::OwnCredentialsList & creds_list,
    SecurityLevel3::FeatureDirective use_client_auth,
    SecurityLevel3::FeatureDirective use_target_auth,
    SecurityLevel3::FeatureDirective use_confidentiality,
    SecurityLevel3::FeatureDirective use_integrity
    ACE_ENV_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  SecurityLevel3::ContextEstablishmentPolicy_ptr policy;
  ACE_NEW_THROW_EX (policy,
                    TAO::SL3::ContextEstablishmentPolicy (creds_directive,
                                                          creds_list,
                                                          use_client_auth,
                                                          use_target_auth,
                                                          use_confidentiality,
                                                          use_integrity),
                    CORBA::NO_MEMORY ());
  ACE_CHECK_RETURN (policy);

  return policy;
}

SecurityLevel3::ObjectCredentialsPolicy_ptr
TAO::SL3::SecurityManager::create_object_creds_policy (
    const SecurityLevel3::OwnCredentialsList & creds_list
    ACE_ENV_ARG_DECL)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  SecurityLevel3::ObjectCredentialsPolicy_ptr policy;
  ACE_NEW_THROW_EX (policy,
                    TAO::SL3::ObjectCredentialsPolicy (creds_list),
                    CORBA::NO_MEMORY ());
  ACE_CHECK_RETURN (policy);

  return policy;
}

TAO_END_VERSIONED_NAMESPACE_DECL