JavaTM Platform
Standard Ed. 6

javax.xml.crypto.dsig.keyinfo
인터페이스 KeyValue

모든 슈퍼 인터페이스:
XMLStructure


public interface KeyValue
extends XMLStructure

W3C Recommendation for XML-Signature Syntax and Processing 」로 정의되고 있는 XML KeyValue 요소의 표현. KeyValue 객체에는, 서명의 검증에 편리한 단일의 공개키가 포함됩니다. XML schema 정의는, 다음과 같이 정의됩니다.

    <element name="KeyValue" type="ds:KeyValueType"/>
    <complexType name="KeyValueType" mixed="true">
      <choice>
        <element ref="ds:DSAKeyValue"/>
        <element ref="ds:RSAKeyValue"/>
        <any namespace="##other" processContents="lax"/>
      </choice>
    </complexType>

    <element name="DSAKeyValue" type="ds:DSAKeyValueType"/>
    <complexType name="DSAKeyValueType">
      <sequence>
        <sequence minOccurs="0">
          <element name="P" type="ds:CryptoBinary"/>
          <element name="Q" type="ds:CryptoBinary"/>
        </sequence>
        <element name="G" type="ds:CryptoBinary" minOccurs="0"/> 
        <element name="Y" type="ds:CryptoBinary"/> 
        <element name="J" type="ds:CryptoBinary" minOccurs="0"/>
        <sequence minOccurs="0">
          <element name="Seed" type="ds:CryptoBinary"/> 
          <element name="PgenCounter" type="ds:CryptoBinary"/> 
        </sequence>
      </sequence>
    </complexType>

    <element name="RSAKeyValue" type="ds:RSAKeyValueType"/>
    <complexType name="RSAKeyValueType">
      <sequence>
        <element name="Modulus" type="ds:CryptoBinary"/> 
        <element name="Exponent" type="ds:CryptoBinary"/>
      </sequence>
    </complexType>
 
KeyValue 인스턴스는,KeyInfoFactory 클래스의 newKeyValue 메소드를 호출해, 공개키의 값을 표현하는 PublicKey 에 건네주는 것에 의해 작성됩니다. 다음에,KeyStore 내에 포함되는 Certificate DSAPublicKey 로부터 KeyValue 를 작성하는 예를 나타냅니다.
 KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
 PublicKey dsaPublicKey = keyStore.getCertificate("myDSASigningCert"). getPublicKey();
 KeyInfoFactory factory = KeyInfoFactory.getInstance("DOM");
 KeyValue keyValue = factory.newKeyValue(dsaPublicKey);
 
이 클래스는, 형 DSAPublicKeyRSAPublicKey 의 객체로서 각각 DSAKeyValueRSAKeyValue 를 돌려줍니다. schema내의 모든 필드가, 이러한 형태의 파라미터로서 액세스 가능인 것은 아닙니다.

도입된 버젼:
1.6
관련 항목:
KeyInfoFactory.newKeyValue(PublicKey)

필드의 개요
static String DSA_TYPE
          DSA KeyValue KeyInfo 형을 식별하는 URI: http://www.w3.org/2000/09/xmldsig#DSAKeyValue.
static String RSA_TYPE
          RSA KeyValue KeyInfo 형을 식별하는 URI: http://www.w3.org/2000/09/xmldsig#RSAKeyValue.
 
메소드의 개요
 PublicKey getPublicKey ()
          이 KeyValue 의 공개키를 돌려줍니다.
 
인터페이스 javax.xml.crypto. XMLStructure 로부터 상속된 메소드
isFeatureSupported
 

필드의 상세

DSA_TYPE

static final String  DSA_TYPE
DSA KeyValue KeyInfo 형을 식별하는 URI: http://www.w3.org/2000/09/xmldsig#DSAKeyValue. 이것은,RetrievalMethod 클래스의 type 파라미터의 값으로 해서 지정해, 원격의 DSAKeyValue 구조를 기술할 수 있습니다.

관련 항목:
정수 필드치

RSA_TYPE

static final String  RSA_TYPE
RSA KeyValue KeyInfo 형을 식별하는 URI: http://www.w3.org/2000/09/xmldsig#RSAKeyValue. 이것은,RetrievalMethod 클래스의 type 파라미터의 값으로 해서 지정해, 원격의 RSAKeyValue 구조를 기술할 수 있습니다.

관련 항목:
정수 필드치
메소드의 상세

getPublicKey

PublicKey  getPublicKey()
                       throws KeyException 
KeyValue 의 공개키를 돌려줍니다.

반환값:
KeyValue 의 공개키
예외:
KeyException - KeyValuePublicKey 로 변환할 수 없는 경우

JavaTM Platform
Standard Ed. 6

버그의 보고와 기능의 요청
한층 더 자세한 API 레퍼런스 및 개발자 문서에 대해서는,Java SE 개발자용 문서를 참조해 주세요. 개발자전용의 상세한 해설, 개념의 개요, 용어의 정의, 버그의 회피책, 및 코드 실례가 포함되어 있습니다.

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.