UpdateMetadataKeyInfo.java revision 4a2f0f0be43dfd4c1b490cbf3cc48b6ba6084b1c
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008 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: UpdateMetadataKeyInfo.java,v 1.5 2009/10/29 00:03:50 exu Exp $
*
*/
/**
* Export Meta Data.
*/
public class UpdateMetadataKeyInfo extends AuthenticatedCommand {
// costant to remove cert alias from entity
private boolean sign;
private String spSigningAlias;
private String idpSigningAlias;
private String attrqSigningAlias;
private String attraSigningAlias;
private String authnaSigningAlias;
private String pepSigningAlias;
private String pdpSigningAlias;
private String spEncryptionAlias;
private String idpEncryptionAlias;
private String attrqEncryptionAlias;
private String attraEncryptionAlias;
private String authnaEncryptionAlias;
private String pepEncryptionAlias;
private String pdpEncryptionAlias;
private boolean isWebBase;
/**
* Updates key information in metadata.
* Both signing and encryption are supported for Service Provider,
* Identuty Provider, Attribute Query Provider, Attribute Authority,
* Authentication Authority, XACML PEP and XACML PDP.
* Two information will be updated in this call:
* 1. The signing/ecnryption alias in the extended metadata.
* 2. The KeyDescriptor for signing/encryption in the extended metadata.
*
* @param rc Request Context.
* @throws CLIException if unable to process this request.
*/
throws CLIException {
super.handleRequest(rc);
ldapLogin();
/* TODO : handle other alias
attrqSigningAlias =
getStringOptionValue(FedCLIConstants.ARGUMENT_ATTRQ_S_CERT_ALIAS);
attraSigningAlias =
getStringOptionValue(FedCLIConstants.ARGUMENT_ATTRA_S_CERT_ALIAS);
authnaSigningAlias =
getStringOptionValue(FedCLIConstants.ARGUMENT_AUTHNA_S_CERT_ALIAS);
pepSigningAlias =
getStringOptionValue(FedCLIConstants.ARGUMENT_PEP_S_CERT_ALIAS);
pdpSigningAlias =
getStringOptionValue(FedCLIConstants.ARGUMENT_PDP_S_CERT_ALIAS);
attrqEncryptionAlias =
getStringOptionValue(FedCLIConstants.ARGUMENT_ATTRQ_E_CERT_ALIAS);
attraEncryptionAlias =
getStringOptionValue(FedCLIConstants.ARGUMENT_ATTRA_E_CERT_ALIAS);
authnaEncryptionAlias =
getStringOptionValue(FedCLIConstants.ARGUMENT_AUTHNA_E_CERT_ALIAS);
pepEncryptionAlias =
getStringOptionValue(FedCLIConstants.ARGUMENT_PEP_E_CERT_ALIAS);
pdpEncryptionAlias =
getStringOptionValue(FedCLIConstants.ARGUMENT_PDP_E_CERT_ALIAS);
*/
"ATTEMPT_UPDATE_ENTITY_KEYINFO", params);
try {
"SUCCEEDED_UPDATE_ENTITY_KEYINFO", params);
"SUCCEEDED_UPDATE_ENTITY_KEYINFO", params);
"SUCCEEDED_UPDATE_ENTITY_KEYINFO", params);
} else {
throw new CLIException(
getResourceString("unsupported-specification"),
}
} catch (CLIException e) {
"FAILED_UPDATE_ENTITY_KEYINFO", args);
throw e;
}
}
private void validateOptions()
throws CLIException {
throw new CLIException(getResourceString(
"update-meta-keyinfo-exception-alias-null"),
}
}
private void normalizeOptions() {
if (idpSigningAlias == null) {
idpSigningAlias = "";
}
if (idpEncryptionAlias == null) {
idpEncryptionAlias = "";
}
if (spSigningAlias == null) {
spSigningAlias = "";
}
if (spEncryptionAlias == null) {
spEncryptionAlias = "";
}
}
try {
if (descriptor == null) {
"update-meta-keyinfo-exception-entity-not-exist"),
}
} else {
}
}
} else {
}
}
} else {
entityID, spEncryptionAlias, false, false,
}
}
} else {
entityID, idpEncryptionAlias, false, true,
}
}
} catch (SAML2Exception e) {
throw new CLIException(e.getMessage(),
}
}
try {
if (descriptor == null) {
"update-meta-keyinfo-exception-entity-not-exist"),
}
} else {
}
}
} else {
}
}
} else {
entityID, spEncryptionAlias, false, false,
}
}
} else {
entityID, idpEncryptionAlias, false, true,
}
}
} catch (IDFFMetaException e) {
throw new CLIException(e.getMessage(),
}
}
try {
ssoToken);
if (descriptor == null) {
"update-meta-keyinfo-exception-entity-not-exist"),
}
} else {
}
}
} else {
}
}
"update-meta-keyinfo-exception-invalid-option"),
}
"update-meta-keyinfo-exception-invalid-option"),
}
} catch (WSFederationMetaException e) {
"UpdateMetaKey.handleIDFFRequest", e);
throw new CLIException(e.getMessage(),
}
}
}