|
ここでは、CORBA セキュリティの C++ メソッドについて説明します。
Security::AttributeList get_attributes(
in Security::AttributeTypeList attributes
);
};
attributes
このメソッドは、プリンシパルの資格から特権などの属性を Current インタフェース用に取得します。
注意 : | defining_authority フィールドは常に空です。UBBCONFIG ファイルで定義されているセキュリティ レベルによって、get_attribute メソッドの一部の値を使用できない場合があります。追加された 2 つの値 (Group Id および Role ) は、UBBCONFIG ファイルでセキュリティ レベルが ACL または MANDATORY_ACL に設定されている場合に使用できます。 |
注意 : | この情報は、「CORBAservices: Common Object Services Specification」(1995 年 3 月 31 日改訂版、1997 年 11 月更新) の 15-103、104 ページから、OMG の許可を得て転載しています。 |
プリンシパルを認証し、オプションでプリンシパルの資格を取得します。
Security::AuthenticationStatus
authenticate(
in Security::AuthenticationMethodmethod
,
in Security::SecurityNamesecurity_name
,
in Security::Opaqueauth_data
,
in Security::AttributeListprivileges
,
out Credentialscreds
,
out Security::Opaquecontinuation_data
,
out Security::Opaqueauth_specific_data
);
method
security_name
milozzi@company.com
は、LDAP を有効にしたディレクトリ サービスで証明書をルックアップするのに使用する電子メール アドレス、milozzi_company.pem
はプライベート キー ファイル名です。
auth_data
Tobj:TuxedoSecurity
セキュリティ メカニズムを指定した場合、この引数の値は、コンフィグレーションされた認証のレベルによって異なります。Tobj::CertificateBased
引数を指定した場合、この引数の値は、プリンシパルのプライベート キーの復号化に使用するパス フレーズです。
privileges
creds
SecurityLevel2::Current::authenticate
メソッドの戻り値が SecAuthSuccess
になるまで使用できません。
continuation_data
SecurityLevel2::Current::authenticate
メソッドの戻り値が SecAuthContinue
の場合、この引数は、継続する認証の試行情報を格納します。戻り値は常に空です。
auth_specific_data
SecurityLevel2::Current::authenticate
メソッドは、プリンシパルを認証し、Oracle Tuxedo ドメインでのセッション時にプリンシパルで必要なオプションで特権属性を要求するために、クライアント アプリケーションによって使用されます。
Tobj::TuxedoSecurity
セキュリティ メカニズムを指定する場合、Tobj::PrincipalAuthenticator::logon
オペレーションを呼び出すことで同じ機能を取得できます。このオペレーションは、同じ機能を提供しますが、ATMI 認証セキュリティ メカニズムで使用するための特別なオペレーションです。
void set_credentials(
in Security::CredentialType cred_type,
in Credentials creds
);
cred_type
creds
このメソッドは、SecInvocationCredentials
にのみ設定できます。それ以外の値に設定すると、set_credentials
で CORBA::BAD_PARAM
が発生します。資格は、以前の SecurityLevel2::Current::get_credentials
または SecurityLevel2::PrincipalAuthenticator::authenticate
の呼び出しで取得済みになっている必要があります。
注意 : | この情報は、「CORBAservices: Common Object Services Specification」(1995 年 3 月 31 日改訂版、1997 年 11 月更新) の 15-104 ページから、OMG の許可を得て転載しています。 |
Credentials get_credentials(
in Security::CredentialType cred_type
);
cred_type
この呼び出しは、SecInvocationCredentials
の取得にのみ使用できます。それ以外の場合に使用すると、get_credentials
で CORBA::BAD_PARAM
が発生します。資格を使用できない場合、get_credentials
で CORBA::BAD_INV_ORDER
が発生します。
クライアント アプリケーションのアクティブな資格のみを返します。
注意 : | この情報は、「CORBAservices: Common Object Services Specification」(1995 年 3 月 31 日改訂版、1997 年 11 月更新) の 15-105 ページから、OMG の許可を得て転載しています。 |
readonly attribute PrincipalAuthenticator
principal_authenticator;
principal_authenticator
属性によって返された PrincipalAuthenticator
は、実際の型 Tobj::PrincipalAuthenticator
によるものです。したがって、Tobj::PrincipalAuthenticator
および SecurityLevel2::PrincipalAuthenticator
の双方として使用できます。
注意 : | このメソッドが無効な SecurityCurrent オブジェクトで呼び出された場合、CORBA::BAD_INV_ORDER が発生します。 |
プロセスに特有のプリンシパルの資格情報を表します。SecurityLevel2::Credentials
インタフェースをサポートする Credentials オブジェクトは、位置制約付きオブジェクトです。このオブジェクトの位置の外にリファレンスを渡そうとしたり、CORBA::ORB::object_to_string()
を使用してオブジェクトを外部化しようとしたりすると、CORBA::Marshall
例外が発生します。
#ifndef _SECURITY_LEVEL_2_IDL
#define _SECURITY_LEVEL_2_IDL
#include <SecurityLevel1.idl>
#pragma prefix “omg.org”
module SecurityLevel2
{
interface Credentials
{
attribute Security::AssociationOptions
invocation_options_supported;
attribute Security::AssociationOptions
invocation_options_required;
Security::AttributeList
get_attributes(
in Security::AttributeTypeList attributes );
boolean
is_valid(
out Security::UtcT expiry_time );
};
};
#endif /* _SECURITY_LEVEL_2_IDL */
class SecurityLevel2
{
public:
class Credentials;
typedef Credentials * Credentials_ptr;
class Credentials : public virtual CORBA::Object
{
public:
static Credentials_ptr _duplicate(Credentials_ptr obj);
static Credentials_ptr _narrow(CORBA::Object_ptr obj);
static Credentials_ptr _nil();
virtual Security::AssociationOptions
invocation_options_supported() = 0;
virtual void
invocation_options_supported(
const Security::AssociationOptions options ) = 0;
virtual Security::AssociationOptions
invocation_options_required() = 0;
virtual void
invocation_options_required(
const Security::AssociationOptions options ) = 0;
virtual Security::AttributeList *
get_attributes(
const Security::AttributeTypeList & attributes) = 0;
virtual CORBA::Boolean
is_valid( Security::UtcT_out expiry_time) = 0;
protected:
Credentials(CORBA::Object_ptr obj = 0);
virtual ~Credentials() { }
private:
Credentials( const Credentials&) { }
void operator=(const Credentials&) { }
}; // クラス Credentials
}; // クラス SecurityLevel2
Security::AttributeList get_attributes(
in AttributeTypeList attributes
);
attributes
このメソッドは、プリンシパルの資格に添付された属性リストを返します。属性タイプのリストでは、AttributeList
に返す属性タイプの値だけを含める必要があります。属性は現在、属性ファミリまたは ID に基づいて返されません。ほとんどの場合、どのインスタンスでもプリンシパルの資格の有効なセットは 1 つしかないので、これは、SecurityLevel1::Current::get_attributes()
を呼び出した場合と同じ結果です。結果は、資格が使用中でない場合には異なる可能性があります。
注意 : | この情報は、「CORBAservices: Common Object Services Specification」(1995 年 3 月 31 日改訂版、1997 年 11 月更新) の 15-97 ページから、OMG の許可を得て転載しています。 |
SSL 接続を確立して Oracle Tuxedo ドメインでオブジェクトに対する呼び出しを実行する際に使用できるセキュリティ オプションの最大数を示します。
attribute Security::AssociationOptions
invocation_options_supported
;
このメソッドは、SecurityLevel2::Credentials::invocation_options_required
メソッドと組み合わせて使用する必要があります。
セキュリティの関連付けに Tobj::TuxedoSecurity
セキュリティ メカニズムを使用する場合、NoProtection
、EstablishTrustInClient
、および SimpleDelegation
セキュリティ オプションのみが返されます。Oracle Tuxedo ドメインへのアクセスにパスワードが要求されるように CORBA アプリケーションのセキュリティ レベルが定義された場合にのみ、EstablishTrustInClient
セキュリティ オプションが表示されます。
注意 : | 指定したセキュリティ オプションが、CORBA アプリケーション用に定義されたセキュリティ メカニズムでサポートされていない場合、CORBA::NO_PERMISSION 例外が返されます。この例外は、指定したセキュリティ オプションが、SecurityLevel2::Credentials::invocation_options_required メソッドで指定したセキュリティ オプションよりも少ない機能しか持っていない場合にも発生します。 |
注意 : | invocation_options_supported 属性には、set() メソッドと get() メソッドがあります。Tobj::TuxedoSecurity セキュリティ メカニズムを使用して Credentials オブジェクトを取得する場合には、set() メソッドを使用できません。Tobj::TuxedoSecurity セキュリティ メカニズムで set() メソッドを使用すると、CORBA::NO_PERMISSION 例外が返されます。 |
SSL 接続を確立して Oracle Tuxedo ドメインで対象オブジェクトに対する呼び出しを実行する際に使用できるセキュリティ オプションの最少数を指定します。
attribute Security::AssociationOptions
invocation_options_required
;
このメソッドを使用すると、プリンシパルと Oracle Tuxedo ドメインの間の通信の保護を指定できます。このメソッドを使用すると、Credentials オブジェクトは、定義したセキュリティ オプションのレベルの SSL プロトコルを使用して対象オブジェクトに対する呼び出しを実行します。このメソッドは、SecurityLevel2::Credentials::invocation_options_supported
メソッドと組み合わせて使用する必要があります。
セキュリティの関連付けに Tobj::TuxedoSecurity
セキュリティ メカニズムを使用する場合、NoProtection
、EstablishTrustInClient
、および SimpleDelegation
セキュリティ オプションのみが返されます。Oracle Tuxedo ドメインへのアクセスにパスワードが要求されるように CORBA アプリケーションのセキュリティ レベルが定義された場合にのみ、EstablishTrustInClient
セキュリティ オプションが表示されます。
注意 : | 指定したセキュリティ オプションが、CORBA アプリケーション用に定義されたセキュリティ メカニズムでサポートされていない場合、CORBA::NO_PERMISSION 例外が返されます。この例外は、指定したセキュリティ オプションが、SecurityLevel2::Credentials::invocation_options_supported メソッドで指定したセキュリティ オプションよりも多い機能を持っている場合にも発生します。 |
注意 : | invocation_options_required 属性には、set() メソッドと get() メソッドがあります。Tobj::TuxedoSecurity セキュリティ メカニズムを使用して Credentials オブジェクトを取得する場合には、set() メソッドを使用できません。Tobj::TuxedoSecurity セキュリティ メカニズムで set() メソッドを使用すると、CORBA::NO_PERMISSION 例外が返されます。 |
boolean is_valid(
out Security::UtcT expiry_time
);
使用された資格がそのときにアクティブな場合、このメソッドは、TRUE
を返します。つまり、Tobj::PrincipalAuthenticator::logoff
または Tobj_Bootstrap::destroy_current
を呼び出していないということです。Tobj::PrincipalAuthenticator::logoff()
の後にこのメソッドが呼び出された場合、FALSE
が返されます。Tobj_Bootstrap::destroy_current()
の後にこのメソッドが呼び出された場合、CORBA::BAD_INV_ORDER
例外が発生します。
返された有効期限には、maximum unsigned long long
値 (C++) が含まれています。unsigned long long
データ型が適用されると、ulonglong
が控えのデータ型になります。ulonglong
データ型は次のように定義します。
// ulonglong データ型の仮の定義
// これは、すべてのクライアント ORB による型の拡張の適用を保留
struct ulonglong {
unsigned long low;
unsigned long high;
};
注意 : | この情報は、「CORBAservices: Common Object Services Specification」(1995 年 3 月 31 日改訂版、1997 年 11 月更新) の 15-97 ページから、OMG の許可を得て転載しています。 |
プリンシパルを認証できるようにします。SecurityLevel2::PrincipalAuthenticator
インタフェースをサポートする Principal Authenticator オブジェクトは、位置制約付きオブジェクトです。このオブジェクトの位置の外にリファレンスを渡そうとしたり、CORBA::ORB::object_to_string()
を使用してオブジェクトを外部化しようとしたりすると、CORBA::Marshall
例外が発生します。
#ifndef _SECURITY_LEVEL_2_IDL
#define _SECURITY_LEVEL_2_IDL
#include <SecurityLevel1.idl>
#pragma prefix “omg.org”
module SecurityLevel2
{
interface PrincipalAuthenticator
{ // 位置制約付き
Security::AuthenticationStatus authenticate (
in Security::AuthenticationMethod method,
in Security::SecurityName security_name,
in Security::Opaque auth_data,
in Security::AttributeList privileges,
out Credentials creds,
out Security::Opaque continuation_data,
out Security::Opaque auth_specific_data
);
Security::AuthenticationStatus continue_authentication (
in Security::Opaque response_data,
in Credentials creds,
out Security::Opaque continuation_data,
out Security::Opaque auth_specific_data
);
};
};
#endif // SECURITY_LEVEL_2_IDL
#pragma prefix "beasys.com"
module Tobj
{
const Security::AuthenticationMethod
TuxedoSecurity = 0x54555800;
CertificateBased = 0x43455254;
};
class SecurityLevel2
{
public:
class PrincipalAuthenticator;
typedef PrincipalAuthenticator * PrincipalAuthenticator_ptr;
class PrincipalAuthenticator : public virtual CORBA::Object
{
public:
static PrincipalAuthenticator_ptr
_duplicate(PrincipalAuthenticator_ptr obj);
static PrincipalAuthenticator_ptr
_narrow(CORBA::Object_ptr obj);
static PrincipalAuthenticator_ptr _nil();
virtual Security::AuthenticationStatus
authenticate (
Security::AuthenticationMethod method,
const char * security_name,
const Security::Opaque & auth_data,
const Security::AttributeList & privileges,
Credentials_out creds,
Security::Opaque_out continuation_data,
Security::Opaque_out auth_specific_data) = 0;
virtual Security::AuthenticationStatus
continue_authentication (
const Security::Opaque & response_data,
Credentials_ptr & creds,
Security::Opaque_out continuation_data,
Security::Opaque_out auth_specific_data) = 0;
protected:
PrincipalAuthenticator(CORBA::Object_ptr obj = 0);
virtual ~PrincipalAuthenticator() { }
private:
PrincipalAuthenticator( const PrincipalAuthenticator&) { }
void operator=(const PrincipalAuthenticator&) { }
}; // クラス PrincipalAuthenticator
};
Security::AuthenticationStatus continue_authentication(
in Security::Opaque response_data,
in Credentials creds,
out Security::Opaque continuation_data,
out Security::Opaque auth_specific_data
);
Oracle Tuxedo ソフトウェアは 1 つの手順で認証を実行するため、このメソッドは常に失敗し、Security::AuthenticationStatus::SecAuthFailure
を返します。
常に Security::AuthenticationStatus::SecAuthFailure
を返します。
注意 : | この情報は、「CORBAservices: Common Object Services Specification」(1995 年 3 月 31 日改訂版、1997 年 11 月更新) の 15-92、93 ページから、OMG の許可を得て転載しています。 |
Oracle Tuxedo ドメインによって予測されている認証のタイプを取得します。
AuthType get_auth_type();
このメソッドは、Oracle Tuxedo ドメインによって予測されている認証のタイプを返します。
注意 : | このメソッドが無効な SecurityCurrent オブジェクトで呼び出された場合、CORBA::BAD_INV_ORDER が発生します。 |
Tobj_AuthType
列挙へのリファレンス。Oracle Tuxedo ドメインへのアクセスに必要な認証のタイプを返します。次の表は、有効な戻り値について説明しています。
Security::AuthenticationStatus logon(
in string user_name,
in string client_name,
in string system_password,
in string user_password,
in UserAuthData user_data
);
user_name
TOBJ_NOAUTH
です。user_name
が NULL または空の場合、あるいは 30 文字を超えている場合、logon
で CORBA::BAD_PARAM
が発生します。
client_name
TOBJ_NOAUTH
です。client_name
が NULL または空の場合、あるいは 30 文字を超えている場合、logon で CORBA::BAD_PARAM
例外が発生します。
system_password
TOBJ_SYSAUTH
です。クライアント名が NULL または空の場合、あるいは 30 文字を超えている場合、logon で CORBA::BAD_PARAM
例外が発生します。
注意 : | system_password は、30 文字以内で指定する必要があります。 |
user_password
user_data
TOBJ_APPAUTH
です。
注意 : | TOBJ_SYSAUTH には、TOBJ_NOAUTH に加えてクライアント アプリケーション パスワードの要件が含まれます。TOBJ_APPAUTH には、TOBJ_SYSAUTH に加えて、ユーザ パスワードまたはユーザ データなどの追加情報が含まれます。 |
注意 : | user_password 引数と user_data 引数は相互に排他的であり、Oracle Tuxedo ドメインのコンフィグレーションで使用する認証サービスの要件によって異なります。Oracle Tuxedo のデフォルト認証サービスでは、ユーザ パスワードの方を予期します。カスタマイズされた認証サービスでは、ユーザ データを要求するものもあります。user_password と user_data の両方が設定されている場合、ログオン呼び出しで CORBA::BAD_PARAM 例外が発生します。 |
このメソッドは、プリンシパルが Oracle Tuxedo ドメインにアクセスできるように IIOP リスナ/ハンドラを介してプリンシパルを認証します。このメソッドは SecurityLevel2::PrincipalAuthenticator::authenticate
と同じ機能ですが、引数は ATMI 認証指向です。
注意 : | このメソッドが無効な SecurityCurrent オブジェクトで呼び出された場合、CORBA::BAD_INV_ORDER が発生します。 |
プリンシパルに関連付けられたセキュリティ コンテキストを破棄します。
void logoff();
この呼び出しは、セキュリティ コンテキストを破棄しますが、Oracle Tuxedo ドメインへのネットワーク接続を閉じません。Logoff
でも、現在の資格を無効化できます。認証タイプが TOBJ_NOAUTH
でない場合、ログオフした後の既存のオブジェクト参照を使用した呼び出しは失敗します。
プリンシパルが現在 Oracle Tuxedo ドメインに対して認証されている場合、Tobj_Bootstrap::destroy_current()
を呼び出すと、暗黙的に logoff
が呼び出されます。
注意 : | このメソッドが無効な SecurityCurrent オブジェクトで呼び出された場合、CORBA::BAD_INV_ORDER が発生します。 |
SecurityLevel2::PrincipalAuthenticator::authenticate
で使用する認証データと属性を作成します。
void build_auth_data(
in string user_name,
in string client_name,
in string system_password,
in string user_password,
in UserAuthData user_data,
out Security::Opaque auth_data,
out Security::AttributeList privileges
);
引数
user_name
client_name
system_password
user_password
user_data
auth_data
privileges
authenticate
で使用します。
注意 : | user_name 、client_name 、または system_password が NULL または空の場合、あるいは 30 文字を超えている場合、以降の authenticate メソッド呼び出しで CORBA::BAD_PARAM 例外が発生します。 |
注意 : | user_password パラメータと user_data パラメータは相互に排他的であり、Oracle Tuxedo ドメインのコンフィグレーションで使用する認証サービスの要件によって異なります。Oracle Tuxedo のデフォルト認証サービスでは、ユーザ パスワードの方を予期します。カスタマイズされた認証サービスでは、ユーザ データを要求するものもあります。user_password と user_data の両方が設定されている場合、以降の認証呼び出しで CORBA::BAD_PARAM 例外が発生します。 |
説明
このメソッドは、SecurityLevel2::PrincipalAuthenticator::authenticate
で使用する認証データと属性を作成するヘルパー関数です。
注意 : | このメソッドが無効な SecurityCurrent オブジェクトで呼び出された場合、CORBA::BAD_INV_ORDER が発生します。 |