Class EncryptedResourceID


  • public class EncryptedResourceID
    extends Object
    The class EncryptedResourceID represents an Encryption Resource ID element for the Discovery Service.

    The following schema fragment specifies the expected content within the EncryptedResourceID object.

     <xs:element name="EncryptedResourceID" type="EncryptedResourceIDType"/>
     <complexType name="EncryptedResourceIDType">
       <complexContent>
         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
           <sequence>
             <element ref="{http://www.w3.org/2001/04/xmlenc#}EncryptedData"/>
             <element ref="{http://www.w3.org/2001/04/xmlenc#}EncryptedKey"/>
           </sequence>
         </restriction>
       </complexContent>
     </complexType>
     
    • Constructor Detail

      • EncryptedResourceID

        public EncryptedResourceID()
        Default constructor.
      • EncryptedResourceID

        public EncryptedResourceID​(Element elem,
                                   String nspaceURI)
                            throws DiscoveryException
        Constructs a encrypted resource ID.
        Parameters:
        elem - EncryptedResourceID DOM element
        nspaceURI - Name space URI for this element. By default, Discovery name space is used.
        Throws:
        DiscoveryException - if error occurs.
      • EncryptedResourceID

        public EncryptedResourceID​(Element encryptedData,
                                   Element encryptedKey)
        Constructor.
        Parameters:
        encryptedData - Encrypted data in DOM Element.
        encryptedKey - Encrypted key in DOM Element.
    • Method Detail

      • setEncryptedData

        public void setEncryptedData​(Element data)
        Sets encrypted data element.
        Parameters:
        data - encrypted data element.
        See Also:
        getEncryptedData()
      • setEncryptedKey

        public void setEncryptedKey​(Element key)
        Sets encrypted key element.
        Parameters:
        key - encrypted key element.
        See Also:
        getEncryptedKey()
      • getDecryptedResourceID

        public static ResourceID getDecryptedResourceID​(EncryptedResourceID eri,
                                                        String providerID)
                                                 throws DiscoveryException
        Returns an instance of ResourceID object. It takes an instance of EncryptedResourceID and decrypts the contents using the decryption key of the provider ID.
        Parameters:
        eri - EncryptedResourceID instance that needs to be decrypted.
        providerID - The provider ID whose decryption key that needs to be used for decryption.
        Throws:
        DiscoveryException - if error occurs during the operation.
      • getEncryptedResourceID

        public static EncryptedResourceID getEncryptedResourceID​(ResourceID ri,
                                                                 String providerID)
                                                          throws DiscoveryException
        Returns an EncryptedResourceID object. It takes a resource ID and provider ID, encrypts the resource ID based on the encryption key of the provider ID.
        Parameters:
        ri - The resource ID instance that needs to be encrypted.
        providerID - The provider ID whose encryption key needs to be used for encryption.
        Throws:
        DiscoveryException - if error occurs during this operation.
      • toString

        public String toString()
        Returns string format.
        Overrides:
        toString in class Object
        Returns:
        formatted string.
      • toString

        public String toString​(String ns)
        Returns string format.
        Parameters:
        ns - namespace value
        Returns:
        formatted string.