Package org.w3._2002._03.xkms_

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


   protected List<UseKeyWithType> genUseKeyWithAttributes(X509Certificate cert, List<UseKeyWithType> reqUsages) throws Exception{
     ArrayList<UseKeyWithType> retval = new ArrayList<UseKeyWithType>();
    
     Iterator<UseKeyWithType> iter = reqUsages.iterator();
     while(iter.hasNext()){
       UseKeyWithType useKeyWithType =  iter.next();
       DNFieldExtractor altNameExtractor = new DNFieldExtractor(CertTools.getSubjectAlternativeName(cert),DNFieldExtractor.TYPE_SUBJECTALTNAME);
       String cn = CertTools.getPartFromDN(cert.getSubjectDN().toString(), "CN");
      
      
       if(useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_XKMS)||
            useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_XKMSPROFILE) ||
            useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_TLS)){
          if(altNameExtractor.getField(DNFieldExtractor.URI, 0).startsWith(useKeyWithType.getIdentifier())){
            retval.add(useKeyWithType);
          }
       }
       if(useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_SMIME)||
          useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_PGP)){
          if(altNameExtractor.getField(DNFieldExtractor.RFC822NAME, 0).startsWith(useKeyWithType.getIdentifier())){
              retval.add(useKeyWithType);
        }        
       }
       if(useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_TLSHTTP)){        
          if(cn.startsWith(useKeyWithType.getIdentifier())){
              retval.add(useKeyWithType);
        }                                   
       }
       if(useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_TLSSMTP)){
          if(altNameExtractor.getField(DNFieldExtractor.DNSNAME, 0).startsWith(useKeyWithType.getIdentifier())){
              retval.add(useKeyWithType);
        }        
       }
       if(useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_IPSEC)){
          if(altNameExtractor.getField(DNFieldExtractor.IPADDRESS, 0).startsWith(useKeyWithType.getIdentifier())){
              retval.add(useKeyWithType);
        }        
       }
       if(useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_PKIX)){
          if(CertTools.getSubjectDN(cert).equalsIgnoreCase(CertTools.stringToBCDNString(useKeyWithType.getIdentifier()))){
              retval.add(useKeyWithType);
        }        
       }
     }
    
View Full Code Here


       if(!retvalEmpty){
        retval.add(Query.CONNECTOR_OR);  
       }
      
       UseKeyWithType useKeyWithType =  iter.next();
       if(useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_XKMS)||
            useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_XKMSPROFILE) ||
            useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_TLS)){
          retval.add(UserMatch.MATCH_WITH_URI,UserMatch.MATCH_TYPE_BEGINSWITH,useKeyWithType.getIdentifier());
          retvalEmpty=false;
       }
       if(useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_SMIME)||
          useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_PGP)){
         retval.add(UserMatch.MATCH_WITH_RFC822NAME,UserMatch.MATCH_TYPE_BEGINSWITH,useKeyWithType.getIdentifier());
         retvalEmpty=false;
       }
       if(useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_TLSHTTP)){
         retval.add(UserMatch.MATCH_WITH_COMMONNAME,UserMatch.MATCH_TYPE_BEGINSWITH,useKeyWithType.getIdentifier());
         retvalEmpty=false;        
       }
       if(useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_TLSSMTP)){
         retval.add(UserMatch.MATCH_WITH_DNSNAME,UserMatch.MATCH_TYPE_BEGINSWITH,useKeyWithType.getIdentifier());
         retvalEmpty=false;        
       }      
       if(useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_IPSEC)){
         retval.add(UserMatch.MATCH_WITH_IPADDRESS,UserMatch.MATCH_TYPE_BEGINSWITH,useKeyWithType.getIdentifier());
         retvalEmpty=false;
       }
       if(useKeyWithType.getApplication().equals(XKMSConstants.USEKEYWITH_PKIX)){
         retval.add(UserMatch.MATCH_WITH_DN,UserMatch.MATCH_TYPE_EQUALS,CertTools.stringToBCDNString(useKeyWithType.getIdentifier()));
         retvalEmpty=false;
       }
      

     }
View Full Code Here

        // Test simple validate
        ValidateRequestType validateRequestType = xKMSObjectFactory.createValidateRequestType();
        validateRequestType.setId("200");

        UseKeyWithType useKeyWithType = xKMSObjectFactory.createUseKeyWithType();
        useKeyWithType.setApplication(XKMSConstants.USEKEYWITH_TLSHTTP);
        useKeyWithType.setIdentifier("Test");

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

        QueryKeyBindingType queryKeyBindingType = xKMSObjectFactory.createQueryKeyBindingType();
        queryKeyBindingType.getUseKeyWith().add(useKeyWithType);
View Full Code Here

        // Test simple validate
        ValidateRequestType validateRequestType = xKMSObjectFactory.createValidateRequestType();
        validateRequestType.setId("200");

        UseKeyWithType useKeyWithType = xKMSObjectFactory.createUseKeyWithType();
        useKeyWithType.setApplication(XKMSConstants.USEKEYWITH_TLSHTTP);
        useKeyWithType.setIdentifier("Test");

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

        QueryKeyBindingType queryKeyBindingType = xKMSObjectFactory.createQueryKeyBindingType();
        queryKeyBindingType.getUseKeyWith().add(useKeyWithType);
View Full Code Here

        // Test simple validate
        ValidateRequestType validateRequestType = xKMSObjectFactory.createValidateRequestType();
        validateRequestType.setId("201");

        UseKeyWithType useKeyWithType = xKMSObjectFactory.createUseKeyWithType();
        useKeyWithType.setApplication(XKMSConstants.USEKEYWITH_TLSHTTP);
        useKeyWithType.setIdentifier("Test");

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

        QueryKeyBindingType queryKeyBindingType = xKMSObjectFactory.createQueryKeyBindingType();
        queryKeyBindingType.getUseKeyWith().add(useKeyWithType);
View Full Code Here

        // Test simple validate
        ValidateRequestType validateRequestType = xKMSObjectFactory.createValidateRequestType();
        validateRequestType.setId("200");

        UseKeyWithType useKeyWithType = xKMSObjectFactory.createUseKeyWithType();
        useKeyWithType.setApplication(XKMSConstants.USEKEYWITH_TLSHTTP);
        useKeyWithType.setIdentifier("Test");

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

        QueryKeyBindingType queryKeyBindingType = xKMSObjectFactory.createQueryKeyBindingType();
        queryKeyBindingType.getUseKeyWith().add(useKeyWithType);
View Full Code Here

        Key key = clientKeyStore.getKey(alias, "foo123".toCharArray());

        RegisterRequestType registerRequestType = xKMSObjectFactory.createRegisterRequestType();
        registerRequestType.setId("500");

        UseKeyWithType useKeyWithType = xKMSObjectFactory.createUseKeyWithType();
        useKeyWithType.setApplication(XKMSConstants.USEKEYWITH_PKIX);
        useKeyWithType.setIdentifier("CN=Test Testarsson");

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

        KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
        RSAKeyValueType rsaKeyValueType = sigFactory.createRSAKeyValueType();
View Full Code Here

        java.security.cert.X509Certificate pkCert = (java.security.cert.X509Certificate) clientKeyStore.getCertificate(alias);

        RegisterRequestType registerRequestType = xKMSObjectFactory.createRegisterRequestType();
        registerRequestType.setId("500");

        UseKeyWithType useKeyWithType = xKMSObjectFactory.createUseKeyWithType();
        useKeyWithType.setApplication(XKMSConstants.USEKEYWITH_PKIX);
        useKeyWithType.setIdentifier("CN=Test Testarsson");

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

        KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
        RSAKeyValueType rsaKeyValueType = sigFactory.createRSAKeyValueType();
View Full Code Here

    protected String getSubjectDN(RequestAbstractType req) {
      String retval = null;
   
      Iterator<UseKeyWithType> iter = GeneralizedKRSSMessageHelper.getKeyBindingAbstractType(req).getUseKeyWith().iterator();
      while(iter.hasNext()){
        UseKeyWithType next = iter.next();
        if(next.getApplication().equals(XKMSConstants.USEKEYWITH_PKIX)){
          retval = CertTools.stringToBCDNString(next.getIdentifier());
          break;
        }
      }
     
      if(retval == null){
View Full Code Here

    private Certificate simpleRegistration(String dn, boolean willFail) throws Exception {

        RegisterRequestType registerRequestType = xKMSObjectFactory.createRegisterRequestType();
        registerRequestType.setId("600");

        UseKeyWithType useKeyWithType = xKMSObjectFactory.createUseKeyWithType();
        useKeyWithType.setApplication(XKMSConstants.USEKEYWITH_PKIX);
        useKeyWithType.setIdentifier(dn);

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

        KeyInfoType keyInfoType = sigFactory.createKeyInfoType();
        RSAKeyValueType rsaKeyValueType = sigFactory.createRSAKeyValueType();
View Full Code Here

TOP

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

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.