Package org.w3._2000._09.xmldsig_

Examples of org.w3._2000._09.xmldsig_.KeyValueType


        recoverRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_X509CHAIN);
        recoverRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_PRIVATEKEY);

        X509DataType x509DataType = sigFactory.createX509DataType();
        x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(sigFactory.createX509DataTypeX509Certificate(Constants.getUserCert().getEncoded()));
        KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
        keyInfoType.getContent().add(sigFactory.createX509Data(x509DataType));

        KeyBindingType keyBindingType = xKMSObjectFactory.createKeyBindingType();
        keyBindingType.setKeyInfo(keyInfoType);
        keyBindingType.setId("100123123422");
        recoverRequestType.setRecoverKeyBinding(keyBindingType);
View Full Code Here


        recoverRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_X509CHAIN);
        recoverRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_PRIVATEKEY);

        X509DataType x509DataType = sigFactory.createX509DataType();
        x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(sigFactory.createX509DataTypeX509Certificate(cert2.getEncoded()));
        KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
        keyInfoType.getContent().add(sigFactory.createX509Data(x509DataType));

        KeyBindingType keyBindingType = xKMSObjectFactory.createKeyBindingType();
        keyBindingType.setKeyInfo(keyInfoType);
        keyBindingType.setId("100123123422");
        recoverRequestType.setRecoverKeyBinding(keyBindingType);
View Full Code Here

        RevokeRequestType revokeRequestType = xKMSObjectFactory.createRevokeRequestType();
        revokeRequestType.setId("800");

        X509DataType x509DataType = sigFactory.createX509DataType();
        x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(sigFactory.createX509DataTypeX509Certificate(cert1.getEncoded()));
        KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
        keyInfoType.getContent().add(sigFactory.createX509Data(x509DataType));

        KeyBindingType keyBindingType = xKMSObjectFactory.createKeyBindingType();
        keyBindingType.setKeyInfo(keyInfoType);
        keyBindingType.setId("100123123422");
        revokeRequestType.setRevokeKeyBinding(keyBindingType);
View Full Code Here

        RevokeRequestType revokeRequestType = xKMSObjectFactory.createRevokeRequestType();
        revokeRequestType.setId("801");

        X509DataType x509DataType = sigFactory.createX509DataType();
        x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(sigFactory.createX509DataTypeX509Certificate(cert2.getEncoded()));
        KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
        keyInfoType.getContent().add(sigFactory.createX509Data(x509DataType));

        KeyBindingType keyBindingType = xKMSObjectFactory.createKeyBindingType();
        keyBindingType.setKeyInfo(keyInfoType);
        keyBindingType.setId("100123123422");
        revokeRequestType.setRevokeKeyBinding(keyBindingType);
View Full Code Here

        RevokeRequestType revokeRequestType = xKMSObjectFactory.createRevokeRequestType();
        revokeRequestType.setId("802");

        X509DataType x509DataType = sigFactory.createX509DataType();
        x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(sigFactory.createX509DataTypeX509Certificate(cert2.getEncoded()));
        KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
        keyInfoType.getContent().add(sigFactory.createX509Data(x509DataType));

        KeyBindingType keyBindingType = xKMSObjectFactory.createKeyBindingType();
        keyBindingType.setKeyInfo(keyInfoType);
        keyBindingType.setId("100123123422");
        revokeRequestType.setRevokeKeyBinding(keyBindingType);
View Full Code Here

        RevokeRequestType revokeRequestType = xKMSObjectFactory.createRevokeRequestType();
        revokeRequestType.setId("804");

        X509DataType x509DataType = sigFactory.createX509DataType();
        x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(sigFactory.createX509DataTypeX509Certificate(cert2.getEncoded()));
        KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
        keyInfoType.getContent().add(sigFactory.createX509Data(x509DataType));

        KeyBindingType keyBindingType = xKMSObjectFactory.createKeyBindingType();
        keyBindingType.setKeyInfo(keyInfoType);
        keyBindingType.setId("100123123422");
        revokeRequestType.setRevokeKeyBinding(keyBindingType);
