Examples of ReissueRequestType


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

                outputPath = args[ARG_OUTPUTPATH] + "/";                           
              }
            }

            String reqId = genId();
            ReissueRequestType reissueRequestType = xKMSObjectFactory.createReissueRequestType();
            reissueRequestType.setId(reqId);
            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);   
                              
            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) &&
View Full Code Here

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

   * Returns a reissue response
   */
  public ReissueResultType getResponse(boolean requestVerifies){
    ReissueResultType result = xkmsFactory.createReissueResultType();   
    super.populateResponse(result, requestVerifies);   
    ReissueRequestType req = (ReissueRequestType) this.req;
    // Variables defined here for debug reasons
    boolean isCertValid=false;
    UserDataVO userData = null;
    String password = "";
    X509Certificate newCert = null;
    if(resultMajor == null){    
      if(!checkValidRespondWithRequest(req.getRespondWith(),false)){
        resultMajor = XKMSConstants.RESULTMAJOR_SENDER;
        resultMinor = XKMSConstants.RESULTMINOR_MESSAGENOTSUPPORTED;
      }
      if(resultMajor == null){
        if(resultMajor == null){
          X509Certificate cert = (X509Certificate) getPublicKeyInfo(req, false);
          isCertValid = certIsValid(cert);
          if(isCertValid && confirmPOP(cert.getPublicKey())){           
            userData = findUserData(cert);
            if(userData != null){
              boolean encryptedPassword = isPasswordEncrypted(req);
              if(isCertValid && XKMSConfig.isAutomaticReissueAllowed()){
                password = setUserStatusToNew(userData);
              }else{             
                if(encryptedPassword){
                  password = getEncryptedPassword(requestDoc, userData.getPassword());
                }else{
                  password = getClearPassword(req, userData.getPassword());
                }
              }
              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

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

    }

    public void simpleReissue(String userName, String dn) throws Exception {
        userAdminSession.setUserStatus(administrator, userName, 10);
        userAdminSession.setClearTextPassword(administrator, userName, "ReissuePassword");
        ReissueRequestType reissueRequestType = xKMSObjectFactory.createReissueRequestType();
        reissueRequestType.setId("607");

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

        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("100123122");
        reissueRequestType.setReissueKeyBinding(keyBindingType);

        AuthenticationType authenticationType = xKMSObjectFactory.createAuthenticationType();
        NotBoundAuthenticationType notBoundAuthenticationType = xKMSObjectFactory.createNotBoundAuthenticationType();
        notBoundAuthenticationType.setProtocol("NOTUSED");
        notBoundAuthenticationType.setValue("ReissuePassword".getBytes());
        authenticationType.setNotBoundAuthentication(notBoundAuthenticationType);
        reissueRequestType.setAuthentication(authenticationType);

        ReissueResultType reissueResultType = xKMSInvoker.reissue(reissueRequestType, null, null, null, keys1.getPrivate(), keyBindingType.getId());

        assertTrue(reissueResultType.getResultMajor().equals(XKMSConstants.RESULTMAJOR_SUCCESS));
        assertTrue(reissueResultType.getResultMinor() == null);
View Full Code Here

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

    }

    public void test09ReissueWrongPassword() throws Exception {
        userAdminSession.setUserStatus(administrator, username1, 10);
        userAdminSession.setClearTextPassword(administrator, username1, "ReissuePassword");
        ReissueRequestType reissueRequestType = xKMSObjectFactory.createReissueRequestType();
        reissueRequestType.setId("608");

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

        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("100123122");
        reissueRequestType.setReissueKeyBinding(keyBindingType);

        AuthenticationType authenticationType = xKMSObjectFactory.createAuthenticationType();
        NotBoundAuthenticationType notBoundAuthenticationType = xKMSObjectFactory.createNotBoundAuthenticationType();
        notBoundAuthenticationType.setProtocol("NOTUSED");
        notBoundAuthenticationType.setValue("Wrong".getBytes());
        authenticationType.setNotBoundAuthentication(notBoundAuthenticationType);
        reissueRequestType.setAuthentication(authenticationType);

        ReissueResultType reissueResultType = xKMSInvoker.reissue(reissueRequestType, null, null, null, keys1.getPrivate(), keyBindingType.getId());

        assertTrue(reissueResultType.getResultMajor().equals(XKMSConstants.RESULTMAJOR_SENDER));
        assertTrue(reissueResultType.getResultMinor().equals(XKMSConstants.RESULTMINOR_NOAUTHENTICATION));
View Full Code Here

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

    }

    public void test10ReissueWrongStatus() throws Exception {
        userAdminSession.setUserStatus(administrator, username1, 40);
        userAdminSession.setClearTextPassword(administrator, username1, "ReissuePassword");
        ReissueRequestType reissueRequestType = xKMSObjectFactory.createReissueRequestType();
        reissueRequestType.setId("609");

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

        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("100123122");
        reissueRequestType.setReissueKeyBinding(keyBindingType);

        AuthenticationType authenticationType = xKMSObjectFactory.createAuthenticationType();
        NotBoundAuthenticationType notBoundAuthenticationType = xKMSObjectFactory.createNotBoundAuthenticationType();
        notBoundAuthenticationType.setProtocol("NOTUSED");
        notBoundAuthenticationType.setValue("ReissuePassword".getBytes());
        authenticationType.setNotBoundAuthentication(notBoundAuthenticationType);
        reissueRequestType.setAuthentication(authenticationType);

        ReissueResultType reissueResultType = xKMSInvoker.reissue(reissueRequestType, null, null, null, keys1.getPrivate(), keyBindingType.getId());

        assertTrue(reissueResultType.getResultMajor().equals(XKMSConstants.RESULTMAJOR_SENDER));
        assertTrue(reissueResultType.getResultMinor().equals(XKMSConstants.RESULTMINOR_REFUSED));
View Full Code Here

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

    public void test11ReissueWrongCert() throws Exception {

        userAdminSession.setUserStatus(administrator, username1, 10);
        userAdminSession.setClearTextPassword(administrator, username1, "ReissuePassword");
        ReissueRequestType reissueRequestType = xKMSObjectFactory.createReissueRequestType();
        reissueRequestType.setId("610");

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

        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("100123122");
        reissueRequestType.setReissueKeyBinding(keyBindingType);

        AuthenticationType authenticationType = xKMSObjectFactory.createAuthenticationType();
        NotBoundAuthenticationType notBoundAuthenticationType = xKMSObjectFactory.createNotBoundAuthenticationType();
        notBoundAuthenticationType.setProtocol("NOTUSED");
        notBoundAuthenticationType.setValue("ReissuePassword".getBytes());
        authenticationType.setNotBoundAuthentication(notBoundAuthenticationType);
        reissueRequestType.setAuthentication(authenticationType);

        ReissueResultType reissueResultType = xKMSInvoker.reissue(reissueRequestType, null, null, null, keys1.getPrivate(), keyBindingType.getId());

        assertTrue(reissueResultType.getResultMajor().equals(XKMSConstants.RESULTMAJOR_SENDER));
        assertTrue(reissueResultType.getResultMinor().equals(XKMSConstants.RESULTMINOR_REFUSED));
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.