Package javax.crypto

Examples of javax.crypto.SecretKey


            throws KeySelectorException {
            return new SimpleKSResult(key);
        }
       
        private SecretKey wrapBytes(final byte[] bytes) {
            return new SecretKey() {
                private static final long serialVersionUID = 3457835482691931082L;

                    public String getFormat() {
                        return "RAW";
                    }
View Full Code Here


        DocumentBuilder builder = XMLUtils.createDocumentBuilder(false);
        Document document = builder.parse(sourceDocument);

        // Set up the key
        byte[] hmacKey = "test".getBytes("ASCII");
        SecretKey key = new SecretKeySpec(hmacKey, "http://www.w3.org/2000/09/xmldsig#hmac-sha1");

        // XMLUtils.outputDOM(document, System.out);

        // Convert Document to a Stream Reader
        javax.xml.transform.Transformer transformer = transformerFactory.newTransformer();
View Full Code Here

        DocumentBuilder builder = XMLUtils.createDocumentBuilder(false);
        Document document = builder.parse(sourceDocument);

        // Set up the key
        byte[] hmacKey = "test".getBytes("ASCII");
        SecretKey key = new SecretKeySpec(hmacKey, "http://www.w3.org/2000/09/xmldsig#hmac-sha1");

        // XMLUtils.outputDOM(document, System.out);

        // Convert Document to a Stream Reader
        javax.xml.transform.Transformer transformer = transformerFactory.newTransformer();
View Full Code Here

        properties.setSignatureKey(key);
        X509Certificate cert = (X509Certificate) keyStore.getCertificate("transmitter");
        properties.setSignatureCerts(new X509Certificate[]{cert});

        // Set the key up
        SecretKey encryptionKey = generateDESSecretKey();
        properties.setEncryptionKey(encryptionKey);
        properties.setEncryptionSymAlgorithm("http://www.w3.org/2001/04/xmlenc#tripledes-cbc");

        SecurePart signatureSecurePart =
                new SecurePart(new QName("urn:example:po", "PaymentInfo"), SecurePart.Modifier.Element);
View Full Code Here

        properties.setSignatureKey(key);
        X509Certificate cert = (X509Certificate) keyStore.getCertificate("transmitter");
        properties.setSignatureCerts(new X509Certificate[]{cert});

        // Set the key up
        SecretKey encryptionKey = generateDESSecretKey();
        properties.setEncryptionKey(encryptionKey);
        properties.setEncryptionSymAlgorithm("http://www.w3.org/2001/04/xmlenc#tripledes-cbc");

        SecurePart signatureSecurePart =
                new SecurePart(
View Full Code Here

        properties.setSignatureKey(key);
        X509Certificate cert = (X509Certificate) keyStore.getCertificate("transmitter");
        properties.setSignatureCerts(new X509Certificate[]{cert});

        // Set the key up
        SecretKey encryptionKey = generateDESSecretKey();
        properties.setEncryptionKey(encryptionKey);
        properties.setEncryptionSymAlgorithm("http://www.w3.org/2001/04/xmlenc#tripledes-cbc");

        SecurePart signatureSecurePart =
                new SecurePart(
View Full Code Here

                "default".toCharArray()
        );
        X509Certificate cert = (X509Certificate) keyStore.getCertificate("transmitter");

        // Set the key up
        SecretKey encryptionKey = generateDESSecretKey();

        InputStream sourceDocument =
                this.getClass().getClassLoader().getResourceAsStream(
                        "ie/baltimore/merlin-examples/merlin-xmlenc-five/plaintext.xml");
View Full Code Here

        properties.setActions(actions);
       
        // Set the key up
        byte[] hmacKey = "secret".getBytes("ASCII");
        String signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#hmac-sha1";
        SecretKey key = new SecretKeySpec(hmacKey, signatureAlgorithm);
        properties.setSignatureKey(key);
       
        properties.setSignatureAlgorithm(signatureAlgorithm);
       
        SecurePart securePart = new SecurePart(
View Full Code Here

        properties.setActions(actions);
       
        // Set the key up
        byte[] hmacKey = "secret".getBytes("ASCII");
        String signatureAlgorithm = "http://www.w3.org/2001/04/xmldsig-more#hmac-sha224";
        SecretKey key = new SecretKeySpec(hmacKey, signatureAlgorithm);
        properties.setSignatureKey(key);
       
        properties.setSignatureAlgorithm(signatureAlgorithm);
       
        SecurePart securePart = new SecurePart(
View Full Code Here

        Document document = builder.parse(sourceDocument);

        // Set the key up
        byte[] hmacKey = "secret".getBytes("ASCII");
        String signatureAlgorithm = "http://www.w3.org/2000/09/xmldsig#hmac-sha1";
        SecretKey key = new SecretKeySpec(hmacKey, signatureAlgorithm);

        // Sign using DOM
        List<String> localNames = new ArrayList<String>();
        localNames.add("PaymentInfo");
       
View Full Code Here

TOP

Related Classes of javax.crypto.SecretKey

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.