IntegrityHmac.java revision 661
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Copyright 1999-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
*
* @author $Author: mullan $
*/
public abstract class IntegrityHmac extends SignatureAlgorithmSpi {
/** {@link java.util.logging} logging facility */
/**
* Method engineGetURI
*
*@inheritDoc
*/
public abstract String engineGetURI();
/** Field _macAlgorithm */
/** Field _HMACOutputLength */
int _HMACOutputLength = 0;
/**
* Method IntegrityHmacSHA1das
*
* @throws XMLSignatureException
*/
public IntegrityHmac() throws XMLSignatureException {
try {
ex.getLocalizedMessage() };
}
}
/**
* Proxy method for {@link java.security.Signature#setParameter(java.security.spec.AlgorithmParameterSpec)}
* which is executed on the internal {@link java.security.Signature} object.
*
* @param params
* @throws XMLSignatureException
*/
throws XMLSignatureException {
throw new XMLSignatureException("empty");
}
public void reset() {
}
/**
* Proxy method for {@link java.security.Signature#verify(byte[])}
* which is executed on the internal {@link java.security.Signature} object.
*
* @param signature
* @return true if the signature is correct
* @throws XMLSignatureException
*/
protected boolean engineVerify(byte[] signature)
throws XMLSignatureException {
try {
}
this._HMACOutputLength);
} catch (IllegalStateException ex) {
}
}
/**
* Proxy method for {@link java.security.Signature#initVerify(java.security.PublicKey)}
* which is executed on the internal {@link java.security.Signature} object.
*
* @param secretKey
* @throws XMLSignatureException
*/
throw new XMLSignatureException("algorithms.WrongKeyForThisOperation",
exArgs);
}
try {
} catch (InvalidKeyException ex) {
// reinstantiate Mac object to work around bug in JDK
try {
} catch (Exception e) {
// this shouldn't occur, but if it does, restore previous Mac
}
this._macAlgorithm = mac;
}
}
}
/**
* Proxy method for {@link java.security.Signature#sign()}
* which is executed on the internal {@link java.security.Signature} object.
*
* @return the result of the {@link java.security.Signature#sign()} method
* @throws XMLSignatureException
*/
protected byte[] engineSign() throws XMLSignatureException {
try {
return completeResult;
}
this._HMACOutputLength);
} catch (IllegalStateException ex) {
}
}
/**
* Method reduceBitLength
*
* @param completeResult
* @return the reduced bits.
* @param length
*
*/
? 0
: 1)];
if (abits > 0) {
(byte) 0xF0, (byte) 0xF8, (byte) 0xFC, (byte) 0xFE };
}
return strippedResult;
}
/**
* Method engineInitSign
*
* @param secretKey
* @throws XMLSignatureException
*/
throw new XMLSignatureException("algorithms.WrongKeyForThisOperation",
exArgs);
}
try {
} catch (InvalidKeyException ex) {
}
}
/**
* Method engineInitSign
*
* @param secretKey
* @param algorithmParameterSpec
* @throws XMLSignatureException
*/
protected void engineInitSign(
throws XMLSignatureException {
throw new XMLSignatureException("algorithms.WrongKeyForThisOperation",
exArgs);
}
try {
} catch (InvalidKeyException ex) {
} catch (InvalidAlgorithmParameterException ex) {
}
}
/**
* Method engineInitSign
*
* @param secretKey
* @param secureRandom
* @throws XMLSignatureException
*/
throws XMLSignatureException {
throw new XMLSignatureException("algorithms.CannotUseSecureRandomOnMAC");
}
/**
* Proxy method for {@link java.security.Signature#update(byte[])}
* which is executed on the internal {@link java.security.Signature} object.
*
* @param input
* @throws XMLSignatureException
*/
try {
} catch (IllegalStateException ex) {
}
}
/**
* Proxy method for {@link java.security.Signature#update(byte)}
* which is executed on the internal {@link java.security.Signature} object.
*
* @param input
* @throws XMLSignatureException
*/
try {
} catch (IllegalStateException ex) {
}
}
/**
* Proxy method for {@link java.security.Signature#update(byte[], int, int)}
* which is executed on the internal {@link java.security.Signature} object.
*
* @param buf
* @param offset
* @param len
* @throws XMLSignatureException
*/
throws XMLSignatureException {
try {
} catch (IllegalStateException ex) {
}
}
/**
* Method engineGetJCEAlgorithmString
* @inheritDoc
*
*/
protected String engineGetJCEAlgorithmString() {
return this._macAlgorithm.getAlgorithm();
}
/**
* Method engineGetJCEAlgorithmString
*
* @inheritDoc
*/
protected String engineGetJCEProviderName() {
}
/**
* Method engineSetHMACOutputLength
*
* @param HMACOutputLength
*/
protected void engineSetHMACOutputLength(int HMACOutputLength) {
this._HMACOutputLength = HMACOutputLength;
}
/**
* Method engineGetContextFromElement
*
* @param element
*/
super.engineGetContextFromElement(element);
throw new IllegalArgumentException("element null");
}
if (hmaclength != null) {
}
}
/**
* Method engineAddContextToElement
*
* @param element
*/
{
throw new IllegalArgumentException("null element");
}
if (this._HMACOutputLength != 0) {
}
}
/**
* Class IntegrityHmacSHA1
*
* @author $Author: mullan $
* @version $Revision: 1.5 $
*/
public static class IntegrityHmacSHA1 extends IntegrityHmac {
/**
* Constructor IntegrityHmacSHA1
*
* @throws XMLSignatureException
*/
public IntegrityHmacSHA1() throws XMLSignatureException {
super();
}
/**
* Method engineGetURI
* @inheritDoc
*
*/
public String engineGetURI() {
return XMLSignature.ALGO_ID_MAC_HMAC_SHA1;
}
}
/**
* Class IntegrityHmacSHA256
*
* @author $Author: mullan $
* @version $Revision: 1.5 $
*/
public static class IntegrityHmacSHA256 extends IntegrityHmac {
/**
* Constructor IntegrityHmacSHA256
*
* @throws XMLSignatureException
*/
public IntegrityHmacSHA256() throws XMLSignatureException {
super();
}
/**
* Method engineGetURI
*
* @inheritDoc
*/
public String engineGetURI() {
return XMLSignature.ALGO_ID_MAC_HMAC_SHA256;
}
}
/**
* Class IntegrityHmacSHA384
*
* @author $Author: mullan $
* @version $Revision: 1.5 $
*/
public static class IntegrityHmacSHA384 extends IntegrityHmac {
/**
* Constructor IntegrityHmacSHA384
*
* @throws XMLSignatureException
*/
public IntegrityHmacSHA384() throws XMLSignatureException {
super();
}
/**
* Method engineGetURI
* @inheritDoc
*
*/
public String engineGetURI() {
return XMLSignature.ALGO_ID_MAC_HMAC_SHA384;
}
}
/**
* Class IntegrityHmacSHA512
*
* @author $Author: mullan $
* @version $Revision: 1.5 $
*/
public static class IntegrityHmacSHA512 extends IntegrityHmac {
/**
* Constructor IntegrityHmacSHA512
*
* @throws XMLSignatureException
*/
public IntegrityHmacSHA512() throws XMLSignatureException {
super();
}
/**
* Method engineGetURI
* @inheritDoc
*
*/
public String engineGetURI() {
return XMLSignature.ALGO_ID_MAC_HMAC_SHA512;
}
}
/**
* Class IntegrityHmacRIPEMD160
*
* @author $Author: mullan $
* @version $Revision: 1.5 $
*/
public static class IntegrityHmacRIPEMD160 extends IntegrityHmac {
/**
* Constructor IntegrityHmacRIPEMD160
*
* @throws XMLSignatureException
*/
public IntegrityHmacRIPEMD160() throws XMLSignatureException {
super();
}
/**
* Method engineGetURI
*
* @inheritDoc
*/
public String engineGetURI() {
}
}
/**
* Class IntegrityHmacMD5
*
* @author $Author: mullan $
* @version $Revision: 1.5 $
*/
public static class IntegrityHmacMD5 extends IntegrityHmac {
/**
* Constructor IntegrityHmacMD5
*
* @throws XMLSignatureException
*/
public IntegrityHmacMD5() throws XMLSignatureException {
super();
}
/**
* Method engineGetURI
*
* @inheritDoc
*/
public String engineGetURI() {
}
}
}