/**
* 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: FSSignatureProvider.java,v 1.5 2009/06/08 23:41:51 madan_ranganath Exp $
*
*/
/**
* This class implements interface <code>SignatureProviderSPI</code>.
*/
/**
* Default Constructor.
*/
public FSSignatureProvider() {
}
/**
* Initializes the provider.
* @param keyProvider <code>KeyProvider</code> object
*/
if (keyProvider == null) {
+ "is null");
} else {
}
}
/**
* 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 {
+ "signed is null.");
throw new FSSignatureException(
}
+ "null.");
throw new FSSignatureException(
}
try{
+ "algorithm is null assigning algorithm= "
+ algorithm);
}
}
if(!isValidAlgorithm(algorithm)){
+ "algorithm is invalid ");
throw new FSSignatureException(
}
+ stackTrace);
}
}
}
{
if (rsaProviderName == null) {
try {
break;
} catch (NoSuchAlgorithmException nsa) {
}
}
} else {
}
throw new NoSuchProviderException();
}
return sig;
}
/**
* 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 {
+ "data to be signed is null.");
throw new FSSignatureException (
}
try {
throw new FSSignatureException(
}
if(!isValidAlgorithm(algorithm)){
throw new FSSignatureException(
}
}
} else {
return false;
}
+ stackTrace);
}
}
}
/**
* Returns the key provider.
* @return <code>KeyProvider</code> instance
*/
return keystore;
}
return true;
} else {
return false;
}
}
}