Package org.w3._2000._09.xmldsig_

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


        useKeyWithType.setIdentifier("CN=wrong");

        registerRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_X509CHAIN);

        KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
        RSAKeyValueType rsaKeyValueType = sigFactory.createRSAKeyValueType();
        rsaKeyValueType.setExponent(((RSAPublicKey) keys3.getPublic()).getPublicExponent().toByteArray());
        rsaKeyValueType.setModulus(((RSAPublicKey) keys3.getPublic()).getModulus().toByteArray());
        JAXBElement<RSAKeyValueType> rsaKeyValue = sigFactory.createRSAKeyValue(rsaKeyValueType);
        keyInfoType.getContent().add(rsaKeyValue);
        PrototypeKeyBindingType prototypeKeyBindingType = xKMSObjectFactory.createPrototypeKeyBindingType();
        prototypeKeyBindingType.getUseKeyWith().add(useKeyWithType);
        prototypeKeyBindingType.setKeyInfo(keyInfoType);
View Full Code Here


        useKeyWithType.setIdentifier(dn1);

        registerRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_X509CHAIN);

        KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
        RSAKeyValueType rsaKeyValueType = sigFactory.createRSAKeyValueType();
        rsaKeyValueType.setExponent(((RSAPublicKey) keys.getPublic()).getPublicExponent().toByteArray());
        rsaKeyValueType.setModulus(((RSAPublicKey) keys.getPublic()).getModulus().toByteArray());
        JAXBElement<RSAKeyValueType> rsaKeyValue = sigFactory.createRSAKeyValue(rsaKeyValueType);
        keyInfoType.getContent().add(rsaKeyValue);
        PrototypeKeyBindingType prototypeKeyBindingType = xKMSObjectFactory.createPrototypeKeyBindingType();
        prototypeKeyBindingType.getUseKeyWith().add(useKeyWithType);
        prototypeKeyBindingType.setKeyInfo(keyInfoType);
View Full Code Here

        useKeyWithType.setIdentifier(dn3);

        registerRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_X509CHAIN);

        KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
        RSAKeyValueType rsaKeyValueType = sigFactory.createRSAKeyValueType();
        rsaKeyValueType.setExponent(((RSAPublicKey) keys.getPublic()).getPublicExponent().toByteArray());
        rsaKeyValueType.setModulus(((RSAPublicKey) keys.getPublic()).getModulus().toByteArray());
        JAXBElement<RSAKeyValueType> rsaKeyValue = sigFactory.createRSAKeyValue(rsaKeyValueType);
        keyInfoType.getContent().add(rsaKeyValue);
        PrototypeKeyBindingType prototypeKeyBindingType = xKMSObjectFactory.createPrototypeKeyBindingType();
        prototypeKeyBindingType.getUseKeyWith().add(useKeyWithType);
        prototypeKeyBindingType.setKeyInfo(keyInfoType);
View Full Code Here

        useKeyWithType.setIdentifier(dn3);

        registerRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_X509CHAIN);

        KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
        RSAKeyValueType rsaKeyValueType = sigFactory.createRSAKeyValueType();
        rsaKeyValueType.setExponent(((RSAPublicKey) keys.getPublic()).getPublicExponent().toByteArray());
        rsaKeyValueType.setModulus(((RSAPublicKey) keys.getPublic()).getModulus().toByteArray());
        JAXBElement<RSAKeyValueType> rsaKeyValue = sigFactory.createRSAKeyValue(rsaKeyValueType);
        keyInfoType.getContent().add(rsaKeyValue);
        PrototypeKeyBindingType prototypeKeyBindingType = xKMSObjectFactory.createPrototypeKeyBindingType();
        prototypeKeyBindingType.getUseKeyWith().add(useKeyWithType);
        prototypeKeyBindingType.setKeyInfo(keyInfoType);
