Examples of KeyInfoType


Examples of org.opensaml.xml.signature.KeyInfoType

*/
public class KeyInfoTypeUnmarshaller extends AbstractXMLSignatureUnmarshaller {

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
        KeyInfoType keyInfo = (KeyInfoType) xmlObject;

        if (attribute.getLocalName().equals(KeyInfoType.ID_ATTRIB_NAME)) {
            keyInfo.setID(attribute.getValue());
            attribute.getOwnerElement().setIdAttributeNode(attribute, true);
        } else {
            super.processAttribute(xmlObject, attribute);
        }
    }
View Full Code Here

Examples of org.picketlink.identity.xmlsec.w3.xmldsig.KeyInfoType

                                }
                               }
                               value = keyValue;
                           }
                        }
                        KeyInfoType keyInfo = new KeyInfoType();
                        keyInfo.addContent(value);
                        requestContext.setProofTokenInfo(keyInfo);
                    } else if (value instanceof KeyInfoType) {
                        requestContext.setProofTokenInfo((KeyInfoType) value);
                    } else
                        throw new WSTrustException(logger.unsupportedType(value.toString()));
View Full Code Here

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

           
            QueryKeyBindingType queryKeyBindingType = xKMSObjectFactory.createQueryKeyBindingType();
            if(isCertQuery){
              X509DataType x509DataType = sigFactory.createX509DataType();
                x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(sigFactory.createX509DataTypeX509Certificate(queryCert));
                KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
                keyInfoType.getContent().add(sigFactory.createX509Data(x509DataType));
                queryKeyBindingType.setKeyInfo(keyInfoType);
            }else{
              UseKeyWithType useKeyWithType = xKMSObjectFactory.createUseKeyWithType();
              useKeyWithType.setApplication(queryType);
              useKeyWithType.setIdentifier(queryVal);
View Full Code Here

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

            reissueRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_X509CHAIN);
           
            String keyBindingId =  "_" + orgCert.getSerialNumber().toString();
            X509DataType x509DataType = sigFactory.createX509DataType();
            x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(sigFactory.createX509DataTypeX509Certificate(orgCert.getEncoded()));
            KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
            keyInfoType.getContent().add(sigFactory.createX509Data(x509DataType));
           
            KeyBindingType keyBindingType = xKMSObjectFactory.createKeyBindingType();               
            keyBindingType.setKeyInfo(keyInfoType);
            keyBindingType.setId(keyBindingId);
            reissueRequestType.setReissueKeyBinding(keyBindingType);   
View Full Code Here

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

            recoverRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_X509CHAIN);           
            recoverRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_PRIVATEKEY);
           
            X509DataType x509DataType = sigFactory.createX509DataType();
            x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(sigFactory.createX509DataTypeX509Certificate(orgCert.getEncoded()));
            KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
            keyInfoType.getContent().add(sigFactory.createX509Data(x509DataType));
           
            String keyBindingId = "_" + CertTools.getSerialNumber(orgCert).toString();
            KeyBindingType keyBindingType = xKMSObjectFactory.createKeyBindingType();               
            keyBindingType.setKeyInfo(keyInfoType);
            keyBindingType.setId(keyBindingId);
View Full Code Here

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

            revokeRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_X509CHAIN);           
            revokeRequestType.getRespondWith().add(XKMSConstants.RESPONDWITH_PRIVATEKEY);
           
            X509DataType x509DataType = sigFactory.createX509DataType();
            x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(sigFactory.createX509DataTypeX509Certificate(orgCert.getEncoded()));
            KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
            keyInfoType.getContent().add(sigFactory.createX509Data(x509DataType));
           
            String keyBindingId = "_" + CertTools.getSerialNumber(orgCert).toString();
            KeyBindingType keyBindingType = xKMSObjectFactory.createKeyBindingType();               
            keyBindingType.setKeyInfo(keyInfoType);
            keyBindingType.setId(keyBindingId);
View Full Code Here

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

           
            RegisterResultType registerResultType = null;
            if(genKeys == null){
              registerResultType = getXKMSInvoker().register(registerRequestType, clientCert, privateKey, password, null, keyBindingId);
            }else{
              KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
                RSAKeyValueType rsaKeyValueType = sigFactory.createRSAKeyValueType();
                rsaKeyValueType.setExponent(((RSAPublicKey) genKeys.getPublic()).getPublicExponent().toByteArray());
                rsaKeyValueType.setModulus(((RSAPublicKey) genKeys.getPublic()).getModulus().toByteArray());
                JAXBElement<RSAKeyValueType> rsaKeyValue = sigFactory.createRSAKeyValue(rsaKeyValueType);
                keyInfoType.getContent().add(rsaKeyValue);
               
                prototypeKeyBinding.setKeyInfo(keyInfoType);
             
              registerResultType = getXKMSInvoker().register(registerRequestType, clientCert, privateKey, password, genKeys.getPrivate(), keyBindingId);             
            }
