/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: EncryptedResourceID.java,v 1.4 2008/06/25 05:47:10 qcheng Exp $
*
*/
/**
* The class <code>EncryptedResourceID</code> represents an Encryption
* Resource ID element for the Discovery Service.
* <p>The following schema fragment specifies the expected content within the
* <code>EncryptedResourceID</code> object.
* <p>
* <pre>
* <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>
* </pre>
*
* @supported.all.api
*/
public class EncryptedResourceID {
/**
* Default constructor.
*/
public EncryptedResourceID() {}
/**
* Constructor.
* @param elem <code>EncryptedResourceID</code> DOM element
* @exception DiscoveryException if error occurs
*/
}
/**
* Constructs a encrypted resource ID.
*
* @param elem <code>EncryptedResourceID</code> DOM element
* @param nspaceURI Name space URI for this element. By default, Discovery
* name space is used.
* @exception DiscoveryException if error occurs.
*/
throws DiscoveryException {
}
throws DiscoveryException {
throw new DiscoveryException(
}
{
throw new DiscoveryException(
}
+ "ent):Included more than one EncryptedData.");
}
throw new DiscoveryException(
}
+ "ent):Included more than one EncryptedKey.");
}
throw new DiscoveryException(
}
} else {
+ "invalid node" + nodeName);
}
throw new DiscoveryException(
}
}
}
+ " EncryptedData element.");
}
throw new DiscoveryException(
}
}
/**
* Constructor.
* @param encryptedData Encrypted data in DOM Element.
* @param encryptedKey Encrypted key in DOM Element.
*/
{
key = encryptedKey;
}
/**
* Sets encrypted data element.
*
* @param data encrypted data element.
* @see #getEncryptedData()
*/
}
/**
* Gets encrypted data.
*
* @return encrypted data.
* @see #setEncryptedData(Element)
*/
return data;
}
/**
* Gets encrypted key element.
*
* @return encrypted key element.
* @see #setEncryptedKey(Element)
*/
return key;
}
/**
* Sets encrypted key element.
*
* @param key encrypted key element.
* @see #getEncryptedKey()
*/
}
/**
* Returns an instance of <code>ResourceID</code> object. It takes an
* instance of <code>EncryptedResourceID</code> and decrypts the contents
* using the decryption key of the provider ID.
*
* @param eri <code>EncryptedResourceID</code> instance that needs to be
* decrypted.
* @param providerID The provider ID whose decryption key that needs to be
* used for decryption.
* @throws DiscoveryException if error occurs during the operation.
*/
throws DiscoveryException {
throw new DiscoveryException(
}
try {
} catch (Exception e) {
+ "ID: decryption exception:", e);
throw new DiscoveryException(e);
}
return result;
}
/**
* Returns an <code>EncryptedResourceID</code> object. It takes a
* resource ID and provider ID, encrypts the resource ID based on the
* encryption key of the provider ID.
*
* @param ri The resource ID instance that needs to be encrypted.
* @param providerID The provider ID whose encryption key needs to be used
* for encryption.
* @throws DiscoveryException if error occurs during this operation.
*/
) throws DiscoveryException {
+ "ID: null input value");
throw new DiscoveryException(
}
try {
0,
} catch (Exception e) {
+ "ID: encryption exception:", e);
throw new DiscoveryException(e);
}
return eri;
}
/**
* Returns string format.
*
* @return formatted string.
*/
return toString(namespaceURI);
}
/**
* Returns string format.
*
* @param ns namespace value
* @return formatted string.
*/
}
}
}
}