Package org.w3._2002._03.xkms_

Examples of org.w3._2002._03.xkms_.StatusType


              String revokeCode = getRevocationCode(req);
              if(XKMSConfig.isRevocationAllowed()){
                if(revokeCode != null ){
                X509Certificate newCert = revoke(revokeCode, revocationCodeId, cert);
                if(newCert != null && req.getRespondWith().size() > 0){
                  KeyBindingAbstractType keyBinding = getResponseValues(req.getRevokeKeyBinding(), newCert, true, false);
                  result.getKeyBinding().add((KeyBindingType) keyBinding);
                }
                }
              }else{
                resultMajor = XKMSConstants.RESULTMAJOR_SENDER;
View Full Code Here


              }
              String revocationCode = getRevocationCode(req);
              if(password != null ){
                X509Certificate cert = registerReissueOrRecover(false,false, result, userData,password, publicKey, revocationCode);
                if(cert != null){
                  KeyBindingAbstractType keyBinding = getResponseValues(req.getPrototypeKeyBinding(), cert, false, true);
                  result.getKeyBinding().add((KeyBindingType) keyBinding);
                }
              }
            }
          }
View Full Code Here

                }
              }
              if(password != null ){
                newCert = registerReissueOrRecover(false,true, result, userData,password, cert.getPublicKey(), null);
                if(newCert != null){
                  KeyBindingAbstractType keyBinding = getResponseValues(req.getReissueKeyBinding(), newCert, false, true);
                  result.getKeyBinding().add((KeyBindingType) keyBinding);
                }
              }
            }
          }
View Full Code Here

            }

            if(password != null ){
              X509Certificate newCert = registerReissueOrRecover(true,false, result, userData,password,  cert.getPublicKey(), null);
              if(newCert != null){
                KeyBindingAbstractType keyBinding = getResponseValues(req.getRecoverKeyBinding(), newCert, false, true);
                result.getKeyBinding().add((KeyBindingType) keyBinding);
              }
            }
          }
View Full Code Here

            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);   
                              
            PrivateKey privateKey = (PrivateKey) ks.getKey(alias, keyPass.toCharArray());
            ReissueResultType reissueResultType = getXKMSInvoker().reissue(reissueRequestType, clientCert, privateKey, authPass, privateKey, keyBindingId);           
            
            if(reissueResultType.getResultMajor().equals(XKMSConstants.RESULTMAJOR_SUCCESS) &&
               reissueResultType.getResultMinor() == null){
           
                if(reissueResultType.getKeyBinding().size() >0){
                  KeyBindingType keyBinding = reissueResultType.getKeyBinding().get(0);                 
                  List certs = getCertsFromKeyBinding(keyBinding);
                   
                  X509Certificate userCert = getUserCert(certs);                 
                  certs.remove(userCert);
                     
View Full Code Here

            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);
            recoverRequestType.setRecoverKeyBinding(keyBindingType)
           
          
           
            RecoverResultType recoverResultType = getXKMSInvoker().recover(recoverRequestType, clientCert, privateKey, password,  keyBindingId);

           
            if(recoverResultType.getResultMajor().equals(XKMSConstants.RESULTMAJOR_SUCCESS) &&
               recoverResultType.getResultMinor() == null){
           
                if(recoverResultType.getKeyBinding().size() >0){
                  KeyBindingType keyBinding = recoverResultType.getKeyBinding().get(0);                 
                  List certs = getCertsFromKeyBinding(keyBinding);
                   
                  X509Certificate userCert = getUserCert(certs);                 
                  certs.remove(userCert);
                 
View Full Code Here

            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);
            revokeRequestType.setRevokeKeyBinding(keyBindingType)
           
            byte[] first = XKMSUtil.getSecretKeyFromPassphrase(revokationCode, true,20, XKMSUtil.KEY_REVOCATIONCODEIDENTIFIER_PASS1).getEncoded();
            revokeRequestType.setRevocationCode(first);          
           
View Full Code Here

           
            if(registerResultType.getResultMajor().equals(XKMSConstants.RESULTMAJOR_SUCCESS) &&
               registerResultType.getResultMinor() == null){
           
                if(registerResultType.getKeyBinding().size() >0){
                  KeyBindingType keyBinding = registerResultType.getKeyBinding().get(0);                 
                  List certs = getCertsFromKeyBinding(keyBinding);
                   
                  X509Certificate userCert = getUserCert(certs);                 
                  certs.remove(userCert);
                 
View Full Code Here

                }
                ValidateResultType validateResult = getXKMSInvoker().validate(validationRequestType, clientCert, privateKey);               
                keyBindings = validateResult.getKeyBinding();                               
               
            }else{
              LocateRequestType locateRequestType = xKMSObjectFactory.createLocateRequestType();
              locateRequestType.setId(reqId);
                Iterator iter = respondWith.iterator();
                while(iter.hasNext()){
                  locateRequestType.getRespondWith().add((String) iter.next());
                }
                locateRequestType.setQueryKeyBinding(queryKeyBindingType);
               
                getPrintStream().println("Sending locate request with id " + reqId + " to XKMS Service");
                if (clientCert == null) {
                    log.info("Client cert was not found and will not be used.");
                }
View Full Code Here

   * Returns a locate response
   */
  public LocateResultType getResponse(boolean requestVerifies){
    LocateResultType result = xkmsFactory.createLocateResultType();   
    super.populateResponse(result, requestVerifies);   
    LocateRequestType req = (LocateRequestType) this.req;
    if(resultMajor == null){    
      if(!checkValidRespondWithRequest(req.getRespondWith())){
        resultMajor = XKMSConstants.RESULTMAJOR_SENDER;
        resultMinor = XKMSConstants.RESULTMINOR_MESSAGENOTSUPPORTED;
      }
      if(resultMajor == null){
        List<X509Certificate> queryResult = processRequest(req.getQueryKeyBinding());
        if (log.isDebugEnabled()) {
          log.debug("processRequest returned " + queryResult.size() + " results.");
        }
        if(resultMajor == null){    
          Iterator<X509Certificate> iter = queryResult.iterator();
          while(iter.hasNext()){
            X509Certificate nextCert = iter.next();
            result.getUnverifiedKeyBinding().add((UnverifiedKeyBindingType) getResponseValues(req.getQueryKeyBinding(),nextCert,false,false));
          }     
        }
      }
    }
    if(resultMajor == null){
View Full Code Here

TOP

Related Classes of org.w3._2002._03.xkms_.StatusType

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.