View Full Code Here

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

          

     retval.setId("_" + cert.getSerialNumber().toString(16));            
     retval.setValidityInterval(getValidityInterval(cert));

     KeyInfoType keyInfoType = sigFactory.createKeyInfoType();

     if(req.getRespondWith().contains(XKMSConstants.RESPONDWITH_KEYNAME)){
       String keyName = cert.getSubjectDN().toString();
       keyInfoType.getContent().add(sigFactory.createKeyName(keyName));                         
     }

     if(req.getRespondWith().contains(XKMSConstants.RESPONDWITH_KEYVALUE)){
       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;
       }
     }

     if(req.getRespondWith().contains(XKMSConstants.RESPONDWITH_X509CERT) ||
         req.getRespondWith().contains(XKMSConstants.RESPONDWITH_X509CHAIN) ||
         req.getRespondWith().contains(XKMSConstants.RESPONDWITH_X509CRL)){
           X509DataType x509DataType = sigFactory.createX509DataType();
       if(req.getRespondWith().contains(XKMSConstants.RESPONDWITH_X509CERT) && !req.getRespondWith().contains(XKMSConstants.RESPONDWITH_X509CHAIN)){
         try {             
           x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(sigFactory.createX509DataTypeX509Certificate(cert.getEncoded()));
         } catch (CertificateEncodingException e) {
           log.error(intres.getLocalizedMessage("xkms.errordecodingcert"),e);          
           resultMajor = XKMSConstants.RESULTMAJOR_RECIEVER;
           resultMinor = XKMSConstants.RESULTMINOR_FAILURE;
         }
       }
       if(req.getRespondWith().contains(XKMSConstants.RESPONDWITH_X509CHAIN)){
         int caid = CertTools.getIssuerDN(cert).hashCode();
         try {
           Iterator<Certificate> iter = caAdminSession.getCAInfo(pubAdmin, caid).getCertificateChain().iterator();
           while(iter.hasNext()){
             X509Certificate next = (X509Certificate) iter.next();
             x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(sigFactory.createX509DataTypeX509Certificate(next.getEncoded()));
           }
           x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(sigFactory.createX509DataTypeX509Certificate(cert.getEncoded()));
         } catch (Exception e) {
           log.error(intres.getLocalizedMessage("xkms.errorfetchinglastcrl"),e);          
           resultMajor = XKMSConstants.RESULTMAJOR_RECIEVER;
           resultMinor = XKMSConstants.RESULTMINOR_FAILURE;
         }
       }
       if(req.getRespondWith().contains(XKMSConstants.RESPONDWITH_X509CRL)){
         byte[] crl = null;
         try {
           crl = createCrlSession.getLastCRL(pubAdmin, CertTools.getIssuerDN(cert), false);
         } catch (Exception e) {
           log.error(intres.getLocalizedMessage("xkms.errorfetchinglastcrl"),e);
           resultMajor = XKMSConstants.RESULTMAJOR_RECIEVER;
           resultMinor = XKMSConstants.RESULTMINOR_FAILURE;
         }
         x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().add(sigFactory.createX509DataTypeX509CRL(crl));
       }       
       keyInfoType.getContent().add(sigFactory.createX509Data(x509DataType));
      
     }
     retval.setKeyInfo(keyInfoType);
     retval.getKeyUsage().addAll(getCertKeyUsageSpec(cert));
    try {
View Full Code Here

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

        useKeyWithType.setApplication(XKMSConstants.USEKEYWITH_PKIX);
        useKeyWithType.setIdentifier("CN=Test Testarsson");
       
        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);
        prototypeKeyBindingType.setId("100231");
        registerRequestType.setPrototypeKeyBinding(prototypeKeyBindingType);               
View Full Code Here

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

    // If keyInfo Exists
    if(queryKeyBindingType.getKeyInfo() != null){                
      X509Certificate queryCert = null;
      // Only X509 Certificate and X509Chain is supported
      KeyInfoType keyInfoType = queryKeyBindingType.getKeyInfo();   
     
     
      if(keyInfoType.getContent().size() > 0 ){             
        JAXBElement<X509DataType> x509DataType = (JAXBElement<X509DataType>) keyInfoType.getContent().get(0);

        Iterator iter = x509DataType.getValue().getX509IssuerSerialOrX509SKIOrX509SubjectName().iterator();
        while(iter.hasNext()){
          JAXBElement next = (JAXBElement) iter.next();         
          if(next.getName().getLocalPart().equals("X509Certificate")){
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.