ヘッダーをスキップ
Oracle® Fusion Middleware Oracle Security Developer Toolsリファレンス
11gリリース1(11.1.1)
B61386-01
  目次
目次
索引
索引

戻る
戻る
 
次へ
次へ
 

11 Oracle Liberty SDK

Liberty Allianceは、個人および企業が貴重なアイデンティティ情報のプライバシやセキュリティを危険にさらすことなく、ほとんどすべてのトランザクションを実行できるようにすることを目標に設立されたオープンな組織です。Liberty Allianceによって発行された仕様は、オープンなアイデンティティ・フェデレーション・フレームワークに基づいています。このような仕様により、業務提携する企業は、組織をまたがるフェデレーテッド・ネットワーク・アイデンティティ・モデルに基づいた業務関係を形成できるようになります。

この章では、Oracle Liberty SDKの機能と利点、Oracle Liberty SDKの環境設定および使用方法について説明します。

この章に含まれる内容は次のとおりです。

11.1 Oracle Liberty SDKの機能と利点

Java開発者は、Oracle Liberty SDKを使用して、シングル・サインオン(SSO)およびフェデレーテッド・アイデンティティ管理(FIM)ソリューションを設計および開発することができます。Oracle Liberty SDKは、Liberty Alliance ID-FF 1.1および1.2の仕様に準拠するシステムの開発と統合のあらゆる面の統一、単純化および拡張を目的としています。

Oracle Liberty SDK 1.1および1.2では、直観的でわかりやすいJava APIを使用することでソフトウェア開発の単純化が実現されています。このツールキットによって、Liberty Alliance仕様に準拠するソリューションの開発を支援するツール、情報およびサンプルが提供されます。また、ツールキットは、アプレット、アプリケーション、EJB、サーブレット、JSPなど、あらゆる既存のJavaソリューションに透過的に統合できます。

Oracle Liberty SDKは、次の機能を提供するPure Javaソリューションです。


関連項目:

Liberty Alliance仕様は、http://www.projectliberty.org/resources/specifications.phpを参照してください。

11.2 Oracle Liberty 1.1

この項では、Oracle Liberty 1.1を使用するための環境設定、およびOracle Liberty 1.1のクラスとインタフェースについて説明します。この項に含まれる内容は次のとおりです。

11.2.1 Oracle Liberty 1.1の環境設定

Oracleセキュリティ開発ツールは、Oracle Application ServerとともにORACLE_HOMEにインストールされます。

この項では、Oracle Liberty 1.1を使用するための環境設定について説明します。この項に含まれる内容は次のとおりです。

11.2.1.1 Oracle Liberty 1.1のシステム要件

Oracle Liberty 1.1を使用するには、システムにJava Development Kit(JDK)バージョン1.5以上が必要です。

11.2.1.2 CLASSPATH環境変数の設定

CLASSPATH環境変数には、必要なjarファイルおよびclassファイルすべてのフルパスとファイル名を指定してください。次の項目をCLASSPATHに指定します。

  • osdt_core.jar

  • osdt_cert.jar

  • osdt_xmlsec.jar

  • osdt_saml.jar

  • org.jaxen_1.1.1.jarファイル(Oracle XML Securityディストリビューションに含まれるJaxen XPathエンジン)

  • osdt_lib_v11.jarファイル

11.2.1.2.1 WindowsでのCLASSPATHの設定

WindowsでCLASSPATHを設定する手順を次に示します。

  1. Windowsの「コントロール パネル」で「システム」を選択します。

  2. 「システムのプロパティ」ダイアログで「詳細設定」タブを選択します。

  3. 「環境変数」をクリックします。

  4. ユーザー環境変数のセクションで「新規」をクリックし、CLASSPATH環境変数をユーザー・プロファイルに追加します。CLASSPATH環境変数がすでに存在している場合は、選択して「編集」をクリックします。

  5. 必要なjarファイルすべてのフルパスとファイル名をCLASSPATHに追加します。

    たとえば、CLASSPATHは次のようになります。

    %CLASSPATH%;%ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_core.jar;
    %ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_cert.jar;
    %ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_xmlsec.jar;
    %ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_saml.jar;
    %ORACLE_HOME%\modules\org.jaxen_1.1.1.jar;
    %ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_lib_v11.jar;
    
  6. 「OK」をクリックします。

11.2.1.2.2 UNIXでのCLASSPATHの設定

UNIXでCLASSPATHを設定するには、必要なjarファイルおよびclassファイルすべてのフルパスとファイル名を含むようにCLASSPATH環境変数を設定します。次に例を示します。

setenv CLASSPATH $CLASSPATH:$ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_core.jar:
$ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_cert.jar:
$ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_xmlsec.jar:
$ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_saml.jar:
$ORACLE_HOME/modules/org.jaxen_1.1.1.jar:
$ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_lib_v11.jar

