Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| XML Digital Signature and Encryption, 1.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.xml.crypto.enc.keyinfo
Interface EncryptedKey

All Superinterfaces:
  EncryptedType, XMLStructure

    public interface EncryptedKey

extends EncryptedType

Represents the `EncryptedKey` element. Its schema definition is as follows:

     <element name='EncryptedKey' type='xenc:EncryptedKeyType'/>
     <complexType name='EncryptedKeyType'>
            <complexContent>
               <extension base='xenc:EncryptedType'>
                    <sequence>
                       <element ref='xenc:ReferenceList' minOccurs='0'/>
                       <element name='CarriedKeyName' type='string' minOccurs='0'/>
                    </sequence>
                    <attribute name='Recipient' type='string' use='optional'/>
               </extension>
            </complexContent>
     </complexType>

Field Summary
`static java.lang.String` | `TYPE` URI identifying the EncryptedKey KeyInfo type: http://www.w3.org/2001/04/xmlenc#EncryptedKey.

Fields inherited from interface javax.xml.crypto.enc.EncryptedType
`CONTENT, ELEMENT, XMLNS`

Method Summary
`java.io.InputStream` | `decrypt(XMLDecryptContext context)` Decrypts the `CipherData` in this `EncryptedKey`.
`java.security.Key` | `decryptKey(XMLDecryptContext context, AlgorithmMethod alg)` Decrypts the `CipherData` in this `EncryptedKey` and returns the decrypted key as a `Key` object.
`java.lang.String` | `getCarriedKeyName()` Returns the carried key name of this `EncryptedKey`.
`java.lang.String` | `getRecipient()` Returns a hint as to which recipient this `EncryptedKey` is intended for.
`java.util.List` | `getReferenceList()` Returns an unmodifiable list of `ReferenceType`s containing pointers to data and keys encrypted using this key.

Methods inherited from interface javax.xml.crypto.enc.EncryptedType
`encrypt, getCipherData, getCipherText, getEncoding, getEncryptionMethod, getEncryptionProperties, getId, getKeyInfo, getMimeType, getToBeEncrypted, getType`

Methods inherited from interface javax.xml.crypto.XMLStructure
`isFeatureSupported`

Field Detail

### TYPE

    static final java.lang.String TYPE

  URI identifying the EncryptedKey KeyInfo type: http://www.w3.org/2001/04/xmlenc#EncryptedKey. This can be specified as the value of the type parameter of the `RetrievalMethod` class to identify the referent's type.

  See Also:
    Constant Field Values

Method Detail

### getReferenceList

    java.util.List getReferenceList()

  Returns an unmodifiable list of `ReferenceType`s containing pointers to data and keys encrypted using this key.

  Returns:
    an unmodifiable list of `ReferenceType`s (may be empty but never `null`)

### getCarriedKeyName

    java.lang.String getCarriedKeyName()

  Returns the carried key name of this `EncryptedKey`.

  Returns:
    the carried key name or `null` if not specified

### getRecipient

    java.lang.String getRecipient()

  Returns a hint as to which recipient this `EncryptedKey` is intended for.

  Returns:
    the recipient or `null` if not specified

### decrypt

    java.io.InputStream decrypt(XMLDecryptContext context)
                                throws XMLEncryptionException

  Decrypts the `CipherData` in this `EncryptedKey`.

  Specified by:
    `decrypt` in interface `EncryptedType`
  Parameters:
    `context` - the decryption context
  Returns:
    the decrypted `CipherData` as an InputStream.
  Throws:
    `java.lang.NullPointerException` - if context is `null`
    `XMLEncryptionException` - if an error occurs while decrypting

### decryptKey

    java.security.Key decryptKey(XMLDecryptContext context,
                                 AlgorithmMethod alg)
                                 throws XMLEncryptionException

  Decrypts the `CipherData` in this `EncryptedKey` and returns the decrypted key as a `Key` object.

  Parameters:
    `context` - the decryption context
    `alg` - the algorithm of the decrypted key
  Returns:
    the decrypted `CipherData` as a key
  Throws:
    `java.lang.NullPointerException` - if context is `null` or alg is `null`.
    `XMLEncryptionException` - if an error occurs while decrypting

Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| XML Digital Signature and Encryption, 1.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2004, IBM Corporation and Sun Microsystems, Inc. All rights reserved.
Please send comments to: jsr-106-comments@jcp.org