ヘッダーをスキップ
Oracle® Fusion Middleware Oracle Security Developer Toolsによるアプリケーションの開発
12c (12.2.1)
E72521-01
  目次へ移動
目次

前
次
 

10 Oracle Liberty SDK

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

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

この章には次のトピックが含まれます:

10.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 ID-FFバージョン1.1および1.2仕様のサポート

  • Libertyベースのシングル・サインオンおよびフェデレーテッド・アイデンティティ・プロトコルのサポート

  • SAML 1.0/1.1仕様のサポート

関連項目:

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

10.2 Oracle Liberty 1.1

この項では、Oracle Liberty 1.1の環境設定方法と使用方法、およびOracle Liberty 1.1のクラスとインタフェースについて説明します。次の項目が含まれます。

10.2.1 Oracle Liberty 1.1の環境設定

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

10.2.1.1 Oracle Liberty 1.1のシステム要件の理解

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

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ファイル

たとえば、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;

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

Oracle Liberty 1.1の主要機能には、認証リクエスト/レスポンス、ログアウト・リクエスト/レスポンスおよびフェデレーション終了が含まれます。

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

10.2.2.1 コア・クラスとインタフェースの使用方法

Oracle Liberty SDK v. 1.1のコア・クラスおよびインタフェースにより、認証リクエストおよびレスポンス要素、ログアウト・リクエストおよびレスポンス要素、登録名識別子を作成できます。

この項には次のトピックが含まれます。

10.2.2.1.1 oracle.security.xmlsec.liberty.v11.AuthnRequestクラスの使用方法

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

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

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

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

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
    ...
}
10.2.2.1.2 oracle.security.xmlsec.liberty.v11.AuthnResponseクラスの使用方法

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

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

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

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

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
    ...
}
10.2.2.1.3 oracle.security.xmlsec.liberty.v11.FederationTerminationNotificationクラスの使用方法

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

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

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

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

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
    ...
}
10.2.2.1.4 oracle.security.xmlsec.liberty.v11.LogoutRequestクラスの使用方法

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

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

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

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

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
    ...
}
10.2.2.1.5 oracle.security.xmlsec.liberty.v11.LogoutResponseクラスの使用方法

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

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

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

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

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
    ...
}
10.2.2.1.6 oracle.security.xmlsec.liberty.v11.RegisterNameIdentifierRequestクラスの使用方法

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

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

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

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

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
    ...
}
10.2.2.1.7 oracle.security.xmlsec.liberty.v11.RegisterNameIdentifierResponseクラスの使用方法

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

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

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

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

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
    ...
}

10.2.2.2 サポート・クラスとインタフェースの使用方法

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

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

10.2.2.2.1 oracle.security.xmlsec.liberty.v11.LibertyInitializerクラスの使用方法

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

10.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_で始まります。

10.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_で始まります。

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

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

10.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_で始まります。

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

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

10.2.3 Oracle Liberty 1.1のAPIリファレンス

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

Oracle Fusion Middleware Oracle Security Developer Tools Java APIリファレンス

10.3 Oracle Liberty 1.2

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

これらの項目が含まれます。

10.3.1 Oracle Liberty 1.2の環境設定

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

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

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

たとえば、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

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

Liberty 1.2の有用なクラスには、アサーション、リクエスト、レスポンス、認証リクエスト/レスポンスおよびその他が含まれます。

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

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

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

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

10.3.2.1.1 oracle.security.xmlsec.saml.Assertionクラスの使用方法

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

次の例に、新しいアサーション要素を作成して文書に追加する方法を示します。

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

次の例に、アサーション要素をXML文書から取得する方法を示します。

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
    ...
}
10.3.2.1.2 oracle.security.xmlsec.samlp.Requestクラスの使用方法

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

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

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

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

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
    ...
}
10.3.2.1.3 oracle.security.xmlsec.samlp.Responseクラスの使用方法

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

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

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

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

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
    ...
}
10.3.2.1.4 oracle.security.xmlsec.liberty.v12.AuthnRequestクラスの使用方法

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

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

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

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

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
    ...
}
10.3.2.1.5 oracle.security.xmlsec.liberty.v12.AuthnResponseクラスの使用方法

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

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

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

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

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
    ...
}
10.3.2.1.6 oracle.security.xmlsec.liberty.v12.FederationTerminationNotificationクラスの使用方法

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

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

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

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

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
    ...
}
10.3.2.1.7 oracle.security.xmlsec.liberty.v12.LogoutRequestクラスの使用方法

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

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

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

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

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
    ...
}
10.3.2.1.8 oracle.security.xmlsec.liberty.v12.LogoutResponseクラスの使用方法

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

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

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

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

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
    ...
}
10.3.2.1.9 oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierRequestクラスの使用方法

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

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

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

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

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
    ...
}
10.3.2.1.10 oracle.security.xmlsec.liberty.v12.RegisterNameIdentifierResponseクラスの使用方法

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

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

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

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

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
    ...
}

10.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インタフェース

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

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

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

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

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

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

10.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をコールする必要があります。

10.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_で始まります。

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

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

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

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

Oracle Fusion Middleware Oracle Security Developer Tools Java APIリファレンス