11.2.2 Oracle Liberty 1.1のクラスとインタフェースの概要

この項では、Oracle Liberty SDKリリース1.1の有用なクラスとインタフェースの一部を示します。この項に含まれる内容は次のとおりです。

11.2.2.1 コア・クラスとインタフェース

この項では、Oracle Liberty SDKリリース1.1のコア・クラスとインタフェースについて説明します。

コア・クラスを次に示します。

11.2.2.1.1 oracle.security.xmlsec.liberty.v11.AuthnRequestクラス

このクラスは、Libertyプロトコル・スキーマのAuthnRequest要素を表します。

例11-1に、新しいAuthnRequest要素を作成して文書に追加する方法を示します。

例11-1 AuthnRequest要素の作成と文書への追加

Document doc = Instance of org.w3c.dom.Document;
AuthnRequest authnRequest = new AuthnRequest(doc);
doc.getDocumentElement().appendChild(authnRequest);

例11-2に、AuthnRequest要素をXML文書から取得する方法を示します。

例11-2 文書からのAuthnRequest要素の取得

Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all AuthnRequest elements in the document.
NodeList arList = 
    doc.getElementsByTagNameNS(LibertyURI.ns_liberty, "AuthnRequest"); 
if (arList.getLength() == 0)
    System.err.println("No AuthnRequest elements found.");
 
// Convert each org.w3c.dom.Node object to an
// oracle.security.xmlsec.liberty.v11.AuthnRequest object and process
for (int s = 0, n = arList.getLength(); s < n; ++s)
{
    AuthnRequest authnRequest = 
        new AuthnRequest((Element)arList.item(s)); 

    // Process AuthnRequest element
    ...
}
11.2.2.1.2 oracle.security.xmlsec.liberty.v11.AuthnResponseクラス

このクラスは、Libertyプロトコル・スキーマのAuthnResponse要素を表します。

例11-3に、新しいAuthnResponse要素を作成して文書に追加する方法を示します。

例11-3 AuthnResponse要素の作成と文書への追加

Document doc = Instance of org.w3c.dom.Document;
AuthnResponse authnResponse = new AuthnResponse(doc);
doc.getDocumentElement().appendChild(authnResponse);

例11-4に、AuthnResponse要素をXML文書から取得する方法を示します。

例11-4 文書からのAuthnResponse要素の取得

Document doc = Instance of org.w3c.dom.Document;

// Get list of all AuthnResponse elements in the document.
NodeList arList = 
    doc.getElementsByTagNameNS(LibertyURI.ns_liberty, "AuthnResponse");
if (arList.getLength() == 0)
    System.err.println("No AuthnResponse elements found.");
 
// Convert each org.w3c.dom.Node object to an
// oracle.security.xmlsec.liberty.v11.AuthnResponse object and process
for (int s = 0, n = arList.getLength(); s < n; ++s)
{
    AuthnResponse authnResponse = 
        new AuthnResponse((Element)arList.item(s)); 
    // Process AuthnResponse element
    ...
}
11.2.2.1.3 oracle.security.xmlsec.liberty.v11.FederationTerminationNotificationクラス

このクラスは、Libertyプロトコル・スキーマのFederationTerminationNotification要素を表します。

例11-5に、新しいフェデレーション終了通知要素を作成して文書に追加する方法を示します。

例11-5 FederationTerminationNotification要素の作成と文書への追加

Document doc = Instance of org.w3c.dom.Document;
FederationTerminationNotification ftn = 
    new FederationTerminationNotification(doc);
doc.getDocumentElement().appendChild(ftn);

例11-6に、フェデレーション終了通知要素をXML文書から取得する方法を示します。

例11-6 文書からのFederationTerminationNotification要素の取得

Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all FederationTerminationNotification elements in the document
         NodeList ftnList = doc.getElementsByTagNameNS(LibertyURI.ns_liberty, 
    "FederationTerminationNotification");
if (ftnList.getLength() == 0)
    System.err.println("No FederationTerminationNotification elements found.");
 
// Convert each org.w3c.dom.Node object to an 
// oracle.security.xmlsec.liberty.v11.FederationTerminationNotification 
// object and process
for (int s = 0, n = ftnList.getLength(); s < n; ++s)
{
    FederationTerminationNotification ftn =
         new FederationTerminationNotification((Element)ftnList.item(s));

    // Process FederationTerminationNotification element
    ...
}
11.2.2.1.4 oracle.security.xmlsec.liberty.v11.LogoutRequestクラス

このクラスは、Libertyプロトコル・スキーマのLogoutRequest要素を表します。

例11-7に、新しいLogoutRequest要素を作成して文書に追加する方法を示します。