View Full Code Here

                // Revoke via XKMS and verify response
                RevokeRequestType revokeRequestType = xKMSObjectFactory.createRevokeRequestType();
                revokeRequestType.setId("808");
                X509DataType x509DataType = sigFactory.createX509DataType();
                x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(sigFactory.createX509DataTypeX509Certificate(cert.getEncoded()));
                KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
                keyInfoType.getContent().add(sigFactory.createX509Data(x509DataType));
                KeyBindingType keyBindingType = xKMSObjectFactory.createKeyBindingType();
                keyBindingType.setKeyInfo(keyInfoType);
                keyBindingType.setId("424242");
                revokeRequestType.setRevokeKeyBinding(keyBindingType);
                first = XKMSUtil.getSecretKeyFromPassphrase("foo123", true, 20, XKMSUtil.KEY_REVOCATIONCODEIDENTIFIER_PASS1).getEncoded();
                revokeRequestType.setRevocationCode(first);
                RevokeResultType revokeResultType = xKMSInvoker.revoke(revokeRequestType, null, null, null, keyBindingType.getId());
                assertTrue(ERRORNOTSENTFORAPPROVAL, revokeResultType.getResultMajor().equals(XKMSConstants.RESULTMAJOR_SUCCESS));
                assertTrue(ERRORNOTSENTFORAPPROVAL, revokeResultType.getResultMinor().equals(XKMSConstants.RESULTMINOR_INCOMPLETE));
                // Try to revoke via XKMS and verify failure
                revokeRequestType = xKMSObjectFactory.createRevokeRequestType();
                revokeRequestType.setId("810");
                x509DataType = sigFactory.createX509DataType();
                x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(sigFactory.createX509DataTypeX509Certificate(cert.getEncoded()));
                keyInfoType = sigFactory.createKeyInfoType();
                keyInfoType.getContent().add(sigFactory.createX509Data(x509DataType));
                keyBindingType = xKMSObjectFactory.createKeyBindingType();
                keyBindingType.setKeyInfo(keyInfoType);
                keyBindingType.setId("424242");
                revokeRequestType.setRevokeKeyBinding(keyBindingType);
                first = XKMSUtil.getSecretKeyFromPassphrase("foo123", true, 20, XKMSUtil.KEY_REVOCATIONCODEIDENTIFIER_PASS1).getEncoded();
View Full Code Here

                apiSignatureValue.setId(modelSigValue.getXmlID());
                apiSignatureValue.setValue(modelSigValue.getValue());
               
                apiSignature.setSignatureValue(apiSignatureValue);
               
                KeyInfoType apiKeyInfo = new KeyInfoType();
                KeyInfo modelKeyInfo = modelSig.getKeyInfo();
                apiKeyInfo.setId(modelKeyInfo.getXmlID());
               
                List<KeyDataValue> modelKeyDataValueList = modelKeyInfo.getKeyDataValue();
                List<Object> apiX509KeyInfoList = apiKeyInfo.getContent();
                mapModelKeyDataValue(modelKeyDataValueList, apiX509KeyInfoList);
                apiSignature.setKeyInfo(apiKeyInfo);
                apiSignatureList.add(apiSignature);
            }
        }
