Transform

Transform (변환)

W3C 권장 사항인 XML-Signature Syntax and Processing에 정의된 XML Transform 요소의 표현입니다.

출처: Java API Reference

본문

XML 스키마 정의는 다음과 같습니다.

<element name="Transform" type="ds:TransformType"/>
<complexType name="TransformType" mixed="true">
  <choice minOccurs="0" maxOccurs="unbounded">
    <any namespace="##other" processContents="lax"/>
    <element name="XPath" type="string"/>
  </choice>
  <attribute name="Algorithm" type="anyURI" use="required"/>
</complexType>

이 인터페이스는 XMLStructureAlgorithmMethod를 확장하며, 서명 데이터에 적용되는 변환 알고리즘을 나타냅니다.

주요 메서드는 다음과 같습니다.

  • getAlgorithm() – 변환 알고리즘을 식별하는 URI를 반환합니다.
  • getParameterSpec() – 변환의 알고리즘 매개변수를 반환합니다.
  • transform(Data data, XMLCryptoContext context) – 지정된 데이터에 대해 이 변환을 수행합니다.
  • transform(Data data, XMLCryptoContext context, OutputStream os) – 지정된 데이터에 변환을 수행하고 결과를 출력 스트림에 씁니다.

인터페이스에는 표준 변환 알고리즘의 URI 상수가 정의되어 있습니다.

  • BASE64 (http://www.w3.org/2000/09/xmldsig#base64) – Base64 디코딩/인코딩 변환입니다.
  • ENVELOPED (http://www.w3.org/2000/09/xmldsig#enveloped-signature) – 엔벨로프드 서명 변환입니다.
  • XPATH (http://www.w3.org/TR/1999/REC-xpath-19991116) – XPath 변환입니다.
  • XPATH2 (http://www.w3.org/2002/06/xmldsig-filter2) – XPath 필터 2.0 변환입니다.
  • XSLT (http://www.w3.org/TR/1999/REC-xslt-19991116) – XSLT 변환입니다.

더 알아보기 (Learn more)

Java 공식 API