例11-7 LogoutRequest要素の作成と文書への追加

Document doc = Instance of org.w3c.dom.Document;
LogoutRequest lr = new LogoutRequest(doc);
doc.getDocumentElement().appendChild(lr);

例11-8に、LogoutRequest要素をXML文書から取得する方法を示します。

例11-8 XML文書からのLogoutRequest要素の取得

Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all LogoutRequest elements in the document.
NodeList lrList = doc.getElementsByTagNameNS(LibertyURI.ns_liberty, 
    "LogoutRequest");
if (lrList.getLength() == 0)
    System.err.println("No LogoutRequest elements found.");
 
// Convert each org.w3c.dom.Node object to an 
// oracle.security.xmlsec.liberty.v11.LogoutRequest
// object and process
for (int s = 0, n = lrList.getLength(); s < n; ++s)
{
    LogoutRequest lr = new LogoutRequest((Element)lrList.item(s));

    // Process LogoutRequest element
    ...
}
11.2.2.1.5 oracle.security.xmlsec.liberty.v11.LogoutResponseクラス

このクラスは、Libertyプロトコル・スキーマのLogoutResponse要素を表します。

例11-9に、新しいLogoutResponse要素を作成して文書に追加する方法を示します。

例11-9 LogoutResponse要素の作成と文書への追加

Document doc = Instance of org.w3c.dom.Document;
LogoutResponse lr = new LogoutResponse(doc);
doc.getDocumentElement().appendChild(lr);

例11-10に、LogoutResponse要素をXML文書から取得する方法を示します。

例11-10 文書からのLogoutResponse要素の取得

Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all LogoutResponse elements in the document.
NodeList lrList = 
    doc.getElementsByTagNameNS(LibertyURI.ns_liberty, "LogoutResponse");
if (lrList.getLength() == 0)
    System.err.println("No LogoutResponse elements found.");
 
// Convert each org.w3c.dom.Node object to an 
// oracle.security.xmlsec.liberty.v11.LogoutResponse
// object and process
for (int s = 0, n = lrList.getLength(); s < n; ++s)
{
    LogoutResponse lr = new LogoutResponse((Element)lrList.item(s));
                        
    // Process LogoutResponse element
    ...
}
11.2.2.1.6 oracle.security.xmlsec.liberty.v11.RegisterNameIdentifierRequestクラス

このクラスは、Libertyプロトコル・スキーマのRegisterNameIdentifierRequest要素を表します。

例11-11に、新しいRegisterNameIdentifierRequest要素を作成して文書に追加する方法を示します。

例11-11 RegisterNameIdentifierRequest要素の作成と文書への追加

Document doc = Instance of org.w3c.dom.Document;
RegisterNameIdentifierRequest rnir = 
    new RegisterNameIdentifierRequest(doc);
doc.getDocumentElement().appendChild(rnir);

例11-12に、RegisterNameIdentifierRequest要素をXML文書から取得する方法を示します。

例11-12 XML文書からのRegisterNameIdentifierRequest要素の取得

Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all RegisterNameIdentifierRequest elements in the document
NodeList rnirList = doc.getElementsByTagNameNS(LibertyURI.ns_liberty, 
    "RegisterNameIdentifierRequest");
if (rnirList.getLength() == 0)
    System.err.println("No RegisterNameIdentifierRequest elements found.");
 
// Convert each org.w3c.dom.Node object to an 
//oracle.security.xmlsec.liberty.v11.RegisterNameIdentifierRequest
// object and process
for (int s = 0, n = rnirList.getLength(); s < n; ++s)
{
    RegisterNameIdentifierRequest rnir = new 
        RegisterNameIdentifierRequest((Element)rnirList.item(s));
                        
    // Process RegisterNameIdentifierRequest element
    ...
}
11.2.2.1.7 oracle.security.xmlsec.liberty.v11.RegisterNameIdentifierResponseクラス

このクラスは、Libertyプロトコル・スキーマのRegisterNameIdentifierResponse要素を表します。

例11-13に、新しいRegisterNameIdentifierResponse要素を作成して文書に追加する方法を示します。

例11-13 RegisterNameIdentifierResponse要素の作成と文書への追加

Document doc = Instance of org.w3c.dom.Document;
RegisterNameIdentifierResponse rnir = new RegisterNameIdentifierResponse(doc);
doc.getDocumentElement().appendChild(rnir);

例11-14に、RegisterNameIdentifierResponse要素をXML文書から取得する方法を示します。

例11-14 XML文書からのRegisterNameIdentifierResponse要素の取得

Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all RegisterNameIdentifierResponse elements in the document
NodeList rnirList = doc.getElementsByTagNameNS(LibertyURI.ns_liberty, 
    "RegisterNameIdentifierResponse");
