- すべてのスーパー・インタフェース:
URIReference
,XMLStructure
public interface Reference extends URIReference, XMLStructure
「W3C Recommendation for XML-Signature Syntax and Processing」で定義されている
Reference
要素の表現。 XMLスキーマは次のように定義されます:
<element name="Reference" type="ds:ReferenceType"/> <complexType name="ReferenceType"> <sequence> <element ref="ds:Transforms" minOccurs="0"/> <element ref="ds:DigestMethod"/> <element ref="ds:DigestValue"/> </sequence> <attribute name="Id" type="ID" use="optional"/> <attribute name="URI" type="anyURI" use="optional"/> <attribute name="Type" type="anyURI" use="optional"/> </complexType> <element name="DigestValue" type="ds:DigestValueType"/> <simpleType name="DigestValueType"> <restriction base="base64Binary"/> </simpleType>
Reference
インスタンスは、XMLSignatureFactory
クラスのnewReference
メソッドの1つを呼び出すことで作成できます。たとえば:
XMLSignatureFactory factory = XMLSignatureFactory.getInstance("DOM"); Reference ref = factory.newReference ("http://www.ietf.org/rfc/rfc3275.txt", factory.newDigestMethod(DigestMethod.SHA1, null));
- 導入されたバージョン:
- 1.6
- 関連項目:
-
メソッドのサマリー
修飾子と型メソッド説明byte[]
検証操作のあとで、このReference
の計算されたダイジェスト値を返します。参照キャッシュが有効な場合、間接参照されたデータを返します。参照キャッシュが有効な場合、事前ダイジェストされた入力ストリームを返します。このReference
のダイジェスト・メソッドを返します。byte[]
このReference
のダイジェスト値を返します。getId()
このReference
のオプションのId
属性を返し、ほかの場所からこの参照が参照されることを許可します。このReference
に含まれるTransform
のunmodifiable list
を返します。boolean
validate
(XMLValidateContext validateContext) この参照を検証します。インタフェースjavax.xml.crypto.URIReferenceで宣言されたメソッド
getType, getURI
インタフェースjavax.xml.crypto.XMLStructureで宣言されたメソッド
isFeatureSupported
-
メソッドの詳細
-
getTransforms
このReference
に含まれるTransform
のunmodifiable list
を返します。- 戻り値:
Transform
の変更不可能なリスト。空の場合もあるがnull
になることはない
-
getDigestMethod
-
getId
String getId()このReference
のオプションのId
属性を返し、ほかの場所からこの参照が参照されることを許可します。- 戻り値:
Id
属性。指定されていない場合はnull
になることもある
-
getDigestValue
byte[] getDigestValue()このReference
のダイジェスト値を返します。- 戻り値:
- rawダイジェスト値。この参照がまだダイジェストされていない場合は
null
。 このメソッドの各呼出しでは、以後の変更から保護するために新しいクローンが返される。
-
getCalculatedDigestValue
byte[] getCalculatedDigestValue()検証操作のあとで、このReference
の計算されたダイジェスト値を返します。 このメソッドは、参照が検証に失敗した場合のデバッグに便利です。- 戻り値:
- 計算されたダイジェスト値。この参照がまだ検証されていない場合は
null
。 このメソッドの各呼出しでは、以後の変更から保護するために新しいクローンが返される。
-
validate
boolean validate(XMLValidateContext validateContext) throws XMLSignatureException この参照を検証します。 このメソッドは、この参照のダイジェストを検証します。このメソッドは参照が最初に呼び出されたときのみ検証します。 次回以降の呼出しでは、キャッシュされた結果を返します。
- パラメータ:
validateContext
- 検証するコンテキスト- 戻り値:
- この参照が正常に検証された場合は
true
。そうでない場合はfalse
- 例外:
NullPointerException
-validateContext
がnull
である場合XMLSignatureException
- 参照の検証中に予想外の例外が発生した場合
-
getDereferencedData
-
getDigestInputStream
InputStream getDigestInputStream()参照キャッシュが有効な場合、事前ダイジェストされた入力ストリームを返します。 これは、検証中または署名処理中のダイジェスト処理に対する入力です。- 戻り値:
- 事前ダイジェストされた入力を含む入力ストリーム。参照キャッシュが有効でない場合、あるいはこの参照が生成または検証されていない場合は
null
-