Package gov.niarl.his.privacyca

Examples of gov.niarl.his.privacyca.TpmIdentityRequest


          log.info("--read EC from file--");
          ecFileIn.close();
          } else {
              ekCert = TpmModule.getCredential(TpmOwnerAuth, "EC");
          }
      TpmIdentityRequest encryptedEkCert = new TpmIdentityRequest(ekCert, (RSAPublicKey)pcaCert.getPublicKey(), false);
     
 
      TpmIdentity newId = TpmModule.collateIdentityRequest(TpmOwnerAuth, HisIdentityAuth, HisIdentityLabel, new TpmPubKey((RSAPublicKey)pcaCert.getPublicKey(), 3, 1).toByteArray(), HisIdentityIndex, (X509Certificate)null, !shortcut);
     
                       
//                        HttpsURLConnection.setDefaultHostnameVerifier(new NopX509HostnameVerifier()); // XXX TODO Bug #497 need to allow caller to specify a TlsPolicy // disabled for testing issue #541
                       
      IHisPrivacyCAWebService2 hisPrivacyCAWebService2 = HisPrivacyCAWebServices2ClientInvoker.getHisPrivacyCAWebService2(PrivacyCaUrl);
      byte[] encrypted1 = hisPrivacyCAWebService2.identityRequestGetChallenge(newId.getIdentityRequest(), encryptedEkCert.toByteArray());
      if(encrypted1.length == 1){
        throw new PrivacyCAException("Identity request was rejected by Privacy CA in phase 1 of process");
      }
      //TpmKey aik = new TpmKey(newId.getAikBlob());
     
      int os = IdentityOS.osType();//return os type. win:0; linux:1; other:-1
     
      byte[] asym1 = new byte[256];
      System.arraycopy(encrypted1, 0, asym1, 0, asym1.length);
      byte[] sym1 = new byte[encrypted1.length - 256];
      System.arraycopy(encrypted1, 256, sym1, 0, sym1.length);
      byte[] decrypted1;
      if (os==1){//linux
        decrypted1 = TpmModule.activateIdentity(ownerAuthRaw, keyAuthRaw, asym1, sym1, HisIdentityIndex);

      }else
        //decrypted1 = TpmModuleJava.ActivateIdentity(asym1, sym1, aik, keyAuthRaw, srkAuthRaw, ownerAuthRaw); //Comments  temporarily due to TSSCoreService.jar compiling issue
        decrypted1 = TpmModule.activateIdentity(ownerAuthRaw, keyAuthRaw, asym1, sym1, HisIdentityIndex);
     
      TpmIdentityRequest encryptedChallenge = new TpmIdentityRequest(decrypted1, (RSAPublicKey)pcaCert.getPublicKey(), false);
      byte[] encrypted2 = hisPrivacyCAWebService2.identityRequestSubmitResponse(encryptedChallenge.toByteArray());
      if(encrypted2.length == 1){
        log.warning("Identity request was rejected by Privacy CA in phase 2 of process");
        throw new Exception("Identity request was rejected by Privacy CA in phase 2 of process");
      }
      byte[] asym2 = new byte[256];
View Full Code Here

TOP

Related Classes of gov.niarl.his.privacyca.TpmIdentityRequest

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.