if (rnirList.getLength() == 0)
    System.err.println("No RegisterNameIdentifierResponse elements found.");
 
// Convert each org.w3c.dom.Node object to an 
// oracle.security.xmlsec.liberty.v11.RegisterNameIdentifierResponse
// object and process
for (int s = 0, n = rnirList.getLength(); s < n; ++s)
{
    RegisterNameIdentifierResponse rnir = new 
        RegisterNameIdentifierResponse((Element)rnirList.item(s));

    // Process RegisterNameIdentifierResponse element
    ...
}

11.2.2.2 サポート・クラスとインタフェース

この項では、Oracle Liberty SDKリリース1.1のサポート・クラスとインタフェースについて説明します。

サポート・クラスとインタフェースを次に示します。

11.2.2.2.1 oracle.security.xmlsec.liberty.v11.LibertyInitializerクラス

oracle.security.xmlsec.liberty.v11.LibertyInitializerクラスは、Oracle Liberty SDKライブラリのロード時の初期化と構成を処理します。このクラスの静的なinitialize()メソッドをコールしてから、Oracle Liberty SDKのAPIをコールする必要があります。

11.2.2.2.2 oracle.security.xmlsec.liberty.v11.LibertyURIインタフェース

oracle.security.xmlsec.liberty.v11.LibertyURIインタフェースは、アルゴリズム、ネームスペースおよびオブジェクトのURI文字列定数を定義します。次のネーミング規則が使用されます。

  • アルゴリズムのURIはalg_で始まります。

  • ネームスペースのURIはns_で始まります。

  • オブジェクト・タイプのURIはobj_で始まります。

  • LibertyプロファイルのネームスペースURIはprof_で始まります。

11.2.2.2.3 oracle.security.xmlsec.liberty.v11.ac.AuthenticationContextURIインタフェース

oracle.security.xmlsec.liberty.v11.ac.AuthenticationContextURIインタフェースは、アルゴリズム、ネームスペースおよびオブジェクトのURI文字列定数を定義します。次のネーミング規則が使用されます。

  • アルゴリズムのURIはalg_で始まります。

  • ネームスペースのURIはns_で始まります。

  • オブジェクト・タイプのURIはobj_で始まります。

11.2.2.2.4 oracle.security.xmlsec.util.ac.AuthenticationContextStatementクラス

oracle.security.xmlsec.util.ac.AuthenticationContextStatementクラスは、Liberty認証コンテキスト・スキーマの最上位レベルのAuthenticationContextStatement要素を表す抽象クラスです。このクラスの各具体実装は、Liberty認証コンテキスト仕様で定義された各クラスを表します。

11.2.2.2.5 oracle.security.xmlsec.saml.SAMLURIインタフェース

oracle.security.xmlsec.saml.SAMLURIインタフェースは、アルゴリズム、ネームスペースおよびオブジェクトのURI文字列定数を定義します。次のネーミング規則が使用されます。

  • SAML 1.0仕様に定義されているアクションのネームスペースURIは、action_で始まります。

  • SAML 1.0仕様に定義されている認証メソッドのネームスペースURIは、authentication_method_で始まります。

  • SAML 1.0仕様に定義されている確認メソッドのネームスペースURIは、confirmation_method_で始まります。

  • ネームスペースのURIはns_で始まります。

11.2.2.2.6 oracle.security.xmlsec.saml.SAMLMessageクラス

oracle.security.xmlsec.saml.SAMLMessageクラスは、すべてのSAMLおよびSAML拡張メッセージのベース・クラスです。署名することができ、XML-DSIG構造体を含むことが可能です。

11.2.3 Oracle Liberty SDK 1.1のAPIリファレンス

Oracle Liberty SDKバージョン1.1のAPIリファレンスは次のドキュメントで参照できます。

Oracle Fusion Middleware Liberty 1.1 Java API Reference for Oracle Security Developer Tools

11.2.4 サンプル・プログラム

Oracleセキュリティ開発ツールを使用したサンプル・プログラムについては、Oracle Technology Network Webサイト(http://www.oracle.com/technology/sample_code/products/id_mgmt/index.html)を参照してください。

11.3 Oracle Liberty 1.2

この項では、Oracle Liberty 1.2のクラスとインタフェースを示し、環境を設定してOracle Liberty 1.2を使用する方法について説明します。次の項目について説明します。

11.3.1 Oracle Liberty 1.2の環境設定

Oracleセキュリティ開発ツールは、Oracle Application ServerとともにORACLE_HOMEにインストールされます。

この項では、Oracle Liberty 1.2を使用するための環境設定について説明します。この項に含まれる内容は次のとおりです。

11.3.1.1 Oracle Liberty 1.2のシステム要件

Oracle Liberty 1.2を使用するには、システムにJava Development Kit(JDK)バージョン1.5以上が必要です。また、PATH環境変数にJava binディレクトリが指定されていることを確認してください。

11.3.1.2 CLASSPATH環境変数の設定

CLASSPATH環境変数には、必要なjarファイルおよびclassファイルすべてのフルパスとファイル名を指定してください。次の項目をCLASSPATHに指定します。

  • osdt_core.jar

  • osdt_cert.jar

  • osdt_xmlsec.jar

  • osdt_saml.jar

  • org.jaxen_1.1.1.jarファイル(Oracle XML Securityディストリビューションに含まれるJaxen XPathエンジン)

  • osdt_lib_v12.jar

11.3.1.2.1 WindowsでのCLASSPATHの設定

WindowsでCLASSPATHを設定する手順を次に示します。

  1. Windowsの「コントロール パネル」で「システム」を選択します。

  2. 「システムのプロパティ」ダイアログで「詳細設定」タブを選択します。

  3. 「環境変数」をクリックします。

  4. ユーザー環境変数のセクションで「新規」をクリックし、CLASSPATH環境変数をユーザー・プロファイルに追加します。CLASSPATH環境変数がすでに存在している場合は、選択して「編集」をクリックします。

  5. 必要なjarファイルすべてのフルパスとファイル名をCLASSPATHに追加します。

    たとえば、CLASSPATHは次のようになります。

    %CLASSPATH%;%ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_core.jar;
    %ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_cert.jar;
    %ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_xmlsec.jar;
    %ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_saml.jar;
    %ORACLE_HOME%\modules\org.jaxen_1.1.1.jar;
    %ORACLE_HOME%\modules\oracle.osdt_11.1.1\osdt_lib_v12.jar;
    
  6. 「OK」をクリックします。

11.3.1.2.2 UnixでのCLASSPATHの設定

UNIXでは、必要なjarファイルおよびclassファイルすべてのフルパスとファイル名を含むようにCLASSPATH環境変数を設定します。次に例を示します。

setenv CLASSPATH $CLASSPATH:$ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_core.jar:
$ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_cert.jar:
$ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_xmlsec.jar:
$ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_saml.jar:
$ORACLE_HOME/modules/org.jaxen_1.1.1.jar:
$ORACLE_HOME/modules/oracle.osdt_11.1.1/osdt_lib_v12.jar

11.3.2 Oracle Liberty 1.2のクラスとインタフェースの概要

この項では、Oracle Liberty SDKリリース1.2の有用なクラスとインタフェースの一部を示します。この項に含まれる内容は次のとおりです。

11.3.2.1 コア・クラスとインタフェース

この項では、Oracle Liberty SDKリリース1.2のコア・クラスとインタフェースについて説明します。

コア・クラスを次に示します。

11.3.2.1.1 oracle.security.xmlsec.saml.Assertionクラス

oracle.security.xmlsec.saml.Assertionクラスは、SAMLアサーション・スキーマのAssertion要素を表します。

例11-15に、新しいAssertion要素を作成して文書に追加する方法を示します。

例11-15 Assertion要素の作成と文書への追加

Document doc = Instance of org.w3c.dom.Document;
Assertion assertion = new Assertion(doc);
doc.getDocumentElement().appendChild(assertion);

例11-16に、Assertion要素をXML文書から取得する方法を示します。

例11-16 文書からのAssertion要素の取得

Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all Assertion elements in the document
NodeList assrtList = 
    doc.getElementsByTagNameNS(SAMLURI.ns_saml, "Assertion");
if (assrtList.getLength() == 0)
    System.err.println("No Assertion elements found.");
 
// Convert each org.w3c.dom.Node object to 
// an oracle.security.xmlsec.saml.Assertion
// object and process
for (int s = 0, n = assrtList.getLength(); s < n; ++s)
{
    Assertion assertion = new Assertion((Element)assrtList.item(s));

    // Process Assertion element
    ...
}
11.3.2.1.2 oracle.security.xmlsec.samlp.Requestクラス

oracle.security.xmlsec.samlp.Requestクラスは、SAMLプロトコル・スキーマのRequest要素を表します。

例11-17に、新しいRequest要素を作成して文書に追加する方法を示します。

例11-17 Request要素の作成と文書への追加

Document doc = Instance of org.w3c.dom.Document;
Request request = new Request(doc);
doc.getDocumentElement().appendChild(request);

例11-18に、Request要素をXML文書から取得する方法を示します。

例11-18 文書からのRequest要素の取得

Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all Request elements in the document
NodeList reqList = 
    doc.getElementsByTagNameNS(SAMLURI.ns_samlp, "Request");
if (reqList.getLength() == 0)
    System.err.println("No Request elements found.");

// Convert each org.w3c.dom.Node object to an 
// oracle.security.xmlsec.samlp.Request
// object and process
for (int s = 0, n = reqList.getLength(); s < n; ++s)
{
    Request request = new Request((Element)reqList.item(s));

    // Process Request element
    ...
}
11.3.2.1.3 racle.security.xmlsec.samlp.Responseクラス

oracle.security.xmlsec.samlp.Responseクラスは、SAMLプロトコル・スキーマのResponse要素を表します。

例11-19に、新しい要素を作成して文書に追加する方法を示します。

例11-19 Response要素の作成と文書への追加

Document doc = Instance of org.w3c.dom.Document;
Response response = new Response(doc);
doc.getDocumentElement().appendChild(response);

例11-20に、Response要素をXML文書から取得する方法を示します。

例11-20 文書からのResponse要素の取得

Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all Response elements in the document
NodeList respList = 
    doc.getElementsByTagNameNS(SAMLURI.ns_samlp, "Response");
if (respList.getLength() == 0)
    System.err.println("No Response elements found.");
 
// Convert each org.w3c.dom.Node object to an 
// oracle.security.xmlsec.samlp.Response
// object and process
for (int s = 0, n = respList.getLength(); s < n; ++s)
{
    Response response = new Response((Element)respList.item(s));

    // Process Response element
    ...
}
11.3.2.1.4 oracle.security.xmlsec.liberty.v12.AuthnRequestクラス

oracle.security.xmlsec.liberty.v12.AuthnRequestクラスは、Libertyプロトコル・スキーマのAuthnRequest要素を表します。

例11-21に、新しい認可リクエスト要素を作成して文書に追加する方法を示します。

例11-21 AuthnRequest要素の作成と文書への追加

Document doc = Instance of org.w3c.dom.Document;
AuthnRequest authnRequest = new AuthnRequest(doc);
doc.getDocumentElement().appendChild(authnRequest);

例11-22に、AuthnRequest要素をXML文書から取得する方法を示します。

例11-22 文書からのAuthnRequest要素の取得

Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all AuthnRequest elements in the document
NodeList arList = doc.getElementsByTagNameNS(LibertyURI.ns_liberty, "AuthnRequest");

if (arList.getLength() == 0)
    System.err.println("No AuthnRequest elements found.");
 
// Convert each org.w3c.dom.Node object to
// an oracle.security.xmlsec.liberty.v12.AuthnRequest
// object and process
for (int s = 0, n = arList.getLength(); s < n; ++s)
{
    AuthnRequest authnRequest = new AuthnRequest((Element)arList.item(s));

    // Process AuthnRequest element
    ...
}
11.3.2.1.5 oracle.security.xmlsec.liberty.v12.AuthnResponseクラス

oracle.security.xmlsec.liberty.v12.AuthnResponseクラスは、Libertyプロトコル・スキーマのAuthnResponse要素を表します。

例11-23に、新しい認可レスポンス要素を作成して文書に追加する方法を示します。

例11-23 AuthnResponse要素の作成と文書への追加

Document doc = Instance of org.w3c.dom.Document;
AuthnResponse authnResponse = new AuthnResponse(doc);
doc.getDocumentElement().appendChild(authnResponse);

例11-24に、AuthnResponse要素をXML文書から取得する方法を示します。

例11-24 文書からのAuthnResponse要素の取得

Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all AuthnResponse elements in the document.
NodeList arList = 
    doc.getElementsByTagNameNS(LibertyURI.ns_liberty, "AuthnResponse");
if (arList.getLength() == 0)
    System.err.println("No AuthnResponse elements found.");
 
// Convert each org.w3c.dom.Node object to 
// an oracle.security.xmlsec.liberty.v12.AuthnResponse
// object and process
for (int s = 0, n = arList.getLength(); s < n; ++s)
{
    AuthnResponse authnResponse = 
        new AuthnResponse((Element)arList.item(s));

    // Process AuthnResponse element
    ...
}
11.3.2.1.6 oracle.security.xmlsec.liberty.v12.FederationTerminationNotificationクラス

oracle.security.xmlsec.liberty.v12.FederationTerminationNotificationクラスは、Libertyプロトコル・スキーマのFederationTerminationNotification要素を表します。

例11-25に、新しいフェデレーション終了通知要素を作成して文書に追加する方法を示します。

例11-25 DocumentFederationTerminationNotification要素の作成と文書への追加

Document doc = Instance of org.w3c.dom.Document;
FederationTerminationNotification ftn = 
    new FederationTerminationNotification(doc);
doc.getDocumentElement().appendChild(ftn);

例11-26に、フェデレーション終了通知要素をXML文書から取得する方法を示します。

例11-26 文書からのFederationTerminationNotification要素の取得

Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all FederationTerminationNotification elements in the document
NodeList ftnList = doc.getElementsByTagNameNS(LibertyURI.ns_liberty,
    "FederationTerminationNotification");
if (ftnList.getLength() == 0)
    System.err.println("No FederationTerminationNotification elements found.");
 
// Convert each org.w3c.dom.Node object to an
// oracle.security.xmlsec.liberty.v12.FederationTerminationNotification
// object and process
for (int s = 0, n = ftnList.getLength(); s < n; ++s)
{
    FederationTerminationNotification ftn = new 
        FederationTerminationNotification((Element)ftnList.item(s));

    // Process FederationTerminationNotification element
    ...
}
11.3.2.1.7 oracle.security.xmlsec.liberty.v12.LogoutRequestクラス

oracle.security.xmlsec.liberty.v12.LogoutRequestクラスは、Libertyプロトコル・スキーマのLogoutRequest要素を表します。

例11-27に、新しい要素を作成して文書に追加する方法を示します。

例11-27 新しいLogoutRequest要素の作成と文書への追加

Document doc = Instance of org.w3c.dom.Document;
LogoutRequest lr = new LogoutRequest(doc);
doc.getDocumentElement().appendChild(lr);

例12-28に、ログアウト・リクエスト要素をXML文書から取得する方法を示します。

例11-28 XML文書からのLogoutRequest要素の取得

Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all LogoutRequest elements in the document
NodeList lrList = 
    doc.getElementsByTagNameNS(LibertyURI.ns_liberty, "LogoutRequest");
if (lrList.getLength() == 0)
    System.err.println("No LogoutRequest elements found.");
 
// Convert each org.w3c.dom.Node object to
// an oracle.security.xmlsec.liberty.v12.LogoutRequest
// object and process
for (int s = 0, n = lrList.getLength(); s < n; ++s)
{
    LogoutRequest lr = new LogoutRequest((Element)lrList.item(s));

    // Process LogoutRequest element
    ...
}
11.3.2.1.8 oracle.security.xmlsec.liberty.v12.LogoutResponseクラス

oracle.security.xmlsec.liberty.v12.LogoutResponseクラスは、Libertyプロトコル・スキーマのLogoutResponse要素を表します。

例11-29に、新しいログアウト・レスポンス要素を作成して文書に追加する方法を示します。

例11-29 新しいLogoutResponse要素の作成と文書への追加

Document doc = Instance of org.w3c.dom.Document;
LogoutResponse lr = new LogoutResponse(doc);
doc.getDocumentElement().appendChild(lr);
 

例11-30に、ログアウト・レスポンス要素をXML文書から取得する方法を示します。

例11-30 XML文書からのLogoutResponse要素の取得

Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all LogoutResponse elements in the document
NodeList lrList = 
    doc.getElementsByTagNameNS(LibertyURI.ns_liberty, "LogoutResponse");
if (lrList.getLength() == 0)
    System.err.println("No LogoutResponse elements found.");
 
// Convert each org.w3c.dom.Node object to
// an oracle.security.xmlsec.liberty.v12.LogoutResponse
// object and process
for (int s = 0, n = lrList.getLength(); s < n; ++s)
{
    LogoutResponse lr = new LogoutResponse((Element)lrList.item(s));

    // Process LogoutResponse element
    ...
}
11.3.2.1.9 oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierRequestクラス

oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierRequestクラスは、Libertyプロトコル・スキーマのRegisterNameIdentifierRequest要素を表します。

例11-31に、新しいRegisterNameIdentifierRequest要素を作成して文書に追加する方法を示します。

例11-31 新しいRegisterNameIdentifierRequest要素の作成と文書への追加

Document doc = Instance of org.w3c.dom.Document;
RegisterNameIdentifierRequest rnir = new RegisterNameIdentifierRequest(doc);
doc.getDocumentElement().appendChild(rnir);

例11-32に、RegisterNameIdentifierRequest要素をXML文書から取得する方法を示します。

例11-32 XML文書からのRegisterNameIdentifierRequest要素の取得

Document doc = Instance of org.w3c.dom.Document;
 
// Get list of all 
// RegisterNameIdentifierRequest elements 
// in the document
NodeList rnirList = 
    doc.getElementsByTagNameNS(LibertyURI.ns_liberty,
    "RegisterNameIdentifierRequest");
if (rnirList.getLength() == 0)
    System.err.println("No RegisterNameIdentifierRequest elements found.");
 
// Convert each org.w3c.dom.Node object to a 
// oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierRequest
// object and process
for (int s = 0, n = rnirList.getLength(); s < n; ++s)
{
    RegisterNameIdentifierRequest rnir =
         new RegisterNameIdentifierRequest((Element)rnirList.item(s));

    // Process RegisterNameIdentifierRequest element
    ...
}
11.3.2.1.10 oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierResponseクラス

oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierResponseクラスは、Libertyプロトコル・スキーマのRegisterNameIdentifierResponse要素を表します。

例11-33に、新しいRegisterNameIdentifierResponse要素を作成して文書に追加する方法を示します。

例11-33 新しいRegisterNameIdentifierResponse要素の作成と文書への追加

Document doc = Instance of org.w3c.dom.Document;
RegisterNameIdentifierResponse rnir = 
    new RegisterNameIdentifierResponse(doc);
doc.getDocumentElement().appendChild(rnir);

例11-34に、RegisterNameIdentifierResponse要素をXML文書から取得する方法を示します。

例11-34 文書からのRegisterNameIdentifierResponse要素の取得

Document doc = Instance of org.w3c.dom.Document;

// Get list of all RegisterNameIdentifierResponse elements in the document
NodeList rnirList = 
    doc.getElementsByTagNameNS(LibertyURI.ns_liberty, 
        "RegisterNameIdentifierResponse");

if (rnirList.getLength() == 0)
    System.err.println("No RegisterNameIdentifierResponse elements found.");
 
// Convert each org.w3c.dom.Node object to an 
// oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierResponse
// object and process
for (int s = 0, n = rnirList.getLength(); s < n; ++s)
{
    RegisterNameIdentifierResponse rnir = new 
        RegisterNameIdentifierResponse((Element)rnirList.item(s));

    // Process RegisterNameIdentifierResponse element
    ...
}

11.3.2.2 サポート・クラスとインタフェース

この項では、Oracle Liberty SDKリリース1.2のサポート・クラスとインタフェースについて説明します。

  • oracle.security.xmlsec.liberty.v12.LibertyInitializerクラス

  • oracle.security.xmlsec.liberty.v12.LibertyURIインタフェース

  • oracle.security.xmlsec.util.ac.AuthenticationContextStatementクラス

  • oracle.security.xmlsec.saml.SAMLInitializerクラス

  • oracle.security.xmlsec.saml.SAMLURIインタフェース

11.3.2.2.1 oracle.security.xmlsec.liberty.v12.LibertyInitializerクラス

このクラスは、Oracle Liberty SDK 1.2ライブラリのロード時の初期化と構成を処理します。このクラスの静的なinitialize()メソッドをコールしてから、Oracle Liberty SDK 1.2のAPIをコールする必要があります。

11.3.2.2.2 oracle.security.xmlsec.liberty.v12.LibertyURIインタフェース

このインタフェースは、アルゴリズム、ネームスペースおよびオブジェクトのURI文字列定数を定義します。

11.3.2.2.3 oracle.security.xmlsec.util.ac.AuthenticationContextStatementクラス

これは、Liberty認証コンテキスト・スキーマの最上位レベルのAuthenticationContextStatement要素を表す抽象クラスです。このクラスの各具体実装は、Liberty認証コンテキスト仕様で定義された各クラスを表します。

11.3.2.2.4 oracle.security.xmlsec.saml.SAMLInitializerクラス

このクラスは、Oracle SAMLライブラリのロード時の初期化と構成を処理します。リリース1.1では、このクラスの静的なinitialize(int major, int minor)メソッドをコールしてから、Oracle SAML Toolkit API for SAML 1.1をコールする必要があります。

11.3.2.2.5 oracle.security.xmlsec.saml.SAMLURIインタフェース

oracle.security.xmlsec.saml.SAMLURIインタフェースは、アルゴリズム、ネームスペースおよびオブジェクトのURI文字列定数を定義します。次のネーミング規則が使用されます。

  • SAML 1.1仕様に定義されているアクションのネームスペースURIは、action_で始まります。

  • SAML 1.1仕様に定義されている認証メソッドのネームスペースURIは、authentication_method_で始まります。

  • SAML 1.1仕様に定義されている確認メソッドのネームスペースURIは、confirmation_method_で始まります。

  • ネームスペースのURIはns_で始まります。

11.3.2.2.6 oracle.security.xmlsec.saml.SAMLMessageクラス

oracle.security.xmlsec.saml.SAMLMessageは、すべてのSAMLおよびSAML拡張メッセージのベース・クラスです。署名することができ、XML-DSIG構造体を含むことが可能です。

11.3.3 Oracle Liberty SDK 1.2のAPIリファレンス

Oracle Liberty SDKバージョン1.2のAPIリファレンス(Javadoc)は次のドキュメントで参照できます。

Oracle Fusion Middleware Liberty 1.2 Java API Reference for Oracle Security Developer Tools

11.3.4 サンプル・プログラム

Oracleセキュリティ開発ツールを使用したサンプル・プログラムについては、Oracle Technology Network Webサイト(http://www.oracle.com/technology/sample_code/products/id_mgmt/index.html)を参照してください。