/**
* 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: FSSignatureManager.java,v 1.2 2008/06/25 05:47:05 qcheng Exp $
*
*/
/**
* Util class used to sign a string and verify signature on a string.
*/
public class FSSignatureManager {
// Singleton instance of FSSignatureManager
/**
* Constructor.
*/
protected FSSignatureManager() {
sp = new FSSignatureProvider();
}
/**
* Constructor.
*/
{
sp = sigProvider;
}
/**
* Returns the singleton instance of <code>FSSignatureManager</code> with
* default <code>KeyProvider</code> and <code>SignatureProvider</code>.
* @return a <code>FSSignatureManager</code> instance
*/
synchronized (FSSignatureManager.class) {
+ " of FSSignatureManager");
}
instance = new FSSignatureManager();
}
}
}
return (instance);
}
/**
* Returns an instance of <code>FSSignatureManager</code> with specified
* <code>KeyProvider</code> and <code>SignatureProvider</code>.
* @param keyProvider <code>KeyProvider</code> instance
* @param sigProvider <code>SignatureProvider</code> instance
* @return a <code>FSSignatureManager</code> instance
*/
{
}
/**
* Signs a String using enveloped signatures and default signature
* algorithm.
* @param data string that needs to be signed
* @param certAlias Signer's certificate alias name
* @return byte array which contains signature object
* @exception FSSignatureException if an error occurred during the signing
* process
*/
throws FSSignatureException {
}
/**
* Signs a string using enveloped signatures.
* @param data string that needs to be signed
* @param certAlias Signer's certificate alias name
* @param algorithm signing algorithm
* @return byte array which contains signature Element object
* @exception FSSignatureException if an error occurred during the signing
* process
*/
throws FSSignatureException {
}
/**
* Verifies the signature of a signed string.
* @param data string whose signature to be verified
* @param signature signature in byte array
* @param algorithm signing algorithm
* @param cert Signer's certificate
* @return <code>true</code> if the xml signature is verified;
* <code>false</code> otherwise
* @exception FSSignatureException if problem occurs during verification
*/
byte[] signature,
throws FSSignatureException {
}
/**
* Returns the key provider.
* @return <code>KeyProvider</code> instance
*/
return sp.getKeyProvider();
}
}