Package org.bouncycastle.tsp

Examples of org.bouncycastle.tsp.TimeStampResponseGenerator


  @Override
  public byte[] getTimeStamp(final byte[] request) {
    try {
      TimeStampRequest timeStampRequest = new TimeStampRequest(request);
      TimeStampResponseGenerator timeStampResponseGenerator = new TimeStampResponseGenerator(this.timeStampTokenGenerator, TSPAlgorithms.ALLOWED);
      TimeStampResponse timeStampResponse = timeStampResponseGenerator.generate(timeStampRequest, this.getSerialNumber(), new Date());

      timeStampResponse.validate(timeStampRequest);

      return timeStampResponse.getEncoded();
    } catch (Exception e) {
View Full Code Here


  }
 
  public TimeStampResponse timestamp(TimeStampRequest timestampRequest)  {
    TimeStampTokenGenerator tokenGenerator = createTokenGenerator(timestampRequest);
   
    TimeStampResponseGenerator respGen = new TimeStampResponseGenerator(
        tokenGenerator, TSPAlgorithms.ALLOWED);
   
    Date tsDate = new Date();
    TimeStampResponse response;
    try {
      response = respGen.generate(timestampRequest, keystore.getCertificate().getSerialNumber(), tsDate);
    } catch (Exception e) {
      throw new RuntimeException("Could not generate timestamp response", e);
    }
   
    return response;
View Full Code Here

  @Override
  public byte[] getTimeStamp(final byte[] request) {
    try {
      TimeStampRequest timeStampRequest = new TimeStampRequest(request);
      TimeStampResponseGenerator timeStampResponseGenerator = new TimeStampResponseGenerator(this.timeStampTokenGenerator, TSPAlgorithms.ALLOWED);
      TimeStampResponse timeStampResponse = timeStampResponseGenerator.generate(timeStampRequest, this.getSerialNumber(), new Date());

      timeStampResponse.validate(timeStampRequest);

      return timeStampResponse.getEncoded();
    } catch (Exception e) {
View Full Code Here

  @Override
  public byte[] getTimeStamp(final byte[] request) {
    try {
      TimeStampRequest timeStampRequest = new TimeStampRequest(request);
      TimeStampResponseGenerator timeStampResponseGenerator = new TimeStampResponseGenerator(this.timeStampTokenGenerator, TSPAlgorithms.ALLOWED);
      TimeStampResponse timeStampResponse = timeStampResponseGenerator.generate(timeStampRequest, this.getSerialNumber(), new Date());

      timeStampResponse.validate(timeStampRequest);

      return timeStampResponse.getEncoded();
    } catch (Exception e) {
View Full Code Here

  @Override
  public byte[] getTimeStamp(final byte[] request) {
    try {
      TimeStampRequest timeStampRequest = new TimeStampRequest(request);
      TimeStampResponseGenerator timeStampResponseGenerator = new TimeStampResponseGenerator(this.timeStampTokenGenerator, TSPAlgorithms.ALLOWED);
      TimeStampResponse timeStampResponse = timeStampResponseGenerator.generate(timeStampRequest, this.getSerialNumber(), new Date());

      timeStampResponse.validate(timeStampRequest);

      return timeStampResponse.getEncoded();
    } catch (Exception e) {
View Full Code Here

  @Override
  public byte[] getTimeStamp(final byte[] request) {
    try {
      TimeStampRequest timeStampRequest = new TimeStampRequest(request);
      TimeStampResponseGenerator timeStampResponseGenerator = new TimeStampResponseGenerator(this.timeStampTokenGenerator, TSPAlgorithms.ALLOWED);
      TimeStampResponse timeStampResponse = timeStampResponseGenerator.generate(timeStampRequest, this.getSerialNumber(), new Date());

      timeStampResponse.validate(timeStampRequest);

      return timeStampResponse.getEncoded();
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.bouncycastle.tsp.TimeStampResponseGenerator

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.