Package org.jscep.client

Examples of org.jscep.client.CertificateVerificationCallback


  handler = new DefaultCallbackHandler(new ConsoleCertificateVerifier());
    }

    @Test
    public void testYesResponse() throws Exception {
  CertificateVerificationCallback callback = getCallback();

  byte[] bytes = String.format("Y%n").getBytes(Charsets.US_ASCII.name());
  System.setIn(new ByteArrayInputStream(bytes));
  handler.handle(new Callback[] { callback });

  assertTrue(callback.isVerified());
    }
View Full Code Here


  assertTrue(callback.isVerified());
    }

    private CertificateVerificationCallback getCallback() {
  return new CertificateVerificationCallback(cert);
    }
View Full Code Here

  return new CertificateVerificationCallback(cert);
    }

    @Test
    public void testEmptyResponse() throws Exception {
  CertificateVerificationCallback callback = getCallback();

  byte[] bytes = String.format("%n").getBytes(Charsets.US_ASCII.name());
  System.setIn(new ByteArrayInputStream(bytes));
  handler.handle(new Callback[] { callback });

  assertFalse(callback.isVerified());
    }
View Full Code Here

  assertFalse(callback.isVerified());
    }

    @Test
    public void testNoResponse() throws Exception {
  CertificateVerificationCallback callback = getCallback();

  byte[] bytes = String.format("N%n").getBytes(Charsets.US_ASCII.name());
  System.setIn(new ByteArrayInputStream(bytes));
  handler.handle(new Callback[] { callback });

  assertFalse(callback.isVerified());
    }
View Full Code Here

  assertFalse(callback.isVerified());
    }

    @Test
    public void testInvalidResponse() throws Exception {
  CertificateVerificationCallback callback = getCallback();

  byte[] bytes = String.format("X%nY%n").getBytes(
    Charsets.US_ASCII.name());
  System.setIn(new ByteArrayInputStream(bytes));
  handler.handle(new Callback[] { callback });

  assertTrue(callback.isVerified());
    }
View Full Code Here

TOP

Related Classes of org.jscep.client.CertificateVerificationCallback

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.