View Full Code Here

        useKeyWithType.setIdentifier(dn3);

        registerRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_X509CHAIN);

        KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
        RSAKeyValueType rsaKeyValueType = sigFactory.createRSAKeyValueType();
        rsaKeyValueType.setExponent(((RSAPublicKey) keys.getPublic()).getPublicExponent().toByteArray());
        rsaKeyValueType.setModulus(((RSAPublicKey) keys.getPublic()).getModulus().toByteArray());
        JAXBElement<RSAKeyValueType> rsaKeyValue = sigFactory.createRSAKeyValue(rsaKeyValueType);
        keyInfoType.getContent().add(rsaKeyValue);
        PrototypeKeyBindingType prototypeKeyBindingType = xKMSObjectFactory.createPrototypeKeyBindingType();
        prototypeKeyBindingType.getUseKeyWith().add(useKeyWithType);
        prototypeKeyBindingType.setKeyInfo(keyInfoType);
View Full Code Here

                                        }
                                    }
                                    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);
View Full Code Here

                    dsaKeyValKDV.getKeyDataValueList().add(seedValKDV);

                    KeyDataValue yValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "Y", dsaKeyVal.getY(), null, dsaKeyValKDV);
                    dsaKeyValKDV.getKeyDataValueList().add(yValKDV);
                } else if (childVal instanceof RSAKeyValueType) {
                    RSAKeyValueType rsaKeyVal = (RSAKeyValueType)childVal;
                    String rsaKeyValueTagName = kvJAXB.getName().getLocalPart();
                    KeyDataValue rsaKeyValKDV = new KeyDataValue(null, RSAKeyValueType.class.getSimpleName(), rsaKeyValueTagName, null, null, childKDV);
                    childKDV.getKeyDataValueList().add(rsaKeyValKDV);

                    KeyDataValue exponentValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "Exponent", rsaKeyVal.getExponent(), null, rsaKeyValKDV);
                    rsaKeyValKDV.getKeyDataValueList().add(exponentValKDV);
                   
                    KeyDataValue modulusValKDV = new KeyDataValue(null, byte[].class.getSimpleName(), "Modulus", rsaKeyVal.getModulus(), null, rsaKeyValKDV);
                    rsaKeyValKDV.getKeyDataValueList().add(modulusValKDV);
                }
            }
        }
        return modelKeyValueKDV;
View Full Code Here

               
                // References
                List<Reference> modelReferenceList = modelSignedInfo.getReference();
                List<ReferenceType> apiReferenceList = apiSignedInfoType.getReference();
                for (Reference modelRef : modelReferenceList) {
                    ReferenceType apiRef = new ReferenceType();
                    String refUri = modelRef.getUri();
                    if (refUri == null) {
                        refUri = "";
                    }
                    apiRef.setURI(refUri);
                   
                    List<SignatureTransform> modelSigTransformList = modelRef.getTransforms();
                    TransformsType apiTransformsType = apiRef.getTransforms();
                    if (apiTransformsType == null) {
                        apiTransformsType = new TransformsType();
                        apiRef.setTransforms(apiTransformsType);
                    }
                    List<TransformType> apiTransformList = apiTransformsType.getTransform();
                    for (SignatureTransform modelSigTransform : modelSigTransformList) {
                        String modelTransformAlgStr = modelSigTransform.getTransform();
                        TransformType apiTransform = new TransformType();
                        apiTransform.setAlgorithm(modelTransformAlgStr);
                       
                        List<SignatureTransformDataValue> sigTransformSDVList = modelSigTransform.getSignatureTransformDataValue();
                        for (SignatureTransformDataValue sigTransformSDV : sigTransformSDVList) {
                            String type = sigTransformSDV.getContentType();
                            byte[] xformBytes = sigTransformSDV.getContentBytes();
                            Object transformObject = convertDataToTransformContent(type, xformBytes);
                            apiTransform.getContent().add(transformObject);
                        }
                       
                        apiTransformList.add(apiTransform);
                    }
                   
                    String digestMethodStr = modelRef.getDigestMethod();
                    byte[] digestValBytes = modelRef.getDigestValue();
                   
                    DigestMethodType apiDigestMethod = new DigestMethodType();
                    apiDigestMethod.setAlgorithm(digestMethodStr);
                    apiRef.setDigestMethod(apiDigestMethod);
                    apiRef.setDigestValue(digestValBytes);
                   
                    apiReferenceList.add(apiRef);
                }
               
                // Signature Value