View Full Code Here

       if(cert.getPublicKey() instanceof RSAPublicKey){ 
         RSAPublicKey pubKey = (RSAPublicKey) cert.getPublicKey();       
         RSAKeyValueType rSAKeyValueType = sigFactory.createRSAKeyValueType();
         rSAKeyValueType.setModulus(pubKey.getModulus().toByteArray());
         rSAKeyValueType.setExponent(pubKey.getPublicExponent().toByteArray());
         KeyValueType keyValue = sigFactory.createKeyValueType();
         keyValue.getContent().add(sigFactory.createRSAKeyValue(rSAKeyValueType));
         keyInfoType.getContent().add(sigFactory.createKeyValue(keyValue));                         
       }else{
         log.error(intres.getLocalizedMessage("xkms.onlyrsakeysupported"));        
         resultMajor = XKMSConstants.RESULTMAJOR_RECIEVER;
         resultMinor = XKMSConstants.RESULTMINOR_FAILURE;
View Full Code Here

                        }
                       
                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), SPKIDataType.class, spkiDataType);
                        parentKeyDataList.add(dataJAXB);
                    } else if (dataType.equals(KeyValueType.class.getSimpleName())) {
                        KeyValueType keyValueType = new KeyValueType();
                        for (KeyDataValue keyValueDataKDV : modelKeyDataValue.getKeyDataValueList()) {
                            for (KeyDataValue keyValueDataChildKDV : keyValueDataKDV.getKeyDataValueList()) {
                                String keyDataDataType = keyValueDataChildKDV.getKeyDataType();
                                if (keyDataDataType.equals("DSAKeyValueType")) {
                                    DSAKeyValueType dsaKeyValueType = new DSAKeyValueType();
                                    for (KeyDataValue dsaKDV : keyValueDataChildKDV.getKeyDataValueList()) {
                                        if ("G".equals(dsaKDV.getKeyDataName())) {
                                            dsaKeyValueType.setG(dsaKDV.getKeyDataValueBytes());
                                        } else if ("P".equals(dsaKDV.getKeyDataName())) {
                                            dsaKeyValueType.setP(dsaKDV.getKeyDataValueBytes());
                                        } else if ("Q".equals(dsaKDV.getKeyDataName())) {
                                            dsaKeyValueType.setQ(dsaKDV.getKeyDataValueBytes());
                                        } else if ("Y".equals(dsaKDV.getKeyDataName())) {
                                            dsaKeyValueType.setY(dsaKDV.getKeyDataValueBytes());
                                        } else if ("J".equals(dsaKDV.getKeyDataName())) {
                                            dsaKeyValueType.setJ(dsaKDV.getKeyDataValueBytes());
                                        } else if ("Seed".equals(dsaKDV.getKeyDataName())) {
                                            dsaKeyValueType.setSeed(dsaKDV.getKeyDataValueBytes());
                                        } else if ("PgenCounter".equals(dsaKDV.getKeyDataName())) {
                                            dsaKeyValueType.setPgenCounter(dsaKDV.getKeyDataValueBytes());
                                        } else {
                                            throw new RuntimeException("Unrecognized dsa type: " + dsaKDV.getKeyDataName());
                                        }
                                    }
                                    JAXBElement jaxb = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", keyValueDataChildKDV.getKeyDataName()), DSAKeyValueType.class, dsaKeyValueType);
                                    keyValueType.getContent().add(jaxb);
                                } else if (keyDataDataType.equals("RSAKeyValueType")) {
                                    RSAKeyValueType rsaKeyValueType = new RSAKeyValueType();
                                    for (KeyDataValue rsaKDV : keyValueDataChildKDV.getKeyDataValueList()) {
                                        if ("Exponent".equals(rsaKDV.getKeyDataName())) {
                                            rsaKeyValueType.setExponent(rsaKDV.getKeyDataValueBytes());
                                        } else if ("Modulus".equals(rsaKDV.getKeyDataName())) {
                                            rsaKeyValueType.setModulus(rsaKDV.getKeyDataValueBytes());
                                        } else {
                                            throw new RuntimeException("Unrecognized dsa type: " + rsaKDV.getKeyDataName());
                                        }
                                    }
                                    JAXBElement jaxb = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", keyValueDataChildKDV.getKeyDataName()), RSAKeyValueType.class, rsaKeyValueType);
                                    keyValueType.getContent().add(jaxb);
                                } else {
                                    throw new RuntimeException("Unrecognized element: " + keyDataDataType);
                                }
                            }
                        }
View Full Code Here

TOP

Related Classes of org.w3._2000._09.xmldsig_.KeyValueType

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.