Examples of doFinal()


Examples of javax.crypto.Mac.doFinal()

          SecretKeySpec signingKey = new SecretKeySpec(key, "HmacSHA1");
   
          Mac mac = Mac.getInstance("HmacSHA1");
          mac.init(signingKey);
   
          byte[] rawHmac = mac.doFinal(data);
   
          return encodeBase64(rawHmac);
         
      } catch (NoSuchAlgorithmException nsae) {
          throw new IOException("required algorithm HmacSHA1 is not supported by environment: " + nsae.toString());
View Full Code Here

Examples of javax.crypto.NullCipher.doFinal()

        if (nc.update(BYTES, 0, BYTES.length, out, 0) != BYTES.length) {
            throw new Exception(
                "Error with update(byte[], int, int, byte[], int)");
        }
        // testing doFinal(...)
        if (nc.doFinal() != null) {
            throw new Exception("Error with doFinal()");
        }
        if (nc.doFinal(out, 0) != 0) {
             throw new Exception("Error with doFinal(byte[], 0)");
        }
View Full Code Here

Examples of net.sourceforge.jtds.util.MD4Digest.doFinal()

        byte[] pwd = password.getBytes("UnicodeLittleUnmarked");

        // do the md4 hash of the unicode passphrase...
        MD4Digest md4 = new MD4Digest();
        md4.update(pwd, 0, pwd.length);
        md4.doFinal(key, 0);
        return key;
    }

    /**
     * Used by answerNtlmChallenge. We need the password converted to caps,
View Full Code Here

Examples of net.sourceforge.jtds.util.MD5Digest.doFinal()

    private static byte[] md5(byte[] data)
    {
        MD5Digest md5 = new MD5Digest();
        md5.update(data, 0, data.length);
        byte[] hash = new byte[16];
        md5.doFinal(hash, 0);
        return hash;
    }


    /**
 
View Full Code Here

Examples of org.apache.wss4j.policy.stax.PolicyEnforcer.doFinal()

        OperationSecurityEvent operationSecurityEvent = new OperationSecurityEvent();
        operationSecurityEvent.setOperation(new QName("definitions"));
        policyEnforcer.registerSecurityEvent(operationSecurityEvent);

        policyEnforcer.doFinal();
    }

    @Test
    public void testPolicyNegative() throws Exception {
        String policyString =
View Full Code Here

Examples of org.apache.xml.security.encryption.XMLCipher.doFinal()

        NodeList nodeList = document.getElementsByTagNameNS(
                XMLSecurityConstants.TAG_xenc_EncryptedData.getNamespaceURI(),
                XMLSecurityConstants.TAG_xenc_EncryptedData.getLocalPart()
        );
        Element ee = (Element) nodeList.item(0);
        return cipher.doFinal(document, ee);
    }

    private TestSecurityEventListener verifyUsingStAX(
            byte[] doc, Key decryptionKey, PublicKey signatureVerificationKey) throws Exception {
        return verifyUsingStAX(new ByteArrayInputStream(doc), decryptionKey, signatureVerificationKey);
View Full Code Here

Examples of org.apache.xml.security.stax.ext.Transformer.doFinal()

                    Map<String, Object> transformerProperties = new HashMap<String, Object>(2);
                    transformerProperties.put(
                            AttachmentContentSignatureTransform.ATTACHMENT, attachment);
                    transformer.setProperties(transformerProperties);
                    transformer.transform(inputStream);
                    transformer.doFinal();

                    digestOutputStream.close();

                    //reset the inputStream to be able to reuse it
                    inputStream.reset();
View Full Code Here

Examples of org.apache.xml.security.stax.impl.transformer.TransformBase64Decode.doFinal()

                break;
            }
            xmlSecEvent = (XMLSecEvent) xmlSecEventReader.nextEvent();
        }

        transformBase64Decode.doFinal();

        Assert.assertEquals(16, xmlSecEvents.size());
    }

    @Test
View Full Code Here

Examples of org.apache.xml.security.stax.impl.transformer.TransformEnvelopedSignature.doFinal()

        while (xmlSecEventReader.hasNext()) {
            XMLSecEvent xmlSecEvent = (XMLSecEvent) xmlSecEventReader.nextEvent();
            transformEnvelopedSignature.transform(xmlSecEvent);
        }

        transformEnvelopedSignature.doFinal();

        Assert.assertEquals(19, xmlSecEvents.size());
    }

    @Test
View Full Code Here

Examples of org.apache.xml.security.stax.impl.transformer.TransformIdentity.doFinal()

                break;
            }
            xmlSecEvent = (XMLSecEvent) xmlSecEventReader.nextEvent();
        }

        transformIdentity.doFinal();

        Assert.assertEquals(3, xmlSecEvents.size());
    }

    @Test
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.