View Full Code Here

                        mapModelKeyDataValue(modelKeyDataValue.getKeyDataValueList(), childKeyDataList);
                        x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().addAll(childKeyDataList);
                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), X509DataType.class, x509DataType);
                        parentKeyDataList.add(dataJAXB);  
                    } else if (dataType.equals(RetrievalMethodType.class.getSimpleName())) {
                        RetrievalMethodType retrievalMethodType = new RetrievalMethodType();
                        TransformsType transformsType = new TransformsType();
                        for (KeyDataValue retrievalMethodKDV : modelKeyDataValue.getKeyDataValueList()) {
                            if (retrievalMethodKDV.getKeyDataName().equals("Transform")) {
                                TransformType tType = new TransformType();
                                tType.setAlgorithm(retrievalMethodKDV.getKeyDataValueString());
                               
                                for (KeyDataValue transformContentKDV: retrievalMethodKDV.getKeyDataValueList()) {
                                    String type = transformContentKDV.getKeyDataType();
                                    byte[] xformBytes = transformContentKDV.getKeyDataValueBytes();
                                    Object transformObject = convertDataToTransformContent(type, xformBytes);
                                    tType.getContent().add(transformObject);
                                }
                               
                                transformsType.getTransform().add(tType);
                            } else if (retrievalMethodKDV.getKeyDataName().equals("Type")) {
                                retrievalMethodType.setType(retrievalMethodKDV.getKeyDataValueString());
                            } else if (retrievalMethodKDV.getKeyDataName().equals("URI")) {
                                retrievalMethodType.setURI(retrievalMethodKDV.getKeyDataValueString());
                            } else {
                                throw new RuntimeException("Unrecognized key data type: " + retrievalMethodKDV.getKeyDataType());
                            }
                        }
                        if (transformsType.getTransform() != null && !transformsType.getTransform().isEmpty()) {
                            retrievalMethodType.setTransforms(transformsType);
                        }
                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), RetrievalMethodType.class, retrievalMethodType);
                        parentKeyDataList.add(dataJAXB);  
                    } else if (dataType.equals(PGPDataType.class.getSimpleName())) {
                        PGPDataType pgpDataType = new PGPDataType();
View Full Code Here

                            modelKeyValueKDV.setKeyDataType("String");
                            modelKeyValueKDV.setKeyDataValueString((String)apiKeyInfoContentJAXB.getValue());
                            modelKeyValueKDV.setKeyInfo(modelKeyInfo);
                            keyInfoDataValues.add(modelKeyValueKDV);
                        } else if (apiKeyInfoContentTagName.equals("RetrievalMethod")) {
                            RetrievalMethodType retrievalMethodType = (RetrievalMethodType)apiKeyInfoContentJAXB.getValue();
                            KeyDataValue retrievalMethodTypeKDV = mapRetrievalMethod(apiKeyInfoContentTagName, modelKeyInfo, retrievalMethodType);
                            keyInfoDataValues.add(retrievalMethodTypeKDV);
                        } else if (apiKeyInfoContentTagName.equals("PGPData")) {
                            PGPDataType pgpDataType = (PGPDataType)apiKeyInfoContentJAXB.getValue();
                            KeyDataValue pgpDataTypeKDV = mapPGPDataType(apiKeyInfoContentTagName, modelKeyInfo, pgpDataType);
View Full Code Here

TOP

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

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.