Package org.jcp.xml.dsig.internal

Examples of org.jcp.xml.dsig.internal.MacOutputStream


        if (outputLengthSet && outputLength < getDigestLength()) {
            throw new XMLSignatureException
                ("HMACOutputLength must not be less than " + getDigestLength());
        }
        hmac.init((SecretKey) key);
        si.canonicalize(context, new MacOutputStream(hmac));
        byte[] result = hmac.doFinal();

        return MessageDigest.isEqual(sig, result);
    }
View Full Code Here


        if (outputLengthSet && outputLength < getDigestLength()) {
            throw new XMLSignatureException
                ("HMACOutputLength must not be less than " + getDigestLength());
        }
        hmac.init((SecretKey) key);
        si.canonicalize(context, new MacOutputStream(hmac));
        return hmac.doFinal();
    }
View Full Code Here

        }
        if (log.isLoggable(Level.FINE)) {
            log.log(Level.FINE, "outputLength = " + outputLength);
  }
        hmac.init(key, outputLength);
  si.canonicalize(context, new MacOutputStream(hmac));
        return hmac.verify(sig);
    }
View Full Code Here

  throws InvalidKeyException, XMLSignatureException {
        if (key == null || si == null) {
            throw new NullPointerException();
        }
        hmac.init(key, outputLength);
  si.canonicalize(context, new MacOutputStream(hmac));

        try {
            return hmac.sign();
        } catch (SignatureException se) {
            // should never occur!
View Full Code Here

        }
        if (log.isLoggable(Level.FINE)) {
            log.log(Level.FINE, "outputLength = " + outputLength);
        }
        hmac.init((SecretKey) key);
        si.canonicalize(context, new MacOutputStream(hmac));
        byte[] result = hmac.doFinal();
        if (log.isLoggable(Level.FINE)) {
            log.log(Level.FINE, "resultLength = " + result.length);
        }
        if (outputLength != -1) {
View Full Code Here

            } catch (NoSuchAlgorithmException nsae) {
                throw new XMLSignatureException(nsae);
            }
        }
        hmac.init((SecretKey) key);
        si.canonicalize(context, new MacOutputStream(hmac));
        byte[] result = hmac.doFinal();
        if (outputLength != -1) {
            int byteLength = outputLength/8;
            if (result.length > byteLength) {
                byte[] truncated = new byte[byteLength];
View Full Code Here

        }
        if (log.isLoggable(Level.FINE)) {
            log.log(Level.FINE, "outputLength = " + outputLength);
  }
        hmac.init(key, outputLength);
  si.canonicalize(context, new MacOutputStream(hmac));
        return hmac.verify(sig);
    }
View Full Code Here

  throws InvalidKeyException, XMLSignatureException {
        if (key == null || si == null) {
            throw new NullPointerException();
        }
        hmac.init(key, outputLength);
  si.canonicalize(context, new MacOutputStream(hmac));

        try {
            return hmac.sign();
        } catch (SignatureException se) {
            // should never occur!
View Full Code Here

        if (outputLengthSet && outputLength < getDigestLength()) {
            throw new XMLSignatureException
                ("HMACOutputLength must not be less than " + getDigestLength());
        }
        hmac.init((SecretKey) key);
        si.canonicalize(context, new MacOutputStream(hmac));
        byte[] result = hmac.doFinal();

        return MessageDigest.isEqual(sig, result);
    }
View Full Code Here

        if (outputLengthSet && outputLength < getDigestLength()) {
            throw new XMLSignatureException
                ("HMACOutputLength must not be less than " + getDigestLength());
        }
        hmac.init((SecretKey) key);
        si.canonicalize(context, new MacOutputStream(hmac));
        return hmac.doFinal();
    }
View Full Code Here

TOP

Related Classes of org.jcp.xml.dsig.internal.MacOutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.