Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12c (12.1.3)

Part Number E41849-02

weblogic.xml.security.encryption
Class EncryptedKey

java.lang.Object
  extended by weblogic.xml.security.encryption.EncryptedType
      extended by weblogic.xml.security.encryption.EncryptedKey
All Implemented Interfaces:
XMLEncConstants

public class EncryptedKey
extends EncryptedType


Field Summary
 
Fields inherited from class weblogic.xml.security.encryption.EncryptedType
nsMap, TYPE_CONTENT, TYPE_CONTENT_URI, TYPE_ELEMENT, TYPE_ELEMENT_URI, TYPE_OTHER
 
Fields inherited from interface weblogic.xml.security.encryption.XMLEncConstants
ATTR_ALGORITHM, ATTR_ENCODING, ATTR_ID, ATTR_MIME_TYPE, ATTR_RECIPIENT, ATTR_TYPE, ATTR_URI, CONTENT_ONLY, CONTENT_ONLY_PROPERTY, DEFAULT_ENC_ENCODING, TAG_CARRIED_KEY_NAME, TAG_CIPHER_DATA, TAG_CIPHER_VALUE, TAG_DATA_REFERENCE, TAG_ENCRYPTED_DATA, TAG_ENCRYPTED_KEY, TAG_ENCRYPTED_TYPE, TAG_ENCRYPTION_METHOD, TAG_KEY_REFERENCE, TAG_KEY_SIZE, TAG_OAEP_PARAMS, TAG_REFERENCE_LIST, TC_ENCRYPTED_DATA, TC_ENCRYPTED_KEY, TC_ENCRYPTION_METHOD, TC_REFERENCE_LIST, VERBOSE, VERBOSE_PROPERTY, VERBOSE_PROPERTY_ALT, XMLENC_PREFIX, XMLENC_URI
 
Constructor Summary
EncryptedKey(Key kek, Key wrappedKey, String wrappingAlg)
          Wraps a key with another key.
EncryptedKey(Key kek, String wrappedKeyAlg, String wrappingAlg)
          Generates a new symmetric key and wraps it with another key.
EncryptedKey(PublicKey kek)
          Generates a new DES3 symmetric key and wraps it using RSA OAEP
EncryptedKey(XMLInputStream in, String ns)
           
 
Method Summary
 String getCarriedKeyName()
           
 String getRecipient()
           
 ReferenceList getReferenceList()
           
 Key getWrappedKey()
           
 Key getWrappedKey(EncryptionMethod keyType)
           
static Key getWrappedKey(EncryptionMethod keyType, byte[] keyBytes)
           
protected  byte[] getWrappedKeyBytes()
           
static void main(String[] args)
           
 void setCarriedKeyName(String carriedKeyName)
           
 void setEncryptionMethod(EncryptionMethod em)
           
 void setRecipient(String recipient)
           
 void setReferenceList(ReferenceList referenceList)
           
 void setWrappedKey(Key key)
           
 String toString()
           
 void toXML(XMLOutputStream xos, int indent)
           
 void toXML(XMLOutputStream xos, String ns, int indent)
           
 
Methods inherited from class weblogic.xml.security.encryption.EncryptedType
clear, getCipherData, getEncryptionMethod, getId, getKey, getKeyInfo, getKeyResolver, getType, getTypeURI, setCipherData, setEncryptionMethod, setId, setKey, setKey, setKeyInfo, setKeyResolver, setType, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EncryptedKey

public EncryptedKey(PublicKey kek)
             throws EncryptionException
Generates a new DES3 symmetric key and wraps it using RSA OAEP

Throws:
EncryptionException

EncryptedKey

public EncryptedKey(Key kek,
                    String wrappedKeyAlg,
                    String wrappingAlg)
             throws EncryptionException
Generates a new symmetric key and wraps it with another key.

Parameters:
kek - The key to be used to wrap the generated key
wrappedKeyAlg - The algorithm URI corresponding to the type of key to generate.
wrappingAlg - The algorithm URI corresponding to the type of wrapping to be performed.
Throws:
EncryptionException

EncryptedKey

public EncryptedKey(Key kek,
                    Key wrappedKey,
                    String wrappingAlg)
             throws EncryptionException
Wraps a key with another key.

Parameters:
kek - The key to be used to wrap the key.
wrappedKey - The key to be wrapped.
Throws:
EncryptionException

EncryptedKey

public EncryptedKey(XMLInputStream in,
                    String ns)
             throws XMLStreamException
Throws:
XMLStreamException
Method Detail

setEncryptionMethod

public void setEncryptionMethod(EncryptionMethod em)
                         throws EncryptionException
Specified by:
setEncryptionMethod in class EncryptedType
Throws:
EncryptionException

setRecipient

public void setRecipient(String recipient)

getRecipient

public String getRecipient()

setCarriedKeyName

public void setCarriedKeyName(String carriedKeyName)

getCarriedKeyName

public String getCarriedKeyName()

getReferenceList

public ReferenceList getReferenceList()

setReferenceList

public void setReferenceList(ReferenceList referenceList)

toString

public String toString()
Overrides:
toString in class EncryptedType

getWrappedKey

public Key getWrappedKey()

getWrappedKey

public Key getWrappedKey(EncryptionMethod keyType)
                  throws EncryptionException
Throws:
EncryptionException

getWrappedKey

public static Key getWrappedKey(EncryptionMethod keyType,
                                byte[] keyBytes)
                         throws EncryptionException
Throws:
EncryptionException

getWrappedKeyBytes

protected final byte[] getWrappedKeyBytes()
                                   throws EncryptionException
Throws:
EncryptionException

setWrappedKey

public void setWrappedKey(Key key)
                   throws EncryptionException
Throws:
EncryptionException

toXML

public void toXML(XMLOutputStream xos,
                  int indent)
           throws XMLStreamException
Throws:
XMLStreamException

toXML

public void toXML(XMLOutputStream xos,
                  String ns,
                  int indent)
           throws XMLStreamException
Throws:
XMLStreamException

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception

Copyright 1996, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12c (12.1.3)

Part Number E41849-02