示例#1
0
  @Test(testName = "clear key request data from request")
  public void keyRequestDataErr()
      throws ExecutionException, InterruptedException, IOException, MslEncodingException,
          NoSuchAlgorithmException, MslCryptoException, URISyntaxException,
          InvalidAlgorithmParameterException, MslKeyExchangeException {
    clientConfig =
        new ClientConfiguration()
            .setScheme("http")
            .setHost(getRemoteEntityUrl())
            .setPath(PATH)
            .setNumThreads(numThreads)
            .setEntityAuthenticationScheme(EntityAuthenticationScheme.PSK)
            .setIsPeerToPeer(false)
            .setUserAuthenticationScheme(UserAuthenticationScheme.EMAIL_PASSWORD)
            .clearKeyRequestData();
    clientConfig.commitConfiguration();

    serverConfig.isMessageEncrypted(true).commitToServer();

    MessageInputStream message = sendReceive(TIME_OUT);

    thenTheErr(message)
        .shouldBe()
        .validateHdr()
        .shouldHave()
        .validateErrCode(MslConstants.ResponseCode.KEYX_REQUIRED);
  }
示例#2
0
 @BeforeMethod
 public void setup() throws IOException, URISyntaxException {
   if (serverConfig == null) {
     super.loadProperties();
     serverConfig = new ServerConfiguration().setHost(getRemoteEntityUrl()).setPath(PATH);
     serverConfig.commitToServer();